zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_repairfield/shared.lua

81 lines
1.8 KiB
Lua
Raw Permalink Normal View History

SWEP.PrintName = "'Sentinel' Repair Field Emitter"
SWEP.Description = "A repair field which slowly repairs all props in a radius with a energy pulse. Consumes pulse ammo.\nPress PRIMARY ATTACK to deploy the repair field.\nPress SECONDARY ATTACK and RELOAD to rotate the repair field."
SWEP.ViewModel = "models/weapons/v_pistol.mdl"
SWEP.WorldModel = Model("models/props/de_nuke/smokestack01.mdl")
SWEP.AmmoIfHas = true
SWEP.Primary.ClipSize = 1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Ammo = "repairfield"
SWEP.Primary.Delay = 1
SWEP.Primary.Automatic = true
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "dummy"
SWEP.ModelScale = 0.55
SWEP.MaxStock = 5
SWEP.Repair = 8
SWEP.MaxDistance = 75
SWEP.WalkSpeed = SPEED_NORMAL
SWEP.FullWalkSpeed = SPEED_SLOWEST
SWEP.ResupplyAmmoType = "pulse"
SWEP.GhostStatus = "ghost_repairfield"
SWEP.DeployClass = "prop_repairfield"
SWEP.NoDeploySpeedChange = true
SWEP.AllowQualityWeapons = true
GAMEMODE:SetPrimaryWeaponModifier(SWEP, WEAPON_MODIFIER_REPAIR, 0.75)
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MAX_DISTANCE, 4)
function SWEP:Initialize()
self:SetWeaponHoldType("slam")
self:SetDeploySpeed(1.1)
self:HideViewAndWorldModel()
end
function SWEP:SetReplicatedAmmo(count)
self:SetDTInt(0, count)
end
function SWEP:GetReplicatedAmmo()
return self:GetDTInt(0)
end
function SWEP:GetWalkSpeed()
if self:GetPrimaryAmmoCount() > 0 then
return self.FullWalkSpeed
end
end
function SWEP:SecondaryAttack()
end
function SWEP:Reload()
end
function SWEP:CanPrimaryAttack()
if self:GetOwner():IsHolding() or self:GetOwner():GetBarricadeGhosting() then return false end
if self:GetPrimaryAmmoCount() <= 0 then
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
return false
end
return true
end
function SWEP:Holster()
return true
end