-
Notifications
You must be signed in to change notification settings - Fork 2
/
medic.pqc
127 lines (112 loc) · 2.75 KB
/
medic.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Medic's self heal function
void () HealSelf =
{
local entity te;
local float healed;
// Only medic's can heal themselves
if (self.playerclass != 5)
return;
// Costs 1 type 2 gren
if (self.no_grenades_2 < 1)
{
sprint(self, 2, "Not enough type 2 grenades... get more\n");
return;
}
healed = 0;
// Leg shots
if ((self.leg_damage > 0))
{
sprint (self, 2, "Your leg wound has been healed!\n");
self.leg_damage = 0;
TeamFortress_SetSpeed (self);
healed = 1;
}
// Concs
te = find (world, classname, "timer");
while ((((te.owner != self) || (te.think != ConcussionGrenadeTimer)) && (te != world)))
{
te = find (te, classname, "timer");
}
if ((te != world))
{
stuffcmd (self, "v_idlescale 0\n");
sprint (self, 2, "you have been healed of your concussion\n");
dremove (te);
healed = 1;
}
// Gas
if ((self.tfstate & 16384))
{
te = find (world, classname, "timer");
while ((((te.owner != self) || (te.think != HallucinationTimer)) && (te != world)))
{
te = find (te, classname, "timer");
}
if ((te != world))
{
stuffcmd (self, "v_idlescale 0\n");
self.tfstate = (self.tfstate - (self.tfstate & 16384));
sprint (self, 2, "you have been healed of your hallucinations\n");
dremove (te);
healed = 1;
}
}
// Tranq
if ((self.tfstate & 32768))
{
te = find (world, classname, "timer");
while ((((te.owner != self) || (te.think != TranquiliserTimer)) && (te != world)))
{
te = find (te, classname, "timer");
}
if ((te != world))
{
self.tfstate = (self.tfstate - (self.tfstate & 32768));
TeamFortress_SetSpeed (self);
stuffcmd (self, "v_cshift 0 0 0 0\n");
sprint (self, 2, "you have been healed of your tranquilisation\n");
dremove (te);
healed = 1;
}
}
// Flash
if ((self.FlashTime > 0))
{
te = find (world, netname, "flashtimer");
while ((((te.owner != self) || (te.classname != "timer")) && (te != world)))
{
te = find (te, netname, "flashtimer");
}
if ((te != world))
{
stuffcmd (self, "v_cshift 0 0 0 0\n");
dremove (te);
}
self.FlashTime = 0;
healed = 1;
}
// Flames
if ((self.numflames > 0))
{
self.numflames = 0;
sprint (self, 2, "The flames have been doused!\n");
healed = 1;
}
if (healed == 0)
{
sprint(self, 2, "You have nothing to cure.\n");
}
else
{
self.no_grenades_2 = self.no_grenades_2 - 1;
WriteByte(4, 23);
WriteByte(4, 11);
WriteCoord(4, self.origin_x);
WriteCoord(4, self.origin_y);
WriteCoord(4, self.origin_z);
multicast(self.origin, TF_FLARE_OFF);
sound (self, 3, "items/r_item2.wav", 1, 1);
//sound (self, 1, "items/r_item1.wav", 1, 1);
//SpawnBlood (self.origin, 20);
}
}