]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/mutators/events.qh
Merge branch 'master' into Mario/race_target_waypoint
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / events.qh
1 #pragma once
2
3 #include <common/mutators/base.qh>
4
5 // register all possible hooks here
6
7 /** called when a player becomes observer, after shared setup */
8 #define EV_MakePlayerObserver(i, o) \
9     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
10     /**/
11 MUTATOR_HOOKABLE(MakePlayerObserver, EV_MakePlayerObserver)
12
13 /** */
14 #define EV_PutClientInServer(i, o) \
15         /** client wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
16     /**/
17 MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer);
18
19 /**
20  * return true to prevent a spectator/observer to spawn as player
21  */
22  #define EV_ForbidSpawn(i, o) \
23     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
24     /**/
25 MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn);
26
27 /** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
28 #define EV_PlayerSpawn(i, o) \
29         /** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \
30     /** spot that was used, or NULL */ i(entity, MUTATOR_ARGV_1_entity) \
31     /**/
32 MUTATOR_HOOKABLE(PlayerSpawn, EV_PlayerSpawn);
33
34 /** called after a player's weapon is chosen so it can be overriden here */
35 #define EV_PlayerWeaponSelect(i, o) \
36         /** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \
37     /**/
38 MUTATOR_HOOKABLE(PlayerWeaponSelect, EV_PlayerWeaponSelect);
39
40 /** called in reset_map */
41 #define EV_reset_map_global(i, o) \
42     /**/
43 MUTATOR_HOOKABLE(reset_map_global, EV_reset_map_global);
44
45 /** called in reset_map */
46 #define EV_reset_map_players(i, o) \
47     /**/
48 MUTATOR_HOOKABLE(reset_map_players, EV_reset_map_players);
49
50 /** returns 1 if clearing player score shall not be allowed */
51 #define EV_ForbidPlayerScore_Clear(i, o) \
52     /**/
53 MUTATOR_HOOKABLE(ForbidPlayerScore_Clear, EV_ForbidPlayerScore_Clear);
54
55 /** called when a player disconnects */
56 #define EV_ClientDisconnect(i, o) \
57     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
58     /**/
59 MUTATOR_HOOKABLE(ClientDisconnect, EV_ClientDisconnect);
60
61 /** called when a player dies to e.g. remove stuff he was carrying. */
62 #define EV_PlayerDies(i, o) \
63         /** inflictor           */ i(entity, MUTATOR_ARGV_0_entity) \
64     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
65     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
66     /** deathtype       */ i(float,  MUTATOR_ARGV_3_float) \
67     /** damage          */ i(float,  MUTATOR_ARGV_4_float) \
68     /** damage                  */ o(float,  MUTATOR_ARGV_4_float) \
69     /**/
70 MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
71
72 /** allows overriding the frag centerprint messages */
73 #define EV_FragCenterMessage(i, o) \
74     /** attacker       */ i(entity, MUTATOR_ARGV_0_entity) \
75     /** target         */ i(entity, MUTATOR_ARGV_1_entity) \
76     /** deathtype      */ i(float, MUTATOR_ARGV_2_float) \
77     /** attacker kcount*/ i(int,  MUTATOR_ARGV_3_int) \
78     /** targ killcount */ i(int,  MUTATOR_ARGV_4_int) \
79     /**/
80 MUTATOR_HOOKABLE(FragCenterMessage, EV_FragCenterMessage);
81
82 /** called when a player dies to e.g. remove stuff he was carrying */
83 #define EV_PlayHitsound(i, o) \
84     /** victim */ i(entity, MUTATOR_ARGV_0_entity) \
85     /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
86     /**/
87 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
88
89 /** called when a weapon sound is about to be played, allows custom paths etc. */
90 #define EV_WeaponSound(i, o) \
91     /** sound       */ i(string, MUTATOR_ARGV_0_string) \
92     /** output      */ i(string, MUTATOR_ARGV_1_string) \
93     /**/               o(string, MUTATOR_ARGV_1_string) \
94     /**/
95 MUTATOR_HOOKABLE(WeaponSound, EV_WeaponSound);
96
97 /** called when an item model is about to be set, allows custom paths etc. */
98 #define EV_ItemModel(i, o) \
99     /** model       */ i(string, MUTATOR_ARGV_0_string) \
100     /** output      */ i(string, MUTATOR_ARGV_1_string) \
101     /**/               o(string, MUTATOR_ARGV_1_string) \
102     /**/
103 MUTATOR_HOOKABLE(ItemModel, EV_ItemModel);
104
105 /** called when an item sound is about to be played, allows custom paths etc. */
106 #define EV_ItemSound(i, o) \
107     /** sound       */ i(string, MUTATOR_ARGV_0_string) \
108     /** output      */ i(string, MUTATOR_ARGV_1_string) \
109     /**/               o(string, MUTATOR_ARGV_1_string) \
110     /**/
111 MUTATOR_HOOKABLE(ItemSound, EV_ItemSound);
112
113 /** called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill */
114 #define EV_GiveFragsForKill(i, o) \
115     /** attacker   */ i(entity, MUTATOR_ARGV_0_entity) \
116     /** target     */ i(entity, MUTATOR_ARGV_1_entity) \
117     /** frag score */ i(float, MUTATOR_ARGV_2_float) \
118     /**            */ o(float, MUTATOR_ARGV_2_float) \
119     /**/
120 MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill);
121
122 /** called when the match ends */
123 MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
124
125 /** allows adjusting allowed teams */
126 #define EV_CheckAllowedTeams(i, o) \
127     /** mask of teams      */ i(float, MUTATOR_ARGV_0_float) \
128     /**/                      o(float, MUTATOR_ARGV_0_float) \
129     /** team entity name   */ i(string, MUTATOR_ARGV_1_string) \
130     /**/                      o(string, MUTATOR_ARGV_1_string) \
131     /** player checked     */ i(entity, MUTATOR_ARGV_2_entity) \
132     /**/
133 MUTATOR_HOOKABLE(CheckAllowedTeams, EV_CheckAllowedTeams);
134
135 /** copies variables for spectating "spectatee" to "this" */
136 #define EV_SpectateCopy(i, o) \
137     /** spectatee   */ i(entity, MUTATOR_ARGV_0_entity) \
138     /** client      */ i(entity, MUTATOR_ARGV_1_entity) \
139     /**/
140 MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy);
141
142 /** called when formatting a chat message to replace fancy functions */
143 #define EV_FormatMessage(i, o) \
144     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
145     /** escape        */ i(string, MUTATOR_ARGV_1_string) \
146     /** replacement   */ i(string, MUTATOR_ARGV_2_string) \
147     /**/                 o(string, MUTATOR_ARGV_2_string) \
148     /** message       */ i(string, MUTATOR_ARGV_3_string) \
149     /**/
150 MUTATOR_HOOKABLE(FormatMessage, EV_FormatMessage);
151
152 /** called before any formatting is applied, handy for tweaking the message before scripts get ahold of it */
153 #define EV_PreFormatMessage(i, o) \
154     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
155     /** message       */ i(string, MUTATOR_ARGV_1_string) \
156     /**/                 o(string, MUTATOR_ARGV_1_string) \
157     /**/
158 MUTATOR_HOOKABLE(PreFormatMessage, EV_PreFormatMessage);
159
160 /** returns true if throwing the current weapon shall not be allowed */
161 #define EV_ForbidThrowCurrentWeapon(i, o) \
162     /** player        */ i(entity, MUTATOR_ARGV_0_entity) \
163     /** weapon entity */ i(entity, MUTATOR_ARGV_1_entity) \
164     /**/
165 MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, EV_ForbidThrowCurrentWeapon);
166
167 /** returns true if dropping the current weapon shall not be allowed at any time including death */
168 #define EV_ForbidDropCurrentWeapon(i, o) \
169     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
170     /** weapon id */     i(int, MUTATOR_ARGV_1_int) \
171     /**/
172 MUTATOR_HOOKABLE(ForbidDropCurrentWeapon, EV_ForbidDropCurrentWeapon);
173
174 /**  */
175 MUTATOR_HOOKABLE(SetDefaultAlpha, EV_NO_ARGS);
176
177 /** allows changing attack rate */
178 #define EV_WeaponRateFactor(i, o) \
179     /** weapon rate */  i(float, MUTATOR_ARGV_0_float) \
180     /**/                o(float, MUTATOR_ARGV_0_float) \
181     /** player */       i(entity, MUTATOR_ARGV_1_entity) \
182     /**/
183 MUTATOR_HOOKABLE(WeaponRateFactor, EV_WeaponRateFactor);
184
185 /** allows changing weapon speed (projectiles mostly) */
186 #define EV_WeaponSpeedFactor(i, o) \
187     /** weapon speed */ i(float, MUTATOR_ARGV_0_float) \
188     /**/                o(float, MUTATOR_ARGV_0_float) \
189     /** player */       i(entity, MUTATOR_ARGV_1_entity) \
190     /**/
191 MUTATOR_HOOKABLE(WeaponSpeedFactor, EV_WeaponSpeedFactor);
192
193 /** adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}} */
194 MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS);
195
196 /** called every frame. customizes the waypoint for spectators */
197 #define EV_CustomizeWaypoint(i, o) \
198     /** waypoint                        */ i(entity, MUTATOR_ARGV_0_entity) \
199     /** player; other.enemy = spectator */ i(entity, MUTATOR_ARGV_1_entity) \
200     /**/
201 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
202
203 /**
204  * checks if the current item may be spawned (.items and .weapons may be read and written to, as well as the ammo_ fields)
205  * return error to request removal
206  */
207 #define EV_FilterItem(i, o) \
208     /** item        */ i(entity, MUTATOR_ARGV_0_entity) \
209     /**/
210 MUTATOR_HOOKABLE(FilterItem, EV_FilterItem);
211
212 /** return error to request removal */
213 #define EV_TurretSpawn(i, o) \
214     /** turret        */ i(entity, MUTATOR_ARGV_0_entity) \
215     /**/
216 MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
217
218 /** return error to not attack */
219 #define EV_TurretFire(i, o) \
220     /** turret        */ i(entity, MUTATOR_ARGV_0_entity) \
221     /**/
222 MUTATOR_HOOKABLE(TurretFire, EV_TurretFire);
223
224 /** return error to not attack */
225 #define EV_Turret_CheckFire(i, o) \
226     /** turret                      */ i(entity, MUTATOR_ARGV_0_entity) \
227     /** to fire or not to fire      */ o(bool, MUTATOR_ARGV_1_bool) \
228     /**/
229 MUTATOR_HOOKABLE(Turret_CheckFire, EV_Turret_CheckFire);
230
231 /** return error to prevent entity spawn, or modify the entity */
232 #define EV_OnEntityPreSpawn(i, o) \
233    /** entity  */ i(entity, MUTATOR_ARGV_0_entity) \
234     /**/
235 MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_OnEntityPreSpawn);
236
237 /** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
238 #define EV_PlayerPreThink(i, o) \
239     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
240     /**/
241 MUTATOR_HOOKABLE(PlayerPreThink, EV_PlayerPreThink);
242
243 /** TODO change this into a general PlayerPostThink hook? */
244 #define EV_GetPressedKeys(i, o) \
245     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
246     /**/
247 MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys);
248
249 /** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
250 #define EV_GetCvars(i, o) \
251     /**/ i(float, get_cvars_f) \
252     /**/ i(string, get_cvars_s) \
253     /**/
254 float get_cvars_f;
255 string get_cvars_s;
256 MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because of `SZ_GetSpace: overflow`
257
258 /** can edit any "just fired" projectile */
259 #define EV_EditProjectile(i, o) \
260     /** projectile owner */ i(entity, MUTATOR_ARGV_0_entity) \
261     /** projectile */ i(entity, MUTATOR_ARGV_1_entity) \
262     /**/
263 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
264
265 /** called when a monster spawns */
266 #define EV_MonsterSpawn(i, o) \
267     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
268     /**/
269 MUTATOR_HOOKABLE(MonsterSpawn, EV_MonsterSpawn);
270
271 /** called when a monster dies */
272 #define EV_MonsterDies(i, o) \
273     /** target       */ i(entity, MUTATOR_ARGV_0_entity) \
274     /** attacker     */ i(entity, MUTATOR_ARGV_1_entity) \
275     /** deathtype    */ i(float, MUTATOR_ARGV_2_float) \
276     /**/
277 MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
278
279 /** called when a monster dies */
280 #define EV_MonsterRemove(i, o) \
281     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
282     /**/
283 MUTATOR_HOOKABLE(MonsterRemove, EV_MonsterRemove);
284
285 /** called when a monster wants to respawn */
286 #define EV_MonsterRespawn(i, o) \
287     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
288     /**/
289 MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn);
290
291 /** called when a monster is dropping loot */
292 #define EV_MonsterDropItem(i, o) \
293     /* monster */                          i(entity, MUTATOR_ARGV_0_entity) \
294     /* item (can be removed or changed) */ i(entity, MUTATOR_ARGV_1_entity) \
295     /**/                                   o(entity, MUTATOR_ARGV_1_entity) \
296     /* attacker */                         i(entity, MUTATOR_ARGV_2_entity) \
297     /**/
298 .entity monster_loot;
299 MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
300
301 /**
302  * called when a monster moves
303  * returning true makes the monster stop
304  */
305 #define EV_MonsterMove(i, o) \
306     /** monster */       i(entity, MUTATOR_ARGV_0_entity) \
307     /** run speed */     i(float, MUTATOR_ARGV_1_float) \
308     /**/                 o(float, MUTATOR_ARGV_1_float) \
309     /** walk speed */    i(float, MUTATOR_ARGV_2_float) \
310     /**/                 o(float, MUTATOR_ARGV_2_float) \
311     /** move target */   i(entity, MUTATOR_ARGV_3_entity) \
312     /**/                 o(entity, MUTATOR_ARGV_3_entity) \
313     /**/
314 MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
315
316 /** called when a monster looks for another target */
317 MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
318
319 /**
320  * called when validating a monster's target
321  */
322 #define EV_MonsterValidTarget(i, o) \
323     /** monster */       i(entity, MUTATOR_ARGV_0_entity) \
324     /** target */        i(entity, MUTATOR_ARGV_1_entity) \
325     /**/
326 MUTATOR_HOOKABLE(MonsterValidTarget, EV_MonsterValidTarget);
327
328 /** called to change a random monster to a miniboss */
329 #define EV_MonsterCheckBossFlag(i, o) \
330     /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
331     /**/
332 MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_MonsterCheckBossFlag);
333
334 /**
335  * called when a player tries to spawn a monster
336  * return 1 to prevent spawning
337  * NOTE: requires reason if disallowed
338  */
339  #define EV_AllowMobSpawning(i, o) \
340     /** caller */ i(entity, MUTATOR_ARGV_0_entity) \
341     /** reason */ o(string, MUTATOR_ARGV_1_string) \
342     /**/
343 MUTATOR_HOOKABLE(AllowMobSpawning, EV_AllowMobSpawning);
344
345 /** called when a player gets damaged to e.g. remove stuff he was carrying. */
346 #define EV_PlayerDamage_SplitHealthArmor(i, o) \
347         /** inflictor           */ i(entity, MUTATOR_ARGV_0_entity) \
348     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
349     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
350     /** force (no out)  */ i(vector, MUTATOR_ARGV_3_vector) \
351     /** damage take     */ i(float,  MUTATOR_ARGV_4_float) \
352     /** damage take     */ o(float,  MUTATOR_ARGV_4_float) \
353     /** damage save     */ i(float,  MUTATOR_ARGV_5_float) \
354     /** damage save     */ o(float,  MUTATOR_ARGV_5_float) \
355     /** deathtype               */ i(float,  MUTATOR_ARGV_6_float) \
356     /** damage              */ i(float,  MUTATOR_ARGV_7_float) \
357     /**/
358 MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor);
359
360 /**
361  * called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier
362  * i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
363  */
364 #define EV_Damage_Calculate(i, o) \
365     /** inflictor               */ i(entity, MUTATOR_ARGV_0_entity) \
366     /** attacker        */ i(entity, MUTATOR_ARGV_1_entity) \
367     /** target                  */ i(entity, MUTATOR_ARGV_2_entity) \
368     /** deathtype       */ i(float,  MUTATOR_ARGV_3_float) \
369     /** damage          */ i(float,  MUTATOR_ARGV_4_float) \
370     /** damage                  */ o(float,  MUTATOR_ARGV_4_float) \
371     /** mirrordamage    */ i(float,  MUTATOR_ARGV_5_float) \
372     /** mirrordamage    */ o(float,  MUTATOR_ARGV_5_float) \
373     /** force           */ i(vector, MUTATOR_ARGV_6_vector) \
374     /** force                   */ o(vector, MUTATOR_ARGV_6_vector) \
375     /**/
376 MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate);
377
378 /**
379  * Called when a player is damaged
380  */
381 #define EV_PlayerDamaged(i, o) \
382     /** attacker  */ i(entity, MUTATOR_ARGV_0_entity) \
383     /** target    */ i(entity, MUTATOR_ARGV_1_entity) \
384     /** health    */ i(float,    MUTATOR_ARGV_2_float) \
385     /** armor     */ i(float,    MUTATOR_ARGV_3_float) \
386     /** location  */ i(vector, MUTATOR_ARGV_4_vector) \
387     /** deathtype */ i(int,    MUTATOR_ARGV_5_int) \
388     /** potential_damage     */ i(float,    MUTATOR_ARGV_6_float) \
389     /**/
390 MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged);
391
392 /**
393  * Called by W_DecreaseAmmo
394  */
395 #define EV_W_DecreaseAmmo(i, o) \
396     /** actor */            i(entity, MUTATOR_ARGV_0_entity) \
397     /** weapon entity */    i(entity, MUTATOR_ARGV_1_entity) \
398     /**/
399 MUTATOR_HOOKABLE(W_DecreaseAmmo, EV_W_DecreaseAmmo);
400
401 /**
402  * Called by W_Reload
403  */
404 #define EV_W_Reload(i, o) \
405     /** actor */ i(entity, MUTATOR_ARGV_0_entity) \
406     /**/
407 MUTATOR_HOOKABLE(W_Reload, EV_W_Reload);
408
409 /** called at the end of player_powerups() in client.qc, used for manipulating the values which are set by powerup items. */
410 #define EV_PlayerPowerups(i, o) \
411     /** player */    i(entity, MUTATOR_ARGV_0_entity) \
412     /** old items */ i(int, MUTATOR_ARGV_1_int) \
413     /**/
414 MUTATOR_HOOKABLE(PlayerPowerups, EV_PlayerPowerups);
415
416 /**
417  * called every player think frame
418  * return 1 to disable regen
419  */
420  #define EV_PlayerRegen(i, o) \
421     /** player */               i(entity, MUTATOR_ARGV_0_entity) \
422     /** max_mod */              i(float, MUTATOR_ARGV_1_float) \
423     /**/                        o(float, MUTATOR_ARGV_1_float) \
424     /** regen_mod */            i(float, MUTATOR_ARGV_2_float) \
425     /**/                        o(float, MUTATOR_ARGV_2_float) \
426     /** rot_mod */              i(float, MUTATOR_ARGV_3_float) \
427     /**/                        o(float, MUTATOR_ARGV_3_float) \
428     /** limit_mod */            i(float, MUTATOR_ARGV_4_float) \
429     /**/                        o(float, MUTATOR_ARGV_4_float) \
430     /** health_regen */         i(float, MUTATOR_ARGV_5_float) \
431     /**/                        o(float, MUTATOR_ARGV_5_float) \
432     /** health_regenlinear */   i(float, MUTATOR_ARGV_6_float) \
433     /**/                        o(float, MUTATOR_ARGV_6_float) \
434     /** health_rot */           i(float, MUTATOR_ARGV_7_float) \
435     /**/                        o(float, MUTATOR_ARGV_7_float) \
436     /** health_rotlinear */     i(float, MUTATOR_ARGV_8_float) \
437     /**/                        o(float, MUTATOR_ARGV_8_float) \
438     /** health_stable */        i(float, MUTATOR_ARGV_9_float) \
439     /**/                        o(float, MUTATOR_ARGV_9_float) \
440     /** health_rotstable */     i(float, MUTATOR_ARGV_10_float) \
441     /**/                        o(float, MUTATOR_ARGV_10_float) \
442     /**/
443 MUTATOR_HOOKABLE(PlayerRegen, EV_PlayerRegen);
444
445 /**
446  * called when the use key is pressed
447  * if MUTATOR_RETURNVALUE is 1, don't do anything
448  * return 1 if the use key actually did something
449  */
450  #define EV_PlayerUseKey(i, o) \
451     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
452     /**/
453 MUTATOR_HOOKABLE(PlayerUseKey, EV_PlayerUseKey);
454
455 /**
456  * called when a client command is parsed
457  * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
458  * NOTE: return true if you handled the command, return false to continue handling
459  * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
460  * // example:
461  * MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
462  * {
463  *     if (MUTATOR_RETURNVALUE) // command was already handled?
464  *         return false;
465  *     if (cmd_name == "echocvar" && cmd_argc >= 2)
466  *     {
467  *         print(cvar_string(argv(1)), "\n");
468  *         return true;
469  *     }
470  *     if (cmd_name == "echostring" && cmd_argc >= 2)
471  *     {
472  *         print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
473  *         return true;
474  *     }
475  *     return false;
476  * }
477  */
478 #define EV_SV_ParseClientCommand(i, o) \
479         /** client sending the command */       i(entity, MUTATOR_ARGV_0_entity) \
480     /** command name */                     i(string, MUTATOR_ARGV_1_string) \
481         /** argc (also, argv() can be used) */  i(int, MUTATOR_ARGV_2_int) \
482         /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_3_string) \
483     /**/
484 MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand);
485
486 /** please read EV_SV_ParseClientCommand description before using */
487 #define EV_SV_ParseServerCommand(i, o) \
488    /** command name */ i(string, MUTATOR_ARGV_0_string) \
489         /** argc (also, argv() can be used) */ i(int, MUTATOR_ARGV_1_int) \
490         /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_2_string) \
491     /**/
492 MUTATOR_HOOKABLE(SV_ParseServerCommand, EV_SV_ParseServerCommand);
493
494 /**
495  * called when a spawnpoint is being evaluated
496  * return 1 to make the spawnpoint unusable
497  */
498 #define EV_Spawn_Score(i, o) \
499     /** player wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
500     /** spot to be evaluated */ i(entity, MUTATOR_ARGV_1_entity) \
501     /** spot score, _x is priority, _y is "distance" */ i(vector, MUTATOR_ARGV_2_vector) \
502     /**/ o(vector, MUTATOR_ARGV_2_vector) \
503     /**/
504 MUTATOR_HOOKABLE(Spawn_Score, EV_Spawn_Score);
505
506 /** runs globally each server frame */
507 MUTATOR_HOOKABLE(SV_StartFrame, EV_NO_ARGS);
508
509 #define EV_SetModname(i, o) \
510     /** name of the mutator/mod if it warrants showing as such in the server browser */ \
511     /**/ i(string, MUTATOR_ARGV_0_string) \
512     /**/ o(string, MUTATOR_ARGV_0_string) \
513     /**/
514 MUTATOR_HOOKABLE(SetModname, EV_SetModname);
515
516 /**
517  * called for each item being spawned on a map, including dropped weapons
518  * return 1 to remove an item
519  */
520 #define EV_Item_Spawn(i, o) \
521     /** item */ i(entity, MUTATOR_ARGV_0_entity) \
522     /**/
523 MUTATOR_HOOKABLE(Item_Spawn, EV_Item_Spawn);
524
525 #define EV_SetWeaponreplace(i, o) \
526     /** map entity */  i(entity, MUTATOR_ARGV_0_entity) \
527     /** weapon info */ i(entity, MUTATOR_ARGV_1_entity) \
528     /** replacement */ i(string, MUTATOR_ARGV_2_string) \
529     /**/               o(string, MUTATOR_ARGV_2_string) \
530     /**/
531 MUTATOR_HOOKABLE(SetWeaponreplace, EV_SetWeaponreplace);
532
533 /** called when an item is about to respawn */
534 #define EV_Item_RespawnCountdown(i, o) \
535     /** item name */   i(string, MUTATOR_ARGV_0_string) \
536     /**/               o(string, MUTATOR_ARGV_0_string) \
537     /** item colour */ i(vector, MUTATOR_ARGV_1_vector) \
538     /**/               o(vector, MUTATOR_ARGV_1_vector) \
539     /**/
540 MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
541
542 /** called when a bot checks a target to attack */
543 #define EV_BotShouldAttack(i, o) \
544     /** bot */    i(entity, MUTATOR_ARGV_0_entity) \
545     /** target */ i(entity, MUTATOR_ARGV_1_entity) \
546     /**/
547 MUTATOR_HOOKABLE(BotShouldAttack, EV_BotShouldAttack);
548
549 /**
550  * called whenever a player goes through a portal gun teleport
551  * allows you to strip a player of an item if they go through the teleporter to help prevent cheating
552  */
553 #define EV_PortalTeleport(i, o) \
554     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
555     /**/
556 MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport);
557
558 /**
559  * called whenever a player uses impulse 33 (help me) in impulse.qc
560  * normally help me ping uses .waypointsprite_attachedforcarrier,
561  * but if your mutator uses something different then you can handle it
562  * in a special manner using this hook
563  */
564 #define EV_HelpMePing(i, o) \
565     /** the player who pressed impulse 33 */ i(entity, MUTATOR_ARGV_0_entity) \
566     /**/
567 MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing);
568
569 /**
570  * called when a vehicle initializes
571  * return true to remove the vehicle
572  */
573 #define EV_VehicleInit(i, o) \
574     /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
575     /**/
576 MUTATOR_HOOKABLE(VehicleInit, EV_VehicleInit);
577
578 /**
579  * called when a player enters a vehicle
580  * allows mutators to set special settings in this event
581  */
582 #define EV_VehicleEnter(i, o) \
583     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
584     /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
585     /**/
586 MUTATOR_HOOKABLE(VehicleEnter, EV_VehicleEnter);
587
588 /**
589  * called when a player touches a vehicle
590  * return true to stop player from entering the vehicle
591  */
592 #define EV_VehicleTouch(i, o) \
593     /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
594     /** player */ i(entity, MUTATOR_ARGV_1_entity) \
595     /**/
596 MUTATOR_HOOKABLE(VehicleTouch, EV_VehicleTouch);
597
598 /**
599  * called when a player exits a vehicle
600  * allows mutators to set special settings in this event
601  */
602 #define EV_VehicleExit(i, o) \
603     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
604     /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
605     /**/
606 MUTATOR_HOOKABLE(VehicleExit, EV_VehicleExit);
607
608 /** called when a speedrun is aborted and the player is teleported back to start position */
609 #define EV_AbortSpeedrun(i, o) \
610     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
611     /**/
612 MUTATOR_HOOKABLE(AbortSpeedrun, EV_AbortSpeedrun);
613
614 /** called at when a item is touched. Called early, can edit item properties. */
615 #define EV_ItemTouch(i, o) \
616     /** item */    i(entity, MUTATOR_ARGV_0_entity) \
617     /** toucher */ i(entity, MUTATOR_ARGV_1_entity) \
618     /**/           o(entity, MUTATOR_ARGV_1_entity) \
619     /**/
620 MUTATOR_HOOKABLE(ItemTouch, EV_ItemTouch);
621
622 enum {
623         MUT_ITEMTOUCH_CONTINUE, // return this flag to make the function continue as normal
624         MUT_ITEMTOUCH_RETURN, // return this flag to make the function return (handled entirely by mutator)
625         MUT_ITEMTOUCH_PICKUP // return this flag to have the item "picked up" and taken even after mutator handled it
626 };
627
628 /** called at when a player connect */
629 #define EV_ClientConnect(i, o) \
630     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
631     /**/
632 MUTATOR_HOOKABLE(ClientConnect, EV_ClientConnect);
633
634 #define EV_HavocBot_ChooseRole(i, o) \
635     /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
636     /**/
637 MUTATOR_HOOKABLE(HavocBot_ChooseRole, EV_HavocBot_ChooseRole);
638
639 /** called when a target is checked for accuracy */
640 #define EV_AccuracyTargetValid(i, o) \
641     /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
642     /** target */ i(entity, MUTATOR_ARGV_1_entity) \
643     /**/
644 MUTATOR_HOOKABLE(AccuracyTargetValid, EV_AccuracyTargetValid);
645 enum {
646         MUT_ACCADD_VALID, // return this flag to make the function continue if target is a client
647         MUT_ACCADD_INVALID, // return this flag to make the function always continue
648         MUT_ACCADD_INDIFFERENT // return this flag to make the function always return
649 };
650
651 /** Called when clearing the global parameters for a model */
652 MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
653
654 /** Called when getting the global parameters for a model */
655 #define EV_GetModelParams(i, o) \
656     /** input */   i(string, MUTATOR_ARGV_0_string) \
657     /** command */ i(string, MUTATOR_ARGV_1_string) \
658     /**/
659 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
660
661 /** called when a bullet has hit a target */
662 #define EV_FireBullet_Hit(i, o) \
663     /** player */       i(entity, MUTATOR_ARGV_0_entity) \
664     /** targ */         i(entity, MUTATOR_ARGV_1_entity) \
665     /** start pos */    i(vector, MUTATOR_ARGV_2_vector) \
666     /** end pos */      i(vector, MUTATOR_ARGV_3_vector) \
667     /** damage */       i(float, MUTATOR_ARGV_4_float) \
668     /**/                o(float, MUTATOR_ARGV_4_float) \
669     /** wep entity */   i(entity, MUTATOR_ARGV_5_entity) \
670     /**/
671 MUTATOR_HOOKABLE(FireBullet_Hit, EV_FireBullet_Hit);
672
673 #define EV_FixPlayermodel(i, o) \
674     /** model */    i(string, MUTATOR_ARGV_0_string) \
675     /**/            o(string, MUTATOR_ARGV_0_string) \
676     /** skin */     i(int, MUTATOR_ARGV_1_int) \
677     /**/            o(int, MUTATOR_ARGV_1_int) \
678     /** player */   i(entity, MUTATOR_ARGV_2_entity) \
679     /**/
680 MUTATOR_HOOKABLE(FixPlayermodel, EV_FixPlayermodel);
681
682 /** Return error to play frag remaining announcements */
683 MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
684
685 #define EV_GrappleHookThink(i, o) \
686     /** hook */                i(entity, MUTATOR_ARGV_0_entity) \
687     /** tarzan */              i(int, MUTATOR_ARGV_1_int) \
688     /**/                       o(int, MUTATOR_ARGV_1_int) \
689     /** pulling entity */      i(entity, MUTATOR_ARGV_2_entity) \
690     /**/                       o(entity, MUTATOR_ARGV_2_entity) \
691     /** velocity multiplier */ i(float, MUTATOR_ARGV_3_float) \
692     /**/                       o(float, MUTATOR_ARGV_3_float) \
693     /**/
694 MUTATOR_HOOKABLE(GrappleHookThink, EV_GrappleHookThink);
695
696 #define EV_BuffModel_Customize(i, o) \
697     /** buff */    i(entity, MUTATOR_ARGV_0_entity) \
698     /** player */  i(entity, MUTATOR_ARGV_1_entity) \
699     /**/
700 MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize);
701
702 /** called at when a buff is touched. Called early, can edit buff properties. */
703 #define EV_BuffTouch(i, o) \
704     /** buff */    i(entity, MUTATOR_ARGV_0_entity) \
705     /** player */  i(entity, MUTATOR_ARGV_1_entity) \
706     /**/           o(entity, MUTATOR_ARGV_1_entity) \
707     /**/
708 MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch);
709
710 MUTATOR_HOOKABLE(SetNewParms, EV_NO_ARGS);
711
712 MUTATOR_HOOKABLE(SetChangeParms, EV_NO_ARGS);
713
714 MUTATOR_HOOKABLE(DecodeLevelParms, EV_NO_ARGS);
715
716 #define EV_GetRecords(i, o) \
717     /** page */           i(int, MUTATOR_ARGV_0_int) \
718     /** record list */    i(string, MUTATOR_ARGV_1_string) \
719     /**/                  o(string, MUTATOR_ARGV_1_string) \
720     /**/
721 MUTATOR_HOOKABLE(GetRecords, EV_GetRecords);
722
723 #define EV_Race_FinalCheckpoint(i, o) \
724     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
725     /**/
726 MUTATOR_HOOKABLE(Race_FinalCheckpoint, EV_Race_FinalCheckpoint);
727
728 /** called when player triggered kill (or is changing teams), return error to not do anything */
729 #define EV_ClientKill(i, o) \
730     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
731     /** kill delay */    i(float, MUTATOR_ARGV_1_float) \
732     /**/                 o(float, MUTATOR_ARGV_1_float) \
733     /**/
734 MUTATOR_HOOKABLE(ClientKill, EV_ClientKill);
735
736 #define EV_FixClientCvars(i, o) \
737     /** player */        i(entity, MUTATOR_ARGV_0_entity) \
738     /**/
739 MUTATOR_HOOKABLE(FixClientCvars, EV_FixClientCvars);
740
741 #define EV_SpectateSet(i, o) \
742     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
743     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
744     /**/             o(entity, MUTATOR_ARGV_1_entity) \
745     /**/
746 MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
747
748 #define EV_SpectateNext(i, o) \
749     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
750     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
751     /**/             o(entity, MUTATOR_ARGV_1_entity) \
752     /**/
753 MUTATOR_HOOKABLE(SpectateNext, EV_SpectateNext);
754
755 #define EV_SpectatePrev(i, o) \
756     /** client */    i(entity, MUTATOR_ARGV_0_entity) \
757     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
758     /**/             o(entity, MUTATOR_ARGV_1_entity) \
759         /** first */     i(entity, MUTATOR_ARGV_2_entity) \
760     /**/
761 MUTATOR_HOOKABLE(SpectatePrev, EV_SpectatePrev);
762
763 enum {
764     MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
765     MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
766     MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
767 };
768
769 /** called when player triggered kill (or is changing teams), return error to not do anything */
770 #define EV_Bot_FixCount(i, o) \
771         /** active real players */  i(int, MUTATOR_ARGV_0_int) \
772         /**/                                            o(int, MUTATOR_ARGV_0_int) \
773     /** real players */                 i(int, MUTATOR_ARGV_1_int) \
774     /**/                                        o(int, MUTATOR_ARGV_1_int) \
775     /**/
776 MUTATOR_HOOKABLE(Bot_FixCount, EV_Bot_FixCount);
777
778 #define EV_ClientCommand_Spectate(i, o) \
779     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
780     /**/
781 MUTATOR_HOOKABLE(ClientCommand_Spectate, EV_ClientCommand_Spectate);
782
783 enum {
784     MUT_SPECCMD_CONTINUE, // return this flag to make the function continue as normal
785     MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
786     MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
787 };
788
789 #define EV_CheckRules_World(i, o) \
790     /** status */    i(float, MUTATOR_ARGV_0_float) \
791     /**/             o(float, MUTATOR_ARGV_0_float) \
792     /* time limit */ i(float, MUTATOR_ARGV_1_float) \
793     /* frag limit */ i(float, MUTATOR_ARGV_2_float) \
794     /**/
795 MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World);
796
797 #define EV_WantWeapon(i, o) \
798     /** weapon info entity */    i(entity, MUTATOR_ARGV_0_entity) \
799     /** do want? */              i(float, MUTATOR_ARGV_1_float) \
800     /**/                         o(float, MUTATOR_ARGV_1_float) \
801     /** want all guns */         i(bool, MUTATOR_ARGV_2_bool) \
802     /**/                         o(bool, MUTATOR_ARGV_2_bool) \
803     /** want mutator blocked */  i(bool, MUTATOR_ARGV_3_bool) \
804     /**/                         o(bool, MUTATOR_ARGV_3_bool) \
805     /**/
806 MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
807
808 #define EV_AddPlayerScore(i, o) \
809     /** score field */  i(PlayerScoreField, MUTATOR_ARGV_0_entity) \
810     /** score */        i(float, MUTATOR_ARGV_1_float) \
811     /**/                o(float, MUTATOR_ARGV_1_float) \
812     /** player */       i(entity, MUTATOR_ARGV_2_entity) \
813     /**/
814 MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
815
816 #define EV_GetPlayerStatus(i, o) \
817     /** player */    i(entity, MUTATOR_ARGV_0_entity) \
818     /**/
819 MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus);
820
821 #define EV_SetWeaponArena(i, o) \
822     /** arena */     i(string, MUTATOR_ARGV_0_string) \
823     /**/             o(string, MUTATOR_ARGV_0_string) \
824     /**/
825 MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
826
827 #define EV_DropSpecialItems(i, o) \
828     /** target */ i(entity, MUTATOR_ARGV_0_entity) \
829     /**/
830 MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems);
831
832 /**
833  * called when an admin tries to kill all monsters
834  * return 1 to prevent spawning
835  */
836 #define EV_AllowMobButcher(i, o) \
837     /** reason */ o(string, MUTATOR_ARGV_0_string) \
838     /**/
839 MUTATOR_HOOKABLE(AllowMobButcher, EV_AllowMobButcher);
840
841 MUTATOR_HOOKABLE(ReadLevelCvars, EV_NO_ARGS);
842
843 #define EV_SendWaypoint(i, o) \
844         /** waypoint */     i(entity, MUTATOR_ARGV_0_entity) \
845         /** to */               i(entity, MUTATOR_ARGV_1_entity) \
846         /** send flags */   i(int, MUTATOR_ARGV_2_int) \
847         /**/                            o(int, MUTATOR_ARGV_2_int) \
848         /** wp flag */      i(int, MUTATOR_ARGV_3_int) \
849         /**/                            o(int, MUTATOR_ARGV_3_int) \
850     /**/
851 MUTATOR_HOOKABLE(SendWaypoint, EV_SendWaypoint);
852
853 #define EV_TurretValidateTarget(i, o) \
854     /** turret */          i(entity, MUTATOR_ARGV_0_entity) \
855     /** target */          i(entity, MUTATOR_ARGV_1_entity) \
856     /** validate flags */  i(int, MUTATOR_ARGV_2_int) \
857     /** target score */    o(float, MUTATOR_ARGV_3_float) \
858     /**/
859 MUTATOR_HOOKABLE(TurretValidateTarget, EV_TurretValidateTarget);
860
861 #define EV_TurretThink(i, o) \
862     /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
863     /**/
864 MUTATOR_HOOKABLE(TurretThink, EV_TurretThink);
865
866 MUTATOR_HOOKABLE(Ent_Init, EV_NO_ARGS);
867
868 /** */
869 #define EV_PrepareExplosionByDamage(i, o) \
870     /** projectile */ i(entity, MUTATOR_ARGV_0_entity) \
871     /** attacker */   i(entity, MUTATOR_ARGV_1_entity) \
872     /**/
873 MUTATOR_HOOKABLE(PrepareExplosionByDamage, EV_PrepareExplosionByDamage);
874
875 /** called when a monster model is about to be set, allows custom paths etc. */
876 #define EV_MonsterModel(i, o) \
877         /** model */  i(string, MUTATOR_ARGV_0_string) \
878         /** output */ i(string, MUTATOR_ARGV_1_string) \
879         /**/              o(string, MUTATOR_ARGV_1_string) \
880     /**/
881 MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
882
883 /**/
884 #define EV_Player_ChangeTeam(i, o) \
885     /** player */         i(entity, MUTATOR_ARGV_0_entity) \
886         /** current team */   i(float, MUTATOR_ARGV_1_float) \
887         /** new team */       i(float, MUTATOR_ARGV_2_float) \
888     /**/
889 MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
890
891 /**/
892 #define EV_URI_GetCallback(i, o) \
893         /** id */       i(float, MUTATOR_ARGV_0_float) \
894         /** status */   i(float, MUTATOR_ARGV_1_float) \
895         /** data */     i(string, MUTATOR_ARGV_2_string) \
896     /**/
897 MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback);
898
899 /**
900  * return true to prevent weapon use for a player
901  */
902  #define EV_ForbidWeaponUse(i, o) \
903     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
904     /**/
905 MUTATOR_HOOKABLE(ForbidWeaponUse, EV_ForbidWeaponUse);
906
907 /** called when creating a clone of the player (usually for corpses that stay after the player has re-spawned) */
908 #define EV_CopyBody(i, o) \
909     /** player */               i(entity, MUTATOR_ARGV_0_entity) \
910     /** newly created clone */  i(entity, MUTATOR_ARGV_1_entity) \
911     /** keepvelocity? */        i(bool, MUTATOR_ARGV_2_bool) \
912     /**/
913 MUTATOR_HOOKABLE(CopyBody, EV_CopyBody);
914
915 /** called when sending a chat message, ret argument can be changed to prevent the message */
916 #define EV_ChatMessage(i, o) \
917     /** sender */ i(entity, MUTATOR_ARGV_0_entity) \
918     /** ret */ i(int, MUTATOR_ARGV_1_int) \
919     /**/ o(int, MUTATOR_ARGV_1_int) \
920     /**/
921 MUTATOR_HOOKABLE(ChatMessage, EV_ChatMessage);
922
923 /** return true to prevent sending a chat (private, team or regular) message from reaching a certain player */
924 #define EV_ChatMessageTo(i, o) \
925     /** destination player */ i(entity, MUTATOR_ARGV_0_entity) \
926     /** sender */ i(entity, MUTATOR_ARGV_1_entity) \
927     /**/
928 MUTATOR_HOOKABLE(ChatMessageTo, EV_ChatMessageTo);
929
930 /** return true to just restart the match, for modes that don't support readyrestart */
931 MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
932
933 /** called when a fusion reactor is validating its target */
934 #define EV_FusionReactor_ValidTarget(i, o) \
935     /** turret */    i(entity, MUTATOR_ARGV_0_entity) \
936     /** target */    i(entity, MUTATOR_ARGV_1_entity) \
937     /**/
938 MUTATOR_HOOKABLE(FusionReactor_ValidTarget, EV_FusionReactor_ValidTarget);
939
940 enum {
941     MUT_FUSREAC_TARG_CONTINUE, // return this flag to make the function continue as normal
942     MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
943     MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
944 };
945
946 /** return true to hide the 'teamnumbers are imbalanced' message */
947 #define EV_HideTeamNagger(i, o) \
948     /** player */ i(entity, MUTATOR_ARGV_0_entity) \
949     /**/
950 MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);