]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/mutator/mutator_nades.qc
Entity debugger
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / mutator_nades.qc
1 #ifndef MUTATOR_NADES_H
2 #define MUTATOR_NADES_H
3
4 .entity nade;
5 .entity fake_nade;
6 .float nade_timer;
7 .float nade_refire;
8 .float bonus_nades;
9 .float nade_special_time;
10 .float bonus_nade_score;
11 .float nade_type;
12 .string pokenade_type;
13 .entity nade_damage_target;
14 .float cvar_cl_nade_type;
15 .string cvar_cl_pokenade_type;
16 .float toss_time;
17 .float stat_healing_orb;
18 .float stat_healing_orb_alpha;
19 .float nade_show_particles;
20
21 // Remove nades that are being thrown
22 void(entity player) nades_Clear;
23
24 // Give a bonus grenade to a player
25 void(entity player, float score) nades_GiveBonus;
26 // Remove all bonus nades from a player
27 void(entity player) nades_RemoveBonus;
28
29 #endif
30 #ifdef IMPLEMENTATION
31
32 #include "../../../common/nades/all.qh"
33 #include "../../../common/gamemodes/all.qh"
34 #include "../../../common/monsters/spawn.qh"
35 #include "../../../common/monsters/sv_monsters.qh"
36 #include "../../g_subs.qh"
37
38 REGISTER_MUTATOR(nades, cvar("g_nades"))
39 {
40         MUTATOR_ONADD
41         {
42                 addstat(STAT_NADE_TIMER, AS_FLOAT, nade_timer);
43                 addstat(STAT_NADE_BONUS, AS_FLOAT, bonus_nades);
44                 addstat(STAT_NADE_BONUS_TYPE, AS_INT, nade_type);
45                 addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
46                 addstat(STAT_HEALING_ORB, AS_FLOAT, stat_healing_orb);
47                 addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
48         }
49
50         return false;
51 }
52
53 .float nade_time_primed;
54
55 .entity nade_spawnloc;
56
57 void nade_timer_think()
58 {SELFPARAM();
59         self.skin = 8 - (self.owner.wait - time) / (autocvar_g_nades_nade_lifetime / 10);
60         self.nextthink = time;
61         if(!self.owner || wasfreed(self.owner))
62                 remove(self);
63 }
64
65 void nade_burn_spawn(entity _nade)
66 {
67         CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[true], true);
68 }
69
70 void nade_spawn(entity _nade)
71 {
72         entity timer = new(nade_timer);
73         setmodel(timer, MDL_NADE_TIMER);
74         setattachment(timer, _nade, "");
75         timer.colormap = _nade.colormap;
76         timer.glowmod = _nade.glowmod;
77         timer.think = nade_timer_think;
78         timer.nextthink = time;
79         timer.wait = _nade.wait;
80         timer.owner = _nade;
81         timer.skin = 10;
82
83         _nade.effects |= EF_LOWPRECISION;
84
85         CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[false], true);
86 }
87
88 void napalm_damage(float dist, float damage, float edgedamage, float burntime)
89 {SELFPARAM();
90         entity e;
91         float d;
92         vector p;
93
94         if ( damage < 0 )
95                 return;
96
97         RandomSelection_Init();
98         for(e = WarpZone_FindRadius(self.origin, dist, true); e; e = e.chain)
99                 if(e.takedamage == DAMAGE_AIM)
100                 if(self.realowner != e || autocvar_g_nades_napalm_selfdamage)
101                 if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
102                 if(!e.frozen)
103                 {
104                         p = e.origin;
105                         p.x += e.mins.x + random() * (e.maxs.x - e.mins.x);
106                         p.y += e.mins.y + random() * (e.maxs.y - e.mins.y);
107                         p.z += e.mins.z + random() * (e.maxs.z - e.mins.z);
108                         d = vlen(WarpZone_UnTransformOrigin(e, self.origin) - p);
109                         if(d < dist)
110                         {
111                                 e.fireball_impactvec = p;
112                                 RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e));
113                         }
114                 }
115         if(RandomSelection_chosen_ent)
116         {
117                 d = vlen(WarpZone_UnTransformOrigin(RandomSelection_chosen_ent, self.origin) - RandomSelection_chosen_ent.fireball_impactvec);
118                 d = damage + (edgedamage - damage) * (d / dist);
119                 Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE);
120                 //trailparticles(self, particleeffectnum(EFFECT_FIREBALL_LASER), self.origin, RandomSelection_chosen_ent.fireball_impactvec);
121                 Send_Effect(EFFECT_FIREBALL_LASER, self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
122         }
123 }
124
125
126 void napalm_ball_think()
127 {SELFPARAM();
128         if(round_handler_IsActive())
129         if(!round_handler_IsRoundStarted())
130         {
131                 remove(self);
132                 return;
133         }
134
135         if(time > self.pushltime)
136         {
137                 remove(self);
138                 return;
139         }
140
141         vector midpoint = ((self.absmin + self.absmax) * 0.5);
142         if(pointcontents(midpoint) == CONTENT_WATER)
143         {
144                 self.velocity = self.velocity * 0.5;
145
146                 if(pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
147                         { self.velocity_z = 200; }
148         }
149
150         self.angles = vectoangles(self.velocity);
151
152         napalm_damage(autocvar_g_nades_napalm_ball_radius,autocvar_g_nades_napalm_ball_damage,
153                                   autocvar_g_nades_napalm_ball_damage,autocvar_g_nades_napalm_burntime);
154
155         self.nextthink = time + 0.1;
156 }
157
158
159 void nade_napalm_ball()
160 {SELFPARAM();
161         entity proj;
162         vector kick;
163
164         spamsound(self, CH_SHOTS, SND(FIREBALL_FIRE), VOL_BASE, ATTEN_NORM);
165
166         proj = new(grenade);
167         proj.owner = self.owner;
168         proj.realowner = self.realowner;
169         proj.team = self.owner.team;
170         proj.bot_dodge = true;
171         proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
172         proj.movetype = MOVETYPE_BOUNCE;
173         proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
174         PROJECTILE_MAKETRIGGER(proj);
175         setmodel(proj, MDL_Null);
176         proj.scale = 1;//0.5;
177         setsize(proj, '-4 -4 -4', '4 4 4');
178         setorigin(proj, self.origin);
179         proj.think = napalm_ball_think;
180         proj.nextthink = time;
181         proj.damageforcescale = autocvar_g_nades_napalm_ball_damageforcescale;
182         proj.effects = EF_LOWPRECISION | EF_FLAME;
183
184         kick.x =(random() - 0.5) * 2 * autocvar_g_nades_napalm_ball_spread;
185         kick.y = (random() - 0.5) * 2 * autocvar_g_nades_napalm_ball_spread;
186         kick.z = (random()/2+0.5) * autocvar_g_nades_napalm_ball_spread;
187         proj.velocity = kick;
188
189         proj.pushltime = time + autocvar_g_nades_napalm_ball_lifetime;
190
191         proj.angles = vectoangles(proj.velocity);
192         proj.flags = FL_PROJECTILE;
193         proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
194
195         //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
196 }
197
198
199 void napalm_fountain_think()
200 {SELFPARAM();
201
202         if(round_handler_IsActive())
203         if(!round_handler_IsRoundStarted())
204         {
205                 remove(self);
206                 return;
207         }
208
209         if(time >= self.ltime)
210         {
211                 remove(self);
212                 return;
213         }
214
215         vector midpoint = ((self.absmin + self.absmax) * 0.5);
216         if(pointcontents(midpoint) == CONTENT_WATER)
217         {
218                 self.velocity = self.velocity * 0.5;
219
220                 if(pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
221                         { self.velocity_z = 200; }
222
223                 UpdateCSQCProjectile(self);
224         }
225
226         napalm_damage(autocvar_g_nades_napalm_fountain_radius, autocvar_g_nades_napalm_fountain_damage,
227                 autocvar_g_nades_napalm_fountain_edgedamage, autocvar_g_nades_napalm_burntime);
228
229         self.nextthink = time + 0.1;
230         if(time >= self.nade_special_time)
231         {
232                 self.nade_special_time = time + autocvar_g_nades_napalm_fountain_delay;
233                 nade_napalm_ball();
234         }
235 }
236
237 void nade_napalm_boom()
238 {SELFPARAM();
239         entity fountain;
240         int c;
241         for (c = 0; c < autocvar_g_nades_napalm_ball_count; c++)
242                 nade_napalm_ball();
243
244
245         fountain = spawn();
246         fountain.owner = self.owner;
247         fountain.realowner = self.realowner;
248         fountain.origin = self.origin;
249         setorigin(fountain, fountain.origin);
250         fountain.think = napalm_fountain_think;
251         fountain.nextthink = time;
252         fountain.ltime = time + autocvar_g_nades_napalm_fountain_lifetime;
253         fountain.pushltime = fountain.ltime;
254         fountain.team = self.team;
255         fountain.movetype = MOVETYPE_TOSS;
256         fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
257         fountain.bot_dodge = true;
258         fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
259         fountain.nade_special_time = time;
260         setsize(fountain, '-16 -16 -16', '16 16 16');
261         CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true);
262 }
263
264 void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time)
265 {
266         frost_target.frozen_by = freezefield.realowner;
267         Send_Effect(EFFECT_ELECTRO_IMPACT, frost_target.origin, '0 0 0', 1);
268         Freeze(frost_target, 1/freeze_time, 3, false);
269
270         Drop_Special_Items(frost_target);
271 }
272
273 void nade_ice_think()
274 {SELFPARAM();
275
276         if(round_handler_IsActive())
277         if(!round_handler_IsRoundStarted())
278         {
279                 remove(self);
280                 return;
281         }
282
283         if(time >= self.ltime)
284         {
285                 if ( autocvar_g_nades_ice_explode )
286                 {
287                         entity expef = EFFECT_NADE_EXPLODE(self.realowner.team);
288                         Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
289                         sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
290
291                         RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
292                                 autocvar_g_nades_nade_radius, self, world, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy);
293                         Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
294                                 autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
295                 }
296                 remove(self);
297                 return;
298         }
299
300
301         self.nextthink = time+0.1;
302
303         // gaussian
304         float randomr;
305         randomr = random();
306         randomr = exp(-5*randomr*randomr)*autocvar_g_nades_nade_radius;
307         float randomw;
308         randomw = random()*M_PI*2;
309         vector randomp;
310         randomp.x = randomr*cos(randomw);
311         randomp.y = randomr*sin(randomw);
312         randomp.z = 1;
313         Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, self.origin + randomp, '0 0 0', 1);
314
315         if(time >= self.nade_special_time)
316         {
317                 self.nade_special_time = time+0.7;
318
319                 Send_Effect(EFFECT_ELECTRO_IMPACT, self.origin, '0 0 0', 1);
320                 Send_Effect(EFFECT_ICEFIELD, self.origin, '0 0 0', 1);
321         }
322
323
324         float current_freeze_time = self.ltime - time - 0.1;
325
326         entity e;
327         for(e = findradius(self.origin, autocvar_g_nades_nade_radius); e; e = e.chain)
328         if(e != self)
329         if(!autocvar_g_nades_ice_teamcheck || (DIFF_TEAM(e, self.realowner) || e == self.realowner))
330         if(e.takedamage && e.deadflag == DEAD_NO)
331         if(e.health > 0)
332         if(!e.revival_time || ((time - e.revival_time) >= 1.5))
333         if(!e.frozen)
334         if(current_freeze_time > 0)
335                 nade_ice_freeze(self, e, current_freeze_time);
336 }
337
338 void nade_ice_boom()
339 {SELFPARAM();
340         entity fountain;
341         fountain = spawn();
342         fountain.owner = self.owner;
343         fountain.realowner = self.realowner;
344         fountain.origin = self.origin;
345         setorigin(fountain, fountain.origin);
346         fountain.think = nade_ice_think;
347         fountain.nextthink = time;
348         fountain.ltime = time + autocvar_g_nades_ice_freeze_time;
349         fountain.pushltime = fountain.wait = fountain.ltime;
350         fountain.team = self.team;
351         fountain.movetype = MOVETYPE_TOSS;
352         fountain.projectiledeathtype = DEATH_NADE_ICE.m_id;
353         fountain.bot_dodge = false;
354         setsize(fountain, '-16 -16 -16', '16 16 16');
355         fountain.nade_special_time = time+0.3;
356         fountain.angles = self.angles;
357
358         if ( autocvar_g_nades_ice_explode )
359         {
360                 setmodel(fountain, MDL_PROJECTILE_GRENADE);
361                 entity timer = new(nade_timer);
362                 setmodel(timer, MDL_NADE_TIMER);
363                 setattachment(timer, fountain, "");
364                 timer.colormap = self.colormap;
365                 timer.glowmod = self.glowmod;
366                 timer.think = nade_timer_think;
367                 timer.nextthink = time;
368                 timer.wait = fountain.ltime;
369                 timer.owner = fountain;
370                 timer.skin = 10;
371         }
372         else
373                 setmodel(fountain, MDL_Null);
374 }
375
376 void nade_translocate_boom()
377 {SELFPARAM();
378         if(self.realowner.vehicle)
379                 return;
380
381         vector locout = self.origin + '0 0 1' * (1 - self.realowner.mins.z - 24);
382         tracebox(locout, self.realowner.mins, self.realowner.maxs, locout, MOVE_NOMONSTERS, self.realowner);
383         locout = trace_endpos;
384
385         makevectors(self.realowner.angles);
386
387         MUTATOR_CALLHOOK(PortalTeleport, self.realowner);
388
389         TeleportPlayer(self, self.realowner, locout, self.realowner.angles, v_forward * vlen(self.realowner.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
390 }
391
392 void nade_spawn_boom()
393 {SELFPARAM();
394         entity spawnloc = spawn();
395         setorigin(spawnloc, self.origin);
396         setsize(spawnloc, self.realowner.mins, self.realowner.maxs);
397         spawnloc.movetype = MOVETYPE_NONE;
398         spawnloc.solid = SOLID_NOT;
399         spawnloc.drawonlytoclient = self.realowner;
400         spawnloc.effects = EF_STARDUST;
401         spawnloc.cnt = autocvar_g_nades_spawn_count;
402
403         if(self.realowner.nade_spawnloc)
404         {
405                 remove(self.realowner.nade_spawnloc);
406                 self.realowner.nade_spawnloc = world;
407         }
408
409         self.realowner.nade_spawnloc = spawnloc;
410 }
411
412 void nade_heal_think()
413 {SELFPARAM();
414         if(time >= self.ltime)
415         {
416                 remove(self);
417                 return;
418         }
419
420         self.nextthink = time;
421
422         if(time >= self.nade_special_time)
423         {
424                 self.nade_special_time = time+0.25;
425                 self.nade_show_particles = 1;
426         }
427         else
428                 self.nade_show_particles = 0;
429 }
430
431 void nade_heal_touch()
432 {SELFPARAM();
433         float maxhealth;
434         float health_factor;
435         if(IS_PLAYER(other) || IS_MONSTER(other))
436         if(other.deadflag == DEAD_NO)
437         if(!other.frozen)
438         {
439                 health_factor = autocvar_g_nades_heal_rate*frametime/2;
440                 if ( other != self.realowner )
441                 {
442                         if ( SAME_TEAM(other,self) )
443                                 health_factor *= autocvar_g_nades_heal_friend;
444                         else
445                                 health_factor *= autocvar_g_nades_heal_foe;
446                 }
447                 if ( health_factor > 0 )
448                 {
449                         maxhealth = (IS_MONSTER(other)) ? other.max_health : g_pickup_healthmega_max;
450                         if ( other.health < maxhealth )
451                         {
452                                 if ( self.nade_show_particles )
453                                         Send_Effect(EFFECT_HEALING, other.origin, '0 0 0', 1);
454                                 other.health = min(other.health+health_factor, maxhealth);
455                         }
456                         other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
457                 }
458                 else if ( health_factor < 0 )
459                 {
460                         Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL.m_id,other.origin,'0 0 0');
461                 }
462
463         }
464
465         if ( IS_REAL_CLIENT(other) || IS_VEHICLE(other) )
466         {
467                 entity show_red = (IS_VEHICLE(other)) ? other.owner : other;
468                 show_red.stat_healing_orb = time+0.1;
469                 show_red.stat_healing_orb_alpha = 0.75 * (self.ltime - time) / self.healer_lifetime;
470         }
471 }
472
473 void nade_heal_boom()
474 {SELFPARAM();
475         entity healer;
476         healer = spawn();
477         healer.owner = self.owner;
478         healer.realowner = self.realowner;
479         setorigin(healer, self.origin);
480         healer.healer_lifetime = autocvar_g_nades_heal_time; // save the cvar
481         healer.ltime = time + healer.healer_lifetime;
482         healer.team = self.realowner.team;
483         healer.bot_dodge = false;
484         healer.solid = SOLID_TRIGGER;
485         healer.touch = nade_heal_touch;
486
487         setmodel(healer, MDL_NADE_HEAL);
488         healer.healer_radius = autocvar_g_nades_nade_radius;
489         vector size = '1 1 1' * healer.healer_radius / 2;
490         setsize(healer,-size,size);
491
492         Net_LinkEntity(healer, true, 0, healer_send);
493
494         healer.think = nade_heal_think;
495         healer.nextthink = time;
496         healer.SendFlags |= 1;
497 }
498
499 void nade_monster_boom()
500 {SELFPARAM();
501         entity e = spawnmonster(self.pokenade_type, 0, self.realowner, self.realowner, self.origin, false, false, 1);
502
503         if(autocvar_g_nades_pokenade_monster_lifetime > 0)
504                 e.monster_lifetime = time + autocvar_g_nades_pokenade_monster_lifetime;
505         e.monster_skill = MONSTER_SKILL_INSANE;
506 }
507
508 void nade_boom()
509 {SELFPARAM();
510         entity expef = NULL;
511         bool nade_blast = true;
512
513         switch ( Nades[self.nade_type] )
514         {
515                 case NADE_TYPE_NAPALM:
516                         nade_blast = autocvar_g_nades_napalm_blast;
517                         expef = EFFECT_EXPLOSION_MEDIUM;
518                         break;
519                 case NADE_TYPE_ICE:
520                         nade_blast = false;
521                         expef = EFFECT_ELECTRO_COMBO; // hookbomb_explode electro_combo bigplasma_impact
522                         break;
523                 case NADE_TYPE_TRANSLOCATE:
524                         nade_blast = false;
525                         break;
526                 case NADE_TYPE_MONSTER:
527                 case NADE_TYPE_SPAWN:
528                         nade_blast = false;
529                         switch(self.realowner.team)
530                         {
531                                 case NUM_TEAM_1: expef = EFFECT_SPAWN_RED; break;
532                                 case NUM_TEAM_2: expef = EFFECT_SPAWN_BLUE; break;
533                                 case NUM_TEAM_3: expef = EFFECT_SPAWN_YELLOW; break;
534                                 case NUM_TEAM_4: expef = EFFECT_SPAWN_PINK; break;
535                                 default: expef = EFFECT_SPAWN_NEUTRAL; break;
536                         }
537                         break;
538                 case NADE_TYPE_HEAL:
539                         nade_blast = false;
540                         expef = EFFECT_SPAWN_RED;
541                         break;
542
543                 default:
544                 case NADE_TYPE_NORMAL:
545                         expef = EFFECT_NADE_EXPLODE(self.realowner.team);
546                         break;
547         }
548
549         if(expef)
550                 Send_Effect(expef, findbetterlocation(self.origin, 8), '0 0 0', 1);
551
552         sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
553         sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
554
555         self.event_damage = func_null; // prevent somehow calling damage in the next call
556
557         if(nade_blast)
558         {
559                 RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
560                                  autocvar_g_nades_nade_radius, self, world, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy);
561                 Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self);
562         }
563
564         if(self.takedamage)
565         switch ( Nades[self.nade_type] )
566         {
567                 case NADE_TYPE_NAPALM: nade_napalm_boom(); break;
568                 case NADE_TYPE_ICE: nade_ice_boom(); break;
569                 case NADE_TYPE_TRANSLOCATE: nade_translocate_boom(); break;
570                 case NADE_TYPE_SPAWN: nade_spawn_boom(); break;
571                 case NADE_TYPE_HEAL: nade_heal_boom(); break;
572                 case NADE_TYPE_MONSTER: nade_monster_boom(); break;
573         }
574
575         entity head;
576         for(head = world; (head = find(head, classname, "grapplinghook")); )
577         if(head.aiment == self)
578                 RemoveGrapplingHook(head.realowner);
579
580         remove(self);
581 }
582
583 void nade_touch()
584 {SELFPARAM();
585         /*float is_weapclip = 0;
586         if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
587         if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
588         if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
589                 is_weapclip = 1;*/
590         if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip)
591         {
592                 entity head;
593                 for(head = world; (head = find(head, classname, "grapplinghook")); )
594                 if(head.aiment == self)
595                         RemoveGrapplingHook(head.realowner);
596                 remove(self);
597                 return;
598         }
599
600         PROJECTILE_TOUCH;
601
602         //setsize(self, '-2 -2 -2', '2 2 2');
603         //UpdateCSQCProjectile(self);
604         if(self.health == self.max_health)
605         {
606                 spamsound(self, CH_SHOTS, SND(GRENADE_BOUNCE_RANDOM()), VOL_BASE, ATTEN_NORM);
607                 return;
608         }
609
610         self.enemy = other;
611         nade_boom();
612 }
613
614 void nade_beep()
615 {SELFPARAM();
616         sound(self, CH_SHOTS_SINGLE, SND_NADE_BEEP, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
617         self.think = nade_boom;
618         self.nextthink = max(self.wait, time);
619 }
620
621 void nade_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
622 {SELFPARAM();
623         if(ITEM_DAMAGE_NEEDKILL(deathtype))
624         {
625                 self.takedamage = DAMAGE_NO;
626                 nade_boom();
627                 return;
628         }
629
630         if(self.nade_type == NADE_TYPE_TRANSLOCATE.m_id || self.nade_type == NADE_TYPE_SPAWN.m_id)
631                 return;
632
633         if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
634         {
635                 force *= 1.5;
636                 damage = 0;
637         }
638
639         if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER) && (deathtype & HITTYPE_SECONDARY))
640         {
641                 force *= 0.5; // too much
642                 frag_damage = 0;
643         }
644
645         if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
646         {
647                 force *= 6;
648                 damage = self.max_health * 0.55;
649         }
650
651         if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN) || DEATH_ISWEAPON(deathtype, WEP_HMG))
652                 damage = self.max_health * 0.1;
653
654         if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO
655         if(deathtype & HITTYPE_SECONDARY)
656         {
657                 damage = self.max_health * 0.1;
658                 force *= 10;
659         }
660         else
661                 damage = self.max_health * 1.15;
662
663         self.velocity += force;
664         UpdateCSQCProjectile(self);
665
666         if(damage <= 0 || ((self.flags & FL_ONGROUND) && IS_PLAYER(attacker)))
667                 return;
668
669         if(self.health == self.max_health)
670         {
671                 sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, 0.5 *(ATTEN_LARGE + ATTEN_MAX));
672                 self.nextthink = max(time + autocvar_g_nades_nade_lifetime, time);
673                 self.think = nade_beep;
674         }
675
676         self.health -= damage;
677
678         if ( self.nade_type != NADE_TYPE_HEAL.m_id || IS_PLAYER(attacker) )
679                 self.realowner = attacker;
680
681         if(self.health <= 0)
682                 W_PrepareExplosionByDamage(attacker, nade_boom);
683         else
684                 nade_burn_spawn(self);
685 }
686
687 void toss_nade(entity e, vector _velocity, float _time)
688 {SELFPARAM();
689         if(e.nade == world)
690                 return;
691
692         entity _nade = e.nade;
693         e.nade = world;
694
695         remove(e.fake_nade);
696         e.fake_nade = world;
697
698         makevectors(e.v_angle);
699
700         W_SetupShot(e, false, false, "", CH_WEAPON_A, 0);
701
702         Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER_CPID, CPID_NADES);
703
704         vector offset = (v_forward * autocvar_g_nades_throw_offset.x)
705                                   + (v_right * autocvar_g_nades_throw_offset.y)
706                                   + (v_up * autocvar_g_nades_throw_offset.z);
707         if(autocvar_g_nades_throw_offset == '0 0 0')
708                 offset = '0 0 0';
709
710         setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
711         //setmodel(_nade, MDL_PROJECTILE_NADE);
712         //setattachment(_nade, world, "");
713         PROJECTILE_MAKETRIGGER(_nade);
714         setsize(_nade, '-16 -16 -16', '16 16 16');
715         _nade.movetype = MOVETYPE_BOUNCE;
716
717         tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);
718         if (trace_startsolid)
719                 setorigin(_nade, e.origin);
720
721         if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && self.BUTTON_CROUCH)
722                 _nade.velocity = '0 0 100';
723         else if(autocvar_g_nades_nade_newton_style == 1)
724                 _nade.velocity = e.velocity + _velocity;
725         else if(autocvar_g_nades_nade_newton_style == 2)
726                 _nade.velocity = _velocity;
727         else
728                 _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, true);
729
730         _nade.touch = nade_touch;
731         _nade.health = autocvar_g_nades_nade_health;
732         _nade.max_health = _nade.health;
733         _nade.takedamage = DAMAGE_AIM;
734         _nade.event_damage = nade_damage;
735         _nade.customizeentityforclient = func_null;
736         _nade.exteriormodeltoclient = world;
737         _nade.traileffectnum = 0;
738         _nade.teleportable = true;
739         _nade.pushable = true;
740         _nade.gravity = 1;
741         _nade.missile_flags = MIF_SPLASH | MIF_ARC;
742         _nade.damagedbycontents = true;
743         _nade.angles = vectoangles(_nade.velocity);
744         _nade.flags = FL_PROJECTILE;
745         _nade.projectiledeathtype = DEATH_NADE.m_id;
746         _nade.toss_time = time;
747         _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
748
749         if(_nade.nade_type == NADE_TYPE_TRANSLOCATE.m_id || _nade.nade_type == NADE_TYPE_SPAWN.m_id)
750                 _nade.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
751         else
752                 _nade.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
753
754         nade_spawn(_nade);
755
756         if(_time)
757         {
758                 _nade.think = nade_boom;
759                 _nade.nextthink = _time;
760         }
761
762         e.nade_refire = time + autocvar_g_nades_nade_refire;
763         e.nade_timer = 0;
764 }
765
766 void nades_GiveBonus(entity player, float score)
767 {
768         if (autocvar_g_nades)
769         if (autocvar_g_nades_bonus)
770         if (IS_REAL_CLIENT(player))
771         if (IS_PLAYER(player) && player.bonus_nades < autocvar_g_nades_bonus_max)
772         if (player.frozen == 0)
773         if (player.deadflag == DEAD_NO)
774         {
775                 if ( player.bonus_nade_score < 1 )
776                         player.bonus_nade_score += score/autocvar_g_nades_bonus_score_max;
777
778                 if ( player.bonus_nade_score >= 1 )
779                 {
780                         Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_NADE_BONUS);
781                         play2(player, SND(KH_ALARM));
782                         player.bonus_nades++;
783                         player.bonus_nade_score -= 1;
784                 }
785         }
786 }
787
788 void nades_RemoveBonus(entity player)
789 {
790         player.bonus_nades = player.bonus_nade_score = 0;
791 }
792
793 float nade_customize()
794 {SELFPARAM();
795         //if(IS_SPEC(other)) { return false; }
796         if(other == self.realowner || (IS_SPEC(other) && other.enemy == self.realowner))
797         {
798                 // somewhat hide the model, but keep the glow
799                 //self.effects = 0;
800                 if(self.traileffectnum)
801                         self.traileffectnum = 0;
802                 self.alpha = -1;
803         }
804         else
805         {
806                 //self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
807                 if(!self.traileffectnum)
808                         self.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[self.nade_type].m_projectile[false], self.team).eent_eff_name);
809                 self.alpha = 1;
810         }
811
812         return true;
813 }
814
815 void nade_prime()
816 {SELFPARAM();
817         if(autocvar_g_nades_bonus_only)
818         if(!self.bonus_nades)
819                 return; // only allow bonus nades
820
821         if(self.nade)
822                 remove(self.nade);
823
824         if(self.fake_nade)
825                 remove(self.fake_nade);
826
827         entity n = new(nade), fn = new(fake_nade);
828
829         if(self.items & ITEM_Strength.m_itemid && autocvar_g_nades_bonus_onstrength)
830                 n.nade_type = self.nade_type;
831         else if (self.bonus_nades >= 1)
832         {
833                 n.nade_type = self.nade_type;
834                 n.pokenade_type = self.pokenade_type;
835                 self.bonus_nades -= 1;
836         }
837         else
838         {
839                 n.nade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_nade_type : autocvar_g_nades_nade_type);
840                 n.pokenade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
841         }
842
843         n.nade_type = bound(1, n.nade_type, Nades_COUNT);
844
845         setmodel(n, MDL_PROJECTILE_NADE);
846         //setattachment(n, self, "bip01 l hand");
847         n.exteriormodeltoclient = self;
848         n.customizeentityforclient = nade_customize;
849         n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[n.nade_type].m_projectile[false], self.team).eent_eff_name);
850         n.colormod = Nades[n.nade_type].m_color;
851         n.realowner = self;
852         n.colormap = self.colormap;
853         n.glowmod = self.glowmod;
854         n.wait = time + autocvar_g_nades_nade_lifetime;
855         n.nade_time_primed = time;
856         n.think = nade_beep;
857         n.nextthink = max(n.wait - 3, time);
858         n.projectiledeathtype = DEATH_NADE.m_id;
859
860         setmodel(fn, MDL_NADE_VIEW);
861         int slot = 0; // TODO: unhardcode
862         setattachment(fn, self.weaponentity[slot], "");
863         fn.realowner = fn.owner = self;
864         fn.colormod = Nades[n.nade_type].m_color;
865         fn.colormap = self.colormap;
866         fn.glowmod = self.glowmod;
867         fn.think = SUB_Remove;
868         fn.nextthink = n.wait;
869
870         self.nade = n;
871         self.fake_nade = fn;
872 }
873
874 float CanThrowNade()
875 {SELFPARAM();
876         if(self.vehicle)
877                 return false;
878
879         if(gameover)
880                 return false;
881
882         if(self.deadflag != DEAD_NO)
883                 return false;
884
885         if (!autocvar_g_nades)
886                 return false; // allow turning them off mid match
887
888         if(forbidWeaponUse(self))
889                 return false;
890
891         if (!IS_PLAYER(self))
892                 return false;
893
894         return true;
895 }
896
897 .bool nade_altbutton;
898
899 void nades_CheckThrow()
900 {SELFPARAM();
901         if(!CanThrowNade())
902                 return;
903
904         entity held_nade = self.nade;
905         if (!held_nade)
906         {
907                 self.nade_altbutton = true;
908                 if(time > self.nade_refire)
909                 {
910                         Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_NADE_THROW);
911                         nade_prime();
912                         self.nade_refire = time + autocvar_g_nades_nade_refire;
913                 }
914         }
915         else
916         {
917                 self.nade_altbutton = false;
918                 if (time >= held_nade.nade_time_primed + 1) {
919                         makevectors(self.v_angle);
920                         float _force = time - held_nade.nade_time_primed;
921                         _force /= autocvar_g_nades_nade_lifetime;
922                         _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
923                         toss_nade(self, (v_forward * 0.75 + v_up * 0.2 + v_right * 0.05) * _force, 0);
924                 }
925         }
926 }
927
928 void nades_Clear(entity player)
929 {
930         if(player.nade)
931                 remove(player.nade);
932         if(player.fake_nade)
933                 remove(player.fake_nade);
934
935         player.nade = player.fake_nade = world;
936         player.nade_timer = 0;
937 }
938
939 MUTATOR_HOOKFUNCTION(nades, VehicleEnter)
940 {
941         if(vh_player.nade)
942                 toss_nade(vh_player, '0 0 100', max(vh_player.nade.wait, time + 0.05));
943
944         return false;
945 }
946
947 CLASS(NadeOffhand, OffhandWeapon)
948     METHOD(NadeOffhand, offhand_think, void(NadeOffhand this, entity player, bool key_pressed))
949     {
950         entity held_nade = player.nade;
951                 if (held_nade)
952                 {
953                         player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1);
954                         // LOG_TRACEF("%d %d\n", player.nade_timer, time - held_nade.nade_time_primed);
955                         makevectors(player.angles);
956                         held_nade.velocity = player.velocity;
957                         setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0);
958                         held_nade.angles_y = player.angles.y;
959
960                         if (time + 0.1 >= held_nade.wait)
961                                 toss_nade(player, '0 0 0', time + 0.05);
962                 }
963
964         if (!CanThrowNade()) return;
965         if (!(time > player.nade_refire)) return;
966                 if (key_pressed) {
967                         if (!held_nade) {
968                                 nade_prime();
969                                 held_nade = player.nade;
970                         }
971                 } else if (time >= held_nade.nade_time_primed + 1) {
972                         if (held_nade) {
973                                 makevectors(player.v_angle);
974                                 float _force = time - held_nade.nade_time_primed;
975                                 _force /= autocvar_g_nades_nade_lifetime;
976                                 _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
977                                 toss_nade(player, (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1) * _force, 0);
978                         }
979                 }
980     }
981 ENDCLASS(NadeOffhand)
982 NadeOffhand OFFHAND_NADE; STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
983
984 MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
985 {
986         if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
987                 nades_CheckThrow();
988                 return true;
989         }
990         return false;
991 }
992
993 MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
994 {SELFPARAM();
995         if (!IS_PLAYER(self)) { return false; }
996
997         if (self.nade && (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, self, self.nade_altbutton);
998
999         if(IS_PLAYER(self))
1000         {
1001                 if ( autocvar_g_nades_bonus && autocvar_g_nades )
1002                 {
1003                         entity key;
1004                         float key_count = 0;
1005                         FOR_EACH_KH_KEY(key) if(key.owner == self) { ++key_count; }
1006
1007                         float time_score;
1008                         if(self.flagcarried || self.ballcarried) // this player is important
1009                                 time_score = autocvar_g_nades_bonus_score_time_flagcarrier;
1010                         else
1011                                 time_score = autocvar_g_nades_bonus_score_time;
1012
1013                         if(key_count)
1014                                 time_score = autocvar_g_nades_bonus_score_time_flagcarrier * key_count; // multiply by the number of keys the player is holding
1015
1016                         if(autocvar_g_nades_bonus_client_select)
1017                         {
1018                                 self.nade_type = self.cvar_cl_nade_type;
1019                                 self.pokenade_type = self.cvar_cl_pokenade_type;
1020                         }
1021                         else
1022                         {
1023                                 self.nade_type = autocvar_g_nades_bonus_type;
1024                                 self.pokenade_type = autocvar_g_nades_pokenade_monster_type;
1025                         }
1026
1027                         self.nade_type = bound(1, self.nade_type, Nades_COUNT);
1028
1029                         if(self.bonus_nade_score >= 0 && autocvar_g_nades_bonus_score_max)
1030                                 nades_GiveBonus(self, time_score / autocvar_g_nades_bonus_score_max);
1031                 }
1032                 else
1033                 {
1034                         self.bonus_nades = self.bonus_nade_score = 0;
1035                 }
1036         }
1037
1038         float n = 0;
1039         entity o = world;
1040         if(self.freezetag_frozen_timeout > 0 && time >= self.freezetag_frozen_timeout)
1041                 n = -1;
1042         else
1043         {
1044                 vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
1045                 n = 0;
1046                 FOR_EACH_PLAYER(other) if(self != other)
1047                 {
1048                         if(other.deadflag == DEAD_NO)
1049                         if(other.frozen == 0)
1050                         if(SAME_TEAM(other, self))
1051                         if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
1052                         {
1053                                 if(!o)
1054                                         o = other;
1055                                 if(self.frozen == 1)
1056                                         other.reviving = true;
1057                                 ++n;
1058                         }
1059                 }
1060         }
1061
1062         if(n && self.frozen == 3) // OK, there is at least one teammate reviving us
1063         {
1064                 self.revive_progress = bound(0, self.revive_progress + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
1065                 self.health = max(1, self.revive_progress * start_health);
1066
1067                 if(self.revive_progress >= 1)
1068                 {
1069                         Unfreeze(self);
1070
1071                         Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
1072                         Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, self.netname);
1073                 }
1074
1075                 FOR_EACH_PLAYER(other) if(other.reviving)
1076                 {
1077                         other.revive_progress = self.revive_progress;
1078                         other.reviving = false;
1079                 }
1080         }
1081
1082         return false;
1083 }
1084
1085 MUTATOR_HOOKFUNCTION(nades, PlayerSpawn)
1086 {SELFPARAM();
1087         if(autocvar_g_nades_spawn)
1088                 self.nade_refire = time + autocvar_g_spawnshieldtime;
1089         else
1090                 self.nade_refire  = time + autocvar_g_nades_nade_refire;
1091
1092         if(autocvar_g_nades_bonus_client_select)
1093                 self.nade_type = self.cvar_cl_nade_type;
1094
1095         self.nade_timer = 0;
1096
1097         if (!self.offhand) self.offhand = OFFHAND_NADE;
1098
1099         if(self.nade_spawnloc)
1100         {
1101                 setorigin(self, self.nade_spawnloc.origin);
1102                 self.nade_spawnloc.cnt -= 1;
1103
1104                 if(self.nade_spawnloc.cnt <= 0)
1105                 {
1106                         remove(self.nade_spawnloc);
1107                         self.nade_spawnloc = world;
1108                 }
1109         }
1110
1111         return false;
1112 }
1113
1114 MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
1115 {
1116         if(frag_target.nade)
1117         if(!frag_target.frozen || !autocvar_g_freezetag_revive_nade)
1118                 toss_nade(frag_target, '0 0 100', max(frag_target.nade.wait, time + 0.05));
1119
1120         float killcount_bonus = ((frag_attacker.killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * frag_attacker.killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor);
1121
1122         if(IS_PLAYER(frag_attacker))
1123         {
1124                 if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
1125                         nades_RemoveBonus(frag_attacker);
1126                 else if(frag_target.flagcarried)
1127                         nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_medium);
1128                 else if(autocvar_g_nades_bonus_score_spree && frag_attacker.killcount > 1)
1129                 {
1130                         #define SPREE_ITEM(counta,countb,center,normal,gentle) \
1131                                 case counta: { nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_spree); break; }
1132                         switch(frag_attacker.killcount)
1133                         {
1134                                 KILL_SPREE_LIST
1135                                 default: nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor); break;
1136                         }
1137                         #undef SPREE_ITEM
1138                 }
1139                 else
1140                         nades_GiveBonus(frag_attacker, killcount_bonus);
1141         }
1142
1143         nades_RemoveBonus(frag_target);
1144
1145         return false;
1146 }
1147
1148 MUTATOR_HOOKFUNCTION(nades, PlayerDamage_Calculate)
1149 {
1150         if(frag_target.frozen)
1151         if(autocvar_g_freezetag_revive_nade)
1152         if(frag_attacker == frag_target)
1153         if(frag_deathtype == DEATH_NADE.m_id)
1154         if(time - frag_inflictor.toss_time <= 0.1)
1155         {
1156                 Unfreeze(frag_target);
1157                 frag_target.health = autocvar_g_freezetag_revive_nade_health;
1158                 Send_Effect(EFFECT_ICEORGLASS, frag_target.origin, '0 0 0', 3);
1159                 frag_damage = 0;
1160                 frag_force = '0 0 0';
1161                 Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
1162                 Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
1163         }
1164
1165         return false;
1166 }
1167
1168 MUTATOR_HOOKFUNCTION(nades, MonsterDies)
1169 {SELFPARAM();
1170         if(IS_PLAYER(frag_attacker))
1171         if(DIFF_TEAM(frag_attacker, self))
1172         if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
1173                 nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_minor);
1174
1175         return false;
1176 }
1177
1178 MUTATOR_HOOKFUNCTION(nades, DropSpecialItems)
1179 {
1180         if(frag_target.nade)
1181                 toss_nade(frag_target, '0 0 0', time + 0.05);
1182
1183         return false;
1184 }
1185
1186 bool nades_RemovePlayer()
1187 {SELFPARAM();
1188         nades_Clear(self);
1189         nades_RemoveBonus(self);
1190         return false;
1191 }
1192
1193 MUTATOR_HOOKFUNCTION(nades, MakePlayerObserver) { nades_RemovePlayer(); }
1194 MUTATOR_HOOKFUNCTION(nades, ClientDisconnect) { nades_RemovePlayer(); }
1195 MUTATOR_HOOKFUNCTION(nades, reset_map_global) { nades_RemovePlayer(); }
1196
1197 MUTATOR_HOOKFUNCTION(nades, SpectateCopy)
1198 {SELFPARAM();
1199         self.nade_timer = other.nade_timer;
1200         self.nade_type = other.nade_type;
1201         self.pokenade_type = other.pokenade_type;
1202         self.bonus_nades = other.bonus_nades;
1203         self.bonus_nade_score = other.bonus_nade_score;
1204         self.stat_healing_orb = other.stat_healing_orb;
1205         self.stat_healing_orb_alpha = other.stat_healing_orb_alpha;
1206         return false;
1207 }
1208
1209 MUTATOR_HOOKFUNCTION(nades, GetCvars)
1210 {
1211         GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_nade_type, "cl_nade_type");
1212         GetCvars_handleString(get_cvars_s, get_cvars_f, cvar_cl_pokenade_type, "cl_pokenade_type");
1213
1214         return false;
1215 }
1216
1217 MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
1218 {
1219         ret_string = strcat(ret_string, ":Nades");
1220         return false;
1221 }
1222
1223 MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
1224 {
1225         ret_string = strcat(ret_string, ", Nades");
1226         return false;
1227 }
1228 #endif