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