summaryrefslogtreecommitdiff
path: root/entities/weapons/rad_z_banshee/shared.lua
blob: 00e881a25126f46675072068c6d52861926bfd2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
if SERVER then

	AddCSLuaFile("shared.lua")
	
end

if CLIENT then

	SWEP.ViewModelFOV		= 70
	SWEP.ViewModelFlip		= false
	
	SWEP.PrintName = "Claws"
	SWEP.IconLetter = "C"
	SWEP.Slot = 0
	SWEP.Slotpos = 0
	
	killicon.AddFont( "rad_z_banshee", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
	
end

SWEP.Base = "rad_z_base"

SWEP.ViewModel = "models/Zed/weapons/v_banshee.mdl"

SWEP.Taunt = Sound( "npc/stalker/go_alert2a.wav" )

SWEP.Die = { "npc/headcrab_poison/ph_scream1.wav",
"npc/headcrab_poison/ph_scream2.wav",
"npc/headcrab_poison/ph_scream3.wav"}

SWEP.Primary.Hit            = Sound( "npc/antlion/shell_impact3.wav" )
SWEP.Primary.HitFlesh		= Sound( "npc/antlion/foot4.wav" )
SWEP.Primary.Sound			= Sound( "npc/zombie/zo_attack1.wav" )
SWEP.Primary.Recoil			= 3.5
SWEP.Primary.Damage			= 25
SWEP.Primary.NumShots		= 1
SWEP.Primary.Delay			= 1.900

SWEP.Primary.ClipSize		= 1
SWEP.Primary.Automatic		= true

function SWEP:NoobHelp()

	self.Owner:NoticeOnce( "Right click to use your scream ability", GAMEMODE.Colors.Blue, 5, 10 )
	self.Owner:NoticeOnce( "Your scream will disorient nearby people", GAMEMODE.Colors.Blue, 5, 12 )

end

function SWEP:Holster()

	if SERVER then
	
		self.Owner:EmitSound( table.Random( self.Die ), 100, math.random(40,60) )
	
	end
	
	return true

end

function SWEP:SecondaryAttack()

	self.Weapon:SetNextSecondaryFire( CurTime() + 8 )
	
	if SERVER then
	
		self.Owner:VoiceSound( self.Taunt, 100, math.random( 90, 100 ) )
		
		local hit = false
		
		for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
		
			local dist = v:GetPos():Distance( self.Owner:GetPos() )
			
			if dist <= 350 then
			
				local scale = 1 - ( dist / 350 )
				local count = math.Round( scale * 4 )
				
				umsg.Start( "Drunk", v )
				umsg.Short( count )
				umsg.End()

				umsg.Start( "ScreamHit", v )
				umsg.End()
				
				v:TakeDamage( scale * 20, self.Owner, self.Weapon )
				v:SetDSP( 34, false )
				
				self.Owner:AddZedDamage( 5 )
				
				hit = true
			
			end
		
		end
		
		if hit then
		
			self.Owner:Notice( "You disoriented a human", GAMEMODE.Colors.Green )
		
		end
	
	end

end

function SWEP:PrimaryAttack()
	
	self.Weapon:EmitSound( self.Primary.Sound, 100, math.random(130,150) )
	self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	
	self.ThinkTime = CurTime() + ( self.Primary.Delay * 0.3 )
	
end

function SWEP:OnHitHuman( ent, dmg )

	if ent:GetRadiation() != 5 then

		ent:AddRadiation( 1 )
		
		self.Owner:AddZedDamage( 10 )
		
	end
	
	self.Owner:AddZedDamage( dmg )
	self.Owner:DrawBlood( 4 )
	self.Owner:Notice( "You irradiated a human", GAMEMODE.Colors.Green )

end