-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflare.pqc
105 lines (100 loc) · 2.16 KB
/
flare.pqc
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
void() FlareGrenadeTouch =
{
self.touch = SUB_Null;
self.velocity = '0 0 0';
if (pointcontents(self.origin) == -6)
{
newmis = spawn();
setmodel(newmis, "progs/flare.spr");
setorigin(newmis, self.origin - '0 0 30');
newmis.movetype = 8;
newmis.solid = TF_FLARE_OFF;
newmis.effects = 4;
newmis.effects = newmis.effects + TF_FLARE_OFF;
sound(newmis, 3, "items/flare1.wav", TF_FLARE_OFF, TF_FLARE_OFF);
newmis.velocity_z = -30;
newmis.velocity_x = random() * 10;
newmis.velocity_y = random() * 10;
newmis.nextthink = time + 30;
newmis.think = SUB_Remove;
newmis.touch = SUB_Remove;
newmis.classname = "flare";
dremove(self);
}
else
{
sound(self, TF_FLARE_OFF, "weapons/bounce.wav", TF_FLARE_OFF, TF_FLARE_OFF);
self.movetype = 6;
}
};
void () FlareGrenadeThink =
{
local float _l_8723;
local float _l_8724;
_l_8724 = self.health - time;
if ((_l_8724 > 37))
{
_l_8723 = random ();
if ((_l_8723 < 0.500000))
{
self.effects = 8;
}
else
{
self.effects = 0;
}
self.nextthink = ((time + 0.050000) + (random () * 0.100000));
}
else
{
if ((_l_8724 > 34))
{
_l_8723 = random ();
if ((_l_8723 < 0.500000))
{
self.effects = 4;
}
else
{
self.effects = 8;
}
self.nextthink = ((time + 0.050000) + (random () * 0.100000));
}
else
{
if ((_l_8724 > 15))
{
self.effects = 4;
self.nextthink = (time + 10);
}
else
{
if ((_l_8724 < 1))
{
self.owner.active_grenades_2 = (self.owner.active_grenades_2 - 1);
remove (self);
}
else
{
self.effects = 8;
self.nextthink = (time + _l_8724);
}
}
}
}
};
void() FlareGrenadeExplode =
{
self.skin = TF_FLARE_OFF;
self.health = time + 40;
self.nextthink = time + 0.05 + random() * 0.1;
sound(self, 3, "items/flare1.wav", TF_FLARE_OFF, TF_FLARE_OFF);
self.solid = TF_FLARE_LIT;
self.think = FlareGrenadeThink;
};
void () RemoveFlare =
{
self.owner.effects = (self.owner.effects - (self.owner.effects & 4));
self.owner.active_grenades_2 = (self.owner.active_grenades_2 - 1);
dremove (self);
};