forked from itslunaranyo/copper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
item_powerups.qc
273 lines (229 loc) · 7.77 KB
/
item_powerups.qc
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/*
===============================================================================
POWERUPS
===============================================================================
*/
/*
===============
powerup_envirosuit
===============
*/
void(entity h, float t) powerup_envirosuit =
{
sprint (h, "It's stuffy in this thing ...\n");
h.items |= IT_SUIT;
h.rad_time = 1;
h.radsuit_finished = time + t;
}
/*
===============
powerup_invulnerability
===============
*/
void(entity h, float t) powerup_invulnerability =
{
sprint (h, "An unholy ward surrounds you ...\n");
h.items |= IT_INVULNERABILITY;
h.invincible_time = 1;
h.invincible_finished = time + t;
}
/*
===============
powerup_invisibility
===============
*/
void(entity h, float t) powerup_invisibility =
{
sprint (h, "Others' eyes deceive them, but yours give you away ...\n");
h.items |= IT_INVISIBILITY;
//h.notrace = 1;
h.invisible_time = 1;
h.invisible_finished = time + t;
h.invisible_sound = time + 1.5;
}
/*
===============
powerup_super_damage
===============
*/
void(entity h, float t) powerup_super_damage =
{
sprint (h, "You begin to channel unstoppable power ...\n");
h.items |= IT_QUAD;
h.super_damage_finished = time + t;
h.super_time = 1;
}
/*
===============
powerup_touch
===============
*/
void() powerup_touch =
{
if ( !CheckValidTouch() ) return;
sound (other, CHAN_POWERUP, self.noise, 1, ATTN_NORM);
stuffcmd (other, "bf\n");
other.items = other.items | self.items;
if (self.classname == "item_artifact_envirosuit")
powerup_envirosuit(other, 30);
if (self.classname == "item_artifact_invulnerability")
powerup_invulnerability(other, 30);
if (self.classname == "item_artifact_invisibility")
powerup_invisibility(other, 30);
if (self.classname == "item_artifact_super_damage")
powerup_super_damage(other, 30);
ItemTouched();
}
/*
===============================================================================
PENTAGRAM
===============================================================================
*/
void() precache_invulnerability =
{
precache_model_safe ("progs/invul.mdl");
precache_sound_safe ("items/protect.wav");
precache_sound_safe ("items/protect2.wav");
precache_sound_safe ("items/protect3.wav");
}
/*QUAKED item_artifact_invulnerability (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED
Pentagram of Protection. Player is invulnerable for 30 seconds (both health and armor).
Keys:
"target/2/3/4/k" - entity to trigger when picked up
"targetname" - will not spawn until triggered
"wait" - will respawn after 'wait' seconds. fires targets every time.
"count" - limit number of times to respawn
*/
/*FGD
@PointClass size(-16 -16 -24, 16 16 32) color(255 0 0) base(Item) model({ "path": ":progs/invul.mdl" }) =
item_artifact_invulnerability : "Pentagram of Protection. Player is invulnerable for 30 seconds (both health and armor)." []
*/
void() item_artifact_invulnerability =
{
if (!SUB_ShouldSpawn()) return;
self.touch = powerup_touch;
precache_invulnerability();
self.noise = "items/protect.wav";
setmodel (self, "progs/invul.mdl");
self.netname = "Pentagram of Protection";
self.items = IT_INVULNERABILITY;
setsize (self, '-16 -16 -24', '16 16 32');
if (deathmatch)
self.wait = 300;
StartItem ();
}
/*
===============================================================================
BIOSUIT
===============================================================================
*/
void() precache_envirosuit =
{
precache_model_safe ("progs/suit.mdl");
precache_sound_safe ("items/suit.wav");
precache_sound_safe ("items/suit2.wav");
}
/*QUAKED item_artifact_envirosuit (0 .5 .5) (-16 -16 -8) (16 16 48) ? ? SUSPENDED
Envirosuit. Player takes no damage from water or slime for 30 seconds. Lava damage is reduced by one height step, enabling wading in foot-deep lava.
Keys:
"target/2/3/4/k" - entity to trigger when picked up
"targetname" - will not spawn until triggered
"wait" - will respawn after 'wait' seconds. fires targets every time.
"count" - limit number of times to respawn
*/
/*FGD
@PointClass size(-16 -16 -24, 16 16 32) color(255 0 0) base(Item) model({ "path": ":progs/suit.mdl" }) =
item_artifact_envirosuit : "Envirosuit. Player takes no damage from water or slime for 30 seconds. Lava damage is reduced by one height step, enabling wading in foot-deep lava." []
*/
void() item_artifact_envirosuit =
{
if (!SUB_ShouldSpawn()) return;
self.touch = powerup_touch;
precache_envirosuit();
self.noise = "items/suit.wav";
setmodel (self, "progs/suit.mdl");
self.netname = "Biosuit";
self.items = IT_SUIT;
setsize (self, '-16 -16 -8', '16 16 48');
if (deathmatch)
self.wait = 60;
StartItem ();
}
/*
===============================================================================
RING OF SHADOWS
===============================================================================
*/
void() precache_invisibility =
{
precache_model_safe ("progs/invis.mdl");
precache_sound_safe ("items/inv1.wav");
precache_sound_safe ("items/inv2.wav");
precache_sound_safe ("items/inv3.wav");
}
/*QUAKED item_artifact_invisibility (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED
Ring of Shadows. Player is invisible for 30 seconds. Monsters will not awaken on sight, but they will on hearing sound (like gunfire). Awakened monsters will try to attack an invisible player and do an inaccurate job, possibly starting infights.
monster_dog can still smell an invisible player, but monster_tarbaby can't find the player at all.
Keys:
"target/2/3/4/k" - entity to trigger when picked up
"targetname" - will not spawn until triggered
"wait" - will respawn after 'wait' seconds. fires targets every time.
"count" - limit number of times to respawn
*/
/*FGD
@PointClass size(-16 -16 -24, 16 16 32) color(255 0 0) base(Item) model({ "path": ":progs/invis.mdl" }) =
item_artifact_invisibility : "Ring of Shadows. Player is invisible for 30 seconds. Monsters will not awaken on sight, but they will on hearing sound (like gunfire). Awakened monsters will try to attack an invisible player and do an inaccurate job, possibly starting infights.
monster_dog can still smell an invisible player, but monster_tarbaby can't find the player at all." []
*/
void() item_artifact_invisibility =
{
if (!SUB_ShouldSpawn()) return;
self.touch = powerup_touch;
precache_invisibility();
self.noise = "items/inv1.wav";
setmodel (self, "progs/invis.mdl");
self.netname = "Ring of Shadows";
self.items = IT_INVISIBILITY;
setsize (self, '-16 -16 -24', '16 16 32');
if (deathmatch)
self.wait = 300;
StartItem ();
}
/*
===============================================================================
QUAD
===============================================================================
*/
void() precache_super_damage =
{
precache_model_safe ("progs/quaddama.mdl");
precache_sound_safe ("items/damage.wav");
precache_sound_safe ("items/damage2.wav");
precache_sound_safe ("items/damage3.wav");
}
/*QUAKED item_artifact_super_damage (0 .5 .5) (-16 -16 -24) (16 16 32) ? ? SUSPENDED
Quad Damage. Player's attacks do 4x damage and they stop paying attention to anything else.
Keys:
"target/2/3/4/k" - entity to trigger when picked up
"targetname" - will not spawn until triggered
"wait" - will respawn after 'wait' seconds. fires targets every time.
"count" - limit number of times to respawn
*/
/*FGD
@PointClass size(-16 -16 -24, 16 16 32) color(255 0 0) base(Item) model({ "path": ":progs/quaddama.mdl" }) = item_artifact_super_damage :
"Quad Damage. Player's attacks do 4x damage and they stop paying attention to anything else." []
*/
void() item_artifact_super_damage =
{
if (!SUB_ShouldSpawn()) return;
self.touch = powerup_touch;
precache_super_damage();
setmodel (self, "progs/quaddama.mdl");
self.netname = "Quad Damage";
self.noise = "items/damage.wav";
self.items = IT_QUAD;
setsize (self, '-16 -16 -24', '16 16 32');
if (deathmatch)
self.wait = 60;
StartItem ();
}