zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_pulserifle.lua

88 lines
2 KiB
Lua
Raw Normal View History

2014-10-02 08:49:54 +08:00
AddCSLuaFile()
DEFINE_BASECLASS("weapon_zs_base")
2014-10-02 08:49:54 +08:00
SWEP.PrintName = "'Adonis' Pulse Rifle"
SWEP.Description = "Deals massive damage and slows targets."
SWEP.Slot = 2
SWEP.SlotPos = 0
2014-10-02 08:49:54 +08:00
if CLIENT then
2014-10-02 08:49:54 +08:00
SWEP.ViewModelFlip = false
SWEP.ViewModelFOV = 60
SWEP.HUD3DBone = "Vent"
SWEP.HUD3DPos = Vector(1, 0, 0)
2014-10-02 08:49:54 +08:00
SWEP.HUD3DScale = 0.018
end
SWEP.Base = "weapon_zs_base"
SWEP.HoldType = "ar2"
SWEP.ViewModel = "models/weapons/c_irifle.mdl"
SWEP.WorldModel = "models/weapons/w_IRifle.mdl"
SWEP.UseHands = true
SWEP.CSMuzzleFlashes = false
SWEP.ReloadSound = Sound("Weapon_SMG1.Reload")
SWEP.Primary.Sound = Sound("Airboat.FireGunHeavy")
SWEP.Primary.Damage = 29
2014-10-02 08:49:54 +08:00
SWEP.Primary.NumShots = 1
SWEP.Primary.Delay = 0.2
SWEP.Primary.ClipSize = 20
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "pulse"
GAMEMODE:SetupDefaultClip(SWEP.Primary)
SWEP.ConeMax = 3
SWEP.ConeMin = 1
2014-10-02 08:49:54 +08:00
SWEP.WalkSpeed = SPEED_SLOW
SWEP.IronSightsPos = Vector(-3, 1, 1)
SWEP.Tier = 5
SWEP.MaxStock = 2
SWEP.PointsMultiplier = GAMEMODE.PulsePointsMultiplier
2014-10-02 08:49:54 +08:00
SWEP.TracerName = "AR2Tracer"
SWEP.FireAnimSpeed = 0.4
SWEP.LegDamage = 5.5
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_FIRE_DELAY, -0.014, 1)
GAMEMODE:AddNewRemantleBranch(SWEP, 1, "'Servitor' Pulse Rifle", "Refreshes zapper cooldown on kill, more leg damage, reduced accuracy and reload speed", function(wept)
wept.ConeMin = 2.25
wept.ConeMax = 3.75
wept.ReloadSpeed = 0.85
wept.LegDamage = 8
wept.OnZombieKilled = function(self)
local killer = self:GetOwner()
if killer:IsValid() then
for _,v in pairs(ents.FindByClass("prop_zapper*")) do
if v:GetObjectOwner() == killer then
v:SetNextZap(0)
end
end
end
end
end)
2014-10-02 08:49:54 +08:00
function SWEP.BulletCallback(attacker, tr, dmginfo)
local ent = tr.Entity
if ent:IsValidZombie() then
local activ = attacker:GetActiveWeapon()
ent:AddLegDamageExt(activ.LegDamage, attacker, activ, SLOWTYPE_PULSE)
2014-10-02 08:49:54 +08:00
end
if IsFirstTimePredicted() then
util.CreatePulseImpactEffect(tr.HitPos, tr.HitNormal)
end
2014-10-02 08:49:54 +08:00
end