3 #include <common/mutators/base.qh>
5 // register all possible hooks here
7 /** called when a player becomes observer, after shared setup */
8 #define EV_MakePlayerObserver(i, o) \
9 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
11 MUTATOR_HOOKABLE(MakePlayerObserver, EV_MakePlayerObserver)
14 #define EV_PutClientInServer(i, o) \
15 /** client wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
17 MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer);
20 * return true to prevent a spectator/observer to spawn as player
22 #define EV_ForbidSpawn(i, o) \
23 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
25 MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn);
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) \
32 MUTATOR_HOOKABLE(PlayerSpawn, EV_PlayerSpawn);
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) \
38 MUTATOR_HOOKABLE(PlayerWeaponSelect, EV_PlayerWeaponSelect);
40 /** called in reset_map */
41 #define EV_reset_map_global(i, o) \
43 MUTATOR_HOOKABLE(reset_map_global, EV_reset_map_global);
45 /** called in reset_map */
46 #define EV_reset_map_players(i, o) \
48 MUTATOR_HOOKABLE(reset_map_players, EV_reset_map_players);
50 /** returns 1 if clearing player score shall not be allowed */
51 #define EV_ForbidPlayerScore_Clear(i, o) \
53 MUTATOR_HOOKABLE(ForbidPlayerScore_Clear, EV_ForbidPlayerScore_Clear);
55 /** called when a player disconnects */
56 #define EV_ClientDisconnect(i, o) \
57 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
59 MUTATOR_HOOKABLE(ClientDisconnect, EV_ClientDisconnect);
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) \
70 MUTATOR_HOOKABLE(PlayerDies, EV_PlayerDies);
72 /** called after a player died. */
73 #define EV_PlayerDied(i, o) \
74 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
76 MUTATOR_HOOKABLE(PlayerDied, EV_PlayerDied);
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) \
86 MUTATOR_HOOKABLE(FragCenterMessage, EV_FragCenterMessage);
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) \
93 MUTATOR_HOOKABLE(PlayHitsound, EV_PlayHitsound);
95 /** called when an item model is about to be set, allows custom paths etc. */
96 #define EV_ItemModel(i, o) \
97 /** model */ i(string, MUTATOR_ARGV_0_string) \
98 /** output */ i(string, MUTATOR_ARGV_1_string) \
99 /**/ o(string, MUTATOR_ARGV_1_string) \
101 MUTATOR_HOOKABLE(ItemModel, EV_ItemModel);
103 /** called when an item sound is about to be played, allows custom paths etc. */
104 #define EV_ItemSound(i, o) \
105 /** sound */ i(string, MUTATOR_ARGV_0_string) \
106 /** output */ i(string, MUTATOR_ARGV_1_string) \
107 /**/ o(string, MUTATOR_ARGV_1_string) \
109 MUTATOR_HOOKABLE(ItemSound, EV_ItemSound);
111 /** called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill */
112 #define EV_GiveFragsForKill(i, o) \
113 /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
114 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
115 /** frag score */ i(float, MUTATOR_ARGV_2_float) \
116 /** */ o(float, MUTATOR_ARGV_2_float) \
118 MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill);
120 /** called when the match ends */
121 MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
123 /** allows adjusting allowed teams */
124 #define EV_CheckAllowedTeams(i, o) \
125 /** mask of teams */ i(float, MUTATOR_ARGV_0_float) \
126 /**/ o(float, MUTATOR_ARGV_0_float) \
127 /** team entity name */ i(string, MUTATOR_ARGV_1_string) \
128 /**/ o(string, MUTATOR_ARGV_1_string) \
129 /** player checked */ i(entity, MUTATOR_ARGV_2_entity) \
131 MUTATOR_HOOKABLE(CheckAllowedTeams, EV_CheckAllowedTeams);
133 /** return true to manually override team counts */
134 MUTATOR_HOOKABLE(GetTeamCounts, EV_NO_ARGS);
136 /** allow overriding of team counts */
137 #define EV_GetTeamCount(i, o) \
138 /** team to count */ i(float, MUTATOR_ARGV_0_float) \
139 /** player to ignore */ i(entity, MUTATOR_ARGV_1_entity) \
140 /** number of players in a team */ i(float, MUTATOR_ARGV_2_float) \
141 /**/ o(float, MUTATOR_ARGV_2_float) \
142 /** number of bots in a team */ i(float, MUTATOR_ARGV_3_float) \
143 /**/ o(float, MUTATOR_ARGV_3_float) \
144 /** lowest scoring human in a team */ i(entity, MUTATOR_ARGV_4_entity) \
145 /**/ o(entity, MUTATOR_ARGV_4_entity) \
146 /** lowest scoring bot in a team */ i(entity, MUTATOR_ARGV_5_entity) \
147 /**/ o(entity, MUTATOR_ARGV_5_entity) \
149 MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount);
151 /** allows overriding best teams */
152 #define EV_FindBestTeams(i, o) \
153 /** player checked */ i(entity, MUTATOR_ARGV_0_entity) \
154 /** bitmask of teams */ o(float, MUTATOR_ARGV_1_float) \
156 MUTATOR_HOOKABLE(FindBestTeams, EV_FindBestTeams);
158 /** copies variables for spectating "spectatee" to "this" */
159 #define EV_SpectateCopy(i, o) \
160 /** spectatee */ i(entity, MUTATOR_ARGV_0_entity) \
161 /** client */ i(entity, MUTATOR_ARGV_1_entity) \
163 MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy);
165 /** called when formatting a chat message to replace fancy functions */
166 #define EV_FormatMessage(i, o) \
167 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
168 /** escape */ i(string, MUTATOR_ARGV_1_string) \
169 /** replacement */ i(string, MUTATOR_ARGV_2_string) \
170 /**/ o(string, MUTATOR_ARGV_2_string) \
171 /** message */ i(string, MUTATOR_ARGV_3_string) \
173 MUTATOR_HOOKABLE(FormatMessage, EV_FormatMessage);
175 /** called before any formatting is applied, handy for tweaking the message before scripts get ahold of it */
176 #define EV_PreFormatMessage(i, o) \
177 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
178 /** message */ i(string, MUTATOR_ARGV_1_string) \
179 /**/ o(string, MUTATOR_ARGV_1_string) \
181 MUTATOR_HOOKABLE(PreFormatMessage, EV_PreFormatMessage);
183 /** returns true if throwing the current weapon shall not be allowed */
184 #define EV_ForbidThrowCurrentWeapon(i, o) \
185 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
186 /** weapon entity */ i(entity, MUTATOR_ARGV_1_entity) \
188 MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, EV_ForbidThrowCurrentWeapon);
190 /** returns true if dropping the current weapon shall not be allowed at any time including death */
191 #define EV_ForbidDropCurrentWeapon(i, o) \
192 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
193 /** weapon id */ i(int, MUTATOR_ARGV_1_int) \
195 MUTATOR_HOOKABLE(ForbidDropCurrentWeapon, EV_ForbidDropCurrentWeapon);
198 MUTATOR_HOOKABLE(SetDefaultAlpha, EV_NO_ARGS);
200 /** allows changing attack rate */
201 #define EV_WeaponRateFactor(i, o) \
202 /** weapon rate */ i(float, MUTATOR_ARGV_0_float) \
203 /**/ o(float, MUTATOR_ARGV_0_float) \
204 /** player */ i(entity, MUTATOR_ARGV_1_entity) \
206 MUTATOR_HOOKABLE(WeaponRateFactor, EV_WeaponRateFactor);
208 /** allows changing weapon speed (projectiles mostly) */
209 #define EV_WeaponSpeedFactor(i, o) \
210 /** weapon speed */ i(float, MUTATOR_ARGV_0_float) \
211 /**/ o(float, MUTATOR_ARGV_0_float) \
212 /** player */ i(entity, MUTATOR_ARGV_1_entity) \
214 MUTATOR_HOOKABLE(WeaponSpeedFactor, EV_WeaponSpeedFactor);
216 /** adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}} */
217 MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS);
219 /** called every frame. customizes the waypoint for spectators */
220 #define EV_CustomizeWaypoint(i, o) \
221 /** waypoint */ i(entity, MUTATOR_ARGV_0_entity) \
222 /** player; other.enemy = spectator */ i(entity, MUTATOR_ARGV_1_entity) \
224 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
227 * checks if the current item may be spawned (.items and .weapons may be read and written to, as well as the ammo_ fields)
228 * return error to request removal
230 #define EV_FilterItem(i, o) \
231 /** item */ i(entity, MUTATOR_ARGV_0_entity) \
233 MUTATOR_HOOKABLE(FilterItem, EV_FilterItem);
235 /** return error to request removal */
236 #define EV_TurretSpawn(i, o) \
237 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
239 MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
241 /** return error to not attack */
242 #define EV_TurretFire(i, o) \
243 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
245 MUTATOR_HOOKABLE(TurretFire, EV_TurretFire);
247 /** return error to not attack */
248 #define EV_Turret_CheckFire(i, o) \
249 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
250 /** to fire or not to fire */ o(bool, MUTATOR_ARGV_1_bool) \
252 MUTATOR_HOOKABLE(Turret_CheckFire, EV_Turret_CheckFire);
254 /** return error to prevent entity spawn, or modify the entity */
255 #define EV_OnEntityPreSpawn(i, o) \
256 /** entity */ i(entity, MUTATOR_ARGV_0_entity) \
258 MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_OnEntityPreSpawn);
260 /** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
261 #define EV_PlayerPreThink(i, o) \
262 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
264 MUTATOR_HOOKABLE(PlayerPreThink, EV_PlayerPreThink);
266 /** TODO change this into a general PlayerPostThink hook? */
267 #define EV_GetPressedKeys(i, o) \
268 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
270 MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys);
272 /** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
273 #define EV_GetCvars(i, o) \
274 /**/ i(float, get_cvars_f) \
275 /**/ i(string, get_cvars_s) \
279 MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because of `SZ_GetSpace: overflow`
281 /** can edit any "just fired" projectile */
282 #define EV_EditProjectile(i, o) \
283 /** projectile owner */ i(entity, MUTATOR_ARGV_0_entity) \
284 /** projectile */ i(entity, MUTATOR_ARGV_1_entity) \
286 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
288 /** called when a monster spawns */
289 #define EV_MonsterSpawn(i, o) \
290 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
292 MUTATOR_HOOKABLE(MonsterSpawn, EV_MonsterSpawn);
294 /** called when a monster dies */
295 #define EV_MonsterDies(i, o) \
296 /** target */ i(entity, MUTATOR_ARGV_0_entity) \
297 /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
298 /** deathtype */ i(float, MUTATOR_ARGV_2_float) \
300 MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
302 /** called when a monster dies */
303 #define EV_MonsterRemove(i, o) \
304 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
306 MUTATOR_HOOKABLE(MonsterRemove, EV_MonsterRemove);
308 /** called when a monster wants to respawn */
309 #define EV_MonsterRespawn(i, o) \
310 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
312 MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn);
314 /** called when a monster is dropping loot */
315 #define EV_MonsterDropItem(i, o) \
316 /* monster */ i(entity, MUTATOR_ARGV_0_entity) \
317 /* item (can be removed or changed) */ i(entity, MUTATOR_ARGV_1_entity) \
318 /**/ o(entity, MUTATOR_ARGV_1_entity) \
319 /* attacker */ i(entity, MUTATOR_ARGV_2_entity) \
321 .entity monster_loot;
322 MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem);
325 * called when a monster moves
326 * returning true makes the monster stop
328 #define EV_MonsterMove(i, o) \
329 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
330 /** run speed */ i(float, MUTATOR_ARGV_1_float) \
331 /**/ o(float, MUTATOR_ARGV_1_float) \
332 /** walk speed */ i(float, MUTATOR_ARGV_2_float) \
333 /**/ o(float, MUTATOR_ARGV_2_float) \
334 /** move target */ i(entity, MUTATOR_ARGV_3_entity) \
335 /**/ o(entity, MUTATOR_ARGV_3_entity) \
337 MUTATOR_HOOKABLE(MonsterMove, EV_MonsterMove);
339 /** called when a monster looks for another target */
340 MUTATOR_HOOKABLE(MonsterFindTarget, EV_NO_ARGS);
343 * called when validating a monster's target
345 #define EV_MonsterValidTarget(i, o) \
346 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
347 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
349 MUTATOR_HOOKABLE(MonsterValidTarget, EV_MonsterValidTarget);
351 /** called to change a random monster to a miniboss */
352 #define EV_MonsterCheckBossFlag(i, o) \
353 /** monster */ i(entity, MUTATOR_ARGV_0_entity) \
355 MUTATOR_HOOKABLE(MonsterCheckBossFlag, EV_MonsterCheckBossFlag);
358 * called when a player tries to spawn a monster
359 * return 1 to prevent spawning
360 * NOTE: requires reason if disallowed
362 #define EV_AllowMobSpawning(i, o) \
363 /** caller */ i(entity, MUTATOR_ARGV_0_entity) \
364 /** reason */ o(string, MUTATOR_ARGV_1_string) \
366 MUTATOR_HOOKABLE(AllowMobSpawning, EV_AllowMobSpawning);
368 /** called when a player gets damaged to e.g. remove stuff he was carrying. */
369 #define EV_PlayerDamage_SplitHealthArmor(i, o) \
370 /** inflictor */ i(entity, MUTATOR_ARGV_0_entity) \
371 /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
372 /** target */ i(entity, MUTATOR_ARGV_2_entity) \
373 /** force (no out) */ i(vector, MUTATOR_ARGV_3_vector) \
374 /** damage take */ i(float, MUTATOR_ARGV_4_float) \
375 /** damage take */ o(float, MUTATOR_ARGV_4_float) \
376 /** damage save */ i(float, MUTATOR_ARGV_5_float) \
377 /** damage save */ o(float, MUTATOR_ARGV_5_float) \
378 /** deathtype */ i(float, MUTATOR_ARGV_6_float) \
379 /** damage */ i(float, MUTATOR_ARGV_7_float) \
381 MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor);
384 * called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier
385 * i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage).
387 #define EV_Damage_Calculate(i, o) \
388 /** inflictor */ i(entity, MUTATOR_ARGV_0_entity) \
389 /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
390 /** target */ i(entity, MUTATOR_ARGV_2_entity) \
391 /** deathtype */ i(float, MUTATOR_ARGV_3_float) \
392 /** damage */ i(float, MUTATOR_ARGV_4_float) \
393 /** damage */ o(float, MUTATOR_ARGV_4_float) \
394 /** mirrordamage */ i(float, MUTATOR_ARGV_5_float) \
395 /** mirrordamage */ o(float, MUTATOR_ARGV_5_float) \
396 /** force */ i(vector, MUTATOR_ARGV_6_vector) \
397 /** force */ o(vector, MUTATOR_ARGV_6_vector) \
399 MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate);
402 * Called when a player is damaged
404 #define EV_PlayerDamaged(i, o) \
405 /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
406 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
407 /** health */ i(float, MUTATOR_ARGV_2_float) \
408 /** armor */ i(float, MUTATOR_ARGV_3_float) \
409 /** location */ i(vector, MUTATOR_ARGV_4_vector) \
410 /** deathtype */ i(int, MUTATOR_ARGV_5_int) \
411 /** potential_damage */ i(float, MUTATOR_ARGV_6_float) \
413 MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged);
416 * Called by W_DecreaseAmmo
418 #define EV_W_DecreaseAmmo(i, o) \
419 /** actor */ i(entity, MUTATOR_ARGV_0_entity) \
420 /** weapon entity */ i(entity, MUTATOR_ARGV_1_entity) \
422 MUTATOR_HOOKABLE(W_DecreaseAmmo, EV_W_DecreaseAmmo);
427 #define EV_W_Reload(i, o) \
428 /** actor */ i(entity, MUTATOR_ARGV_0_entity) \
430 MUTATOR_HOOKABLE(W_Reload, EV_W_Reload);
432 /** called at the end of player_powerups() in client.qc, used for manipulating the values which are set by powerup items. */
433 #define EV_PlayerPowerups(i, o) \
434 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
435 /** old items */ i(int, MUTATOR_ARGV_1_int) \
437 MUTATOR_HOOKABLE(PlayerPowerups, EV_PlayerPowerups);
440 * called every player think frame
441 * return 1 to disable regen
443 #define EV_PlayerRegen(i, o) \
444 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
445 /** max_mod */ i(float, MUTATOR_ARGV_1_float) \
446 /**/ o(float, MUTATOR_ARGV_1_float) \
447 /** regen_mod */ i(float, MUTATOR_ARGV_2_float) \
448 /**/ o(float, MUTATOR_ARGV_2_float) \
449 /** rot_mod */ i(float, MUTATOR_ARGV_3_float) \
450 /**/ o(float, MUTATOR_ARGV_3_float) \
451 /** limit_mod */ i(float, MUTATOR_ARGV_4_float) \
452 /**/ o(float, MUTATOR_ARGV_4_float) \
453 /** health_regen */ i(float, MUTATOR_ARGV_5_float) \
454 /**/ o(float, MUTATOR_ARGV_5_float) \
455 /** health_regenlinear */ i(float, MUTATOR_ARGV_6_float) \
456 /**/ o(float, MUTATOR_ARGV_6_float) \
457 /** health_rot */ i(float, MUTATOR_ARGV_7_float) \
458 /**/ o(float, MUTATOR_ARGV_7_float) \
459 /** health_rotlinear */ i(float, MUTATOR_ARGV_8_float) \
460 /**/ o(float, MUTATOR_ARGV_8_float) \
461 /** health_stable */ i(float, MUTATOR_ARGV_9_float) \
462 /**/ o(float, MUTATOR_ARGV_9_float) \
463 /** health_rotstable */ i(float, MUTATOR_ARGV_10_float) \
464 /**/ o(float, MUTATOR_ARGV_10_float) \
466 MUTATOR_HOOKABLE(PlayerRegen, EV_PlayerRegen);
469 * called when the use key is pressed
470 * if MUTATOR_RETURNVALUE is 1, don't do anything
471 * return 1 if the use key actually did something
473 #define EV_PlayerUseKey(i, o) \
474 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
476 MUTATOR_HOOKABLE(PlayerUseKey, EV_PlayerUseKey);
479 * called when a client command is parsed
480 * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
481 * NOTE: return true if you handled the command, return false to continue handling
482 * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
484 * MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
486 * if (MUTATOR_RETURNVALUE) // command was already handled?
488 * if (cmd_name == "echocvar" && cmd_argc >= 2)
490 * print(cvar_string(argv(1)), "\n");
493 * if (cmd_name == "echostring" && cmd_argc >= 2)
495 * print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
501 #define EV_SV_ParseClientCommand(i, o) \
502 /** client sending the command */ i(entity, MUTATOR_ARGV_0_entity) \
503 /** command name */ i(string, MUTATOR_ARGV_1_string) \
504 /** argc (also, argv() can be used) */ i(int, MUTATOR_ARGV_2_int) \
505 /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_3_string) \
507 MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand);
509 /** please read EV_SV_ParseClientCommand description before using */
510 #define EV_SV_ParseServerCommand(i, o) \
511 /** command name */ i(string, MUTATOR_ARGV_0_string) \
512 /** argc (also, argv() can be used) */ i(int, MUTATOR_ARGV_1_int) \
513 /** whole command, use only if you really have to */ i(string, MUTATOR_ARGV_2_string) \
515 MUTATOR_HOOKABLE(SV_ParseServerCommand, EV_SV_ParseServerCommand);
518 * called when a spawnpoint is being evaluated
519 * return 1 to make the spawnpoint unusable
521 #define EV_Spawn_Score(i, o) \
522 /** player wanting to spawn */ i(entity, MUTATOR_ARGV_0_entity) \
523 /** spot to be evaluated */ i(entity, MUTATOR_ARGV_1_entity) \
524 /** spot score, _x is priority, _y is "distance" */ i(vector, MUTATOR_ARGV_2_vector) \
525 /**/ o(vector, MUTATOR_ARGV_2_vector) \
527 MUTATOR_HOOKABLE(Spawn_Score, EV_Spawn_Score);
529 /** runs globally each server frame */
530 MUTATOR_HOOKABLE(SV_StartFrame, EV_NO_ARGS);
532 #define EV_SetModname(i, o) \
533 /** name of the mutator/mod if it warrants showing as such in the server browser */ \
534 /**/ i(string, MUTATOR_ARGV_0_string) \
535 /**/ o(string, MUTATOR_ARGV_0_string) \
537 MUTATOR_HOOKABLE(SetModname, EV_SetModname);
540 * called for each item being spawned on a map, including dropped weapons
541 * return 1 to remove an item
543 #define EV_Item_Spawn(i, o) \
544 /** item */ i(entity, MUTATOR_ARGV_0_entity) \
546 MUTATOR_HOOKABLE(Item_Spawn, EV_Item_Spawn);
548 #define EV_SetWeaponreplace(i, o) \
549 /** map entity */ i(entity, MUTATOR_ARGV_0_entity) \
550 /** weapon info */ i(entity, MUTATOR_ARGV_1_entity) \
551 /** replacement */ i(string, MUTATOR_ARGV_2_string) \
552 /**/ o(string, MUTATOR_ARGV_2_string) \
554 MUTATOR_HOOKABLE(SetWeaponreplace, EV_SetWeaponreplace);
556 /** called when an item is about to respawn */
557 #define EV_Item_RespawnCountdown(i, o) \
558 /** item */ i(entity, MUTATOR_ARGV_0_entity) \
560 MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_Item_RespawnCountdown);
562 /** called when a bot checks a target to attack */
563 #define EV_BotShouldAttack(i, o) \
564 /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
565 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
567 MUTATOR_HOOKABLE(BotShouldAttack, EV_BotShouldAttack);
570 * called whenever a player goes through a portal gun teleport
571 * allows you to strip a player of an item if they go through the teleporter to help prevent cheating
573 #define EV_PortalTeleport(i, o) \
574 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
576 MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport);
579 * called whenever a player uses impulse 33 (help me) in impulse.qc
580 * normally help me ping uses .waypointsprite_attachedforcarrier,
581 * but if your mutator uses something different then you can handle it
582 * in a special manner using this hook
584 #define EV_HelpMePing(i, o) \
585 /** the player who pressed impulse 33 */ i(entity, MUTATOR_ARGV_0_entity) \
587 MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing);
590 * called when a vehicle initializes
591 * return true to remove the vehicle
593 #define EV_VehicleInit(i, o) \
594 /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
596 MUTATOR_HOOKABLE(VehicleInit, EV_VehicleInit);
599 * called when a player enters a vehicle
600 * allows mutators to set special settings in this event
602 #define EV_VehicleEnter(i, o) \
603 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
604 /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
606 MUTATOR_HOOKABLE(VehicleEnter, EV_VehicleEnter);
609 * called when a player touches a vehicle
610 * return true to stop player from entering the vehicle
612 #define EV_VehicleTouch(i, o) \
613 /** vehicle */ i(entity, MUTATOR_ARGV_0_entity) \
614 /** player */ i(entity, MUTATOR_ARGV_1_entity) \
616 MUTATOR_HOOKABLE(VehicleTouch, EV_VehicleTouch);
619 * called when a player exits a vehicle
620 * allows mutators to set special settings in this event
622 #define EV_VehicleExit(i, o) \
623 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
624 /** vehicle */ i(entity, MUTATOR_ARGV_1_entity) \
626 MUTATOR_HOOKABLE(VehicleExit, EV_VehicleExit);
628 /** called when a speedrun is aborted and the player is teleported back to start position */
629 #define EV_AbortSpeedrun(i, o) \
630 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
632 MUTATOR_HOOKABLE(AbortSpeedrun, EV_AbortSpeedrun);
634 /** called at when a item is touched. Called early, can edit item properties. */
635 #define EV_ItemTouch(i, o) \
636 /** item */ i(entity, MUTATOR_ARGV_0_entity) \
637 /** toucher */ i(entity, MUTATOR_ARGV_1_entity) \
638 /**/ o(entity, MUTATOR_ARGV_1_entity) \
640 MUTATOR_HOOKABLE(ItemTouch, EV_ItemTouch);
643 MUT_ITEMTOUCH_CONTINUE, // return this flag to make the function continue as normal
644 MUT_ITEMTOUCH_RETURN, // return this flag to make the function return (handled entirely by mutator)
645 MUT_ITEMTOUCH_PICKUP // return this flag to have the item "picked up" and taken even after mutator handled it
648 /** Called when the amount of entity resources changes. Can be used to override
650 #define EV_GetResourceLimit(i, o) \
651 /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
652 /** resource type */ i(int, MUTATOR_ARGV_1_int) \
653 /** limit */ i(float, MUTATOR_ARGV_2_float) \
654 /**/ o(float, MUTATOR_ARGV_2_float) \
656 MUTATOR_HOOKABLE(GetResourceLimit, EV_GetResourceLimit);
658 /** Called when the amount of resource of an entity changes. See RESOURCE_*
659 constants for resource types. Return true to forbid the change. */
660 #define EV_SetResourceAmount(i, o) \
661 /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
662 /** resource type */ i(int, MUTATOR_ARGV_1_int) \
663 /**/ o(int, MUTATOR_ARGV_1_int) \
664 /** amount */ i(float, MUTATOR_ARGV_2_float) \
665 /**/ o(float, MUTATOR_ARGV_2_float) \
667 MUTATOR_HOOKABLE(SetResourceAmount, EV_SetResourceAmount);
669 /** Called when entity is being given some resource. See RESOURCE_* constants
670 for resource types. Return true to forbid giving. */
671 #define EV_GiveResource(i, o) \
672 /** receiver */ i(entity, MUTATOR_ARGV_0_entity) \
673 /** resource type */ i(int, MUTATOR_ARGV_1_int) \
674 /**/ o(int, MUTATOR_ARGV_1_int) \
675 /** amount */ i(float, MUTATOR_ARGV_2_float) \
676 /**/ o(float, MUTATOR_ARGV_2_float) \
678 MUTATOR_HOOKABLE(GiveResource, EV_GiveResource);
680 /** called at when a player connect */
681 #define EV_ClientConnect(i, o) \
682 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
684 MUTATOR_HOOKABLE(ClientConnect, EV_ClientConnect);
686 #define EV_HavocBot_ChooseRole(i, o) \
687 /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
689 MUTATOR_HOOKABLE(HavocBot_ChooseRole, EV_HavocBot_ChooseRole);
691 /** called when a target is checked for accuracy */
692 #define EV_AccuracyTargetValid(i, o) \
693 /** attacker */ i(entity, MUTATOR_ARGV_0_entity) \
694 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
696 MUTATOR_HOOKABLE(AccuracyTargetValid, EV_AccuracyTargetValid);
698 MUT_ACCADD_VALID, // return this flag to make the function continue if target is a client
699 MUT_ACCADD_INVALID, // return this flag to make the function always continue
700 MUT_ACCADD_INDIFFERENT // return this flag to make the function always return
703 /** Called when clearing the global parameters for a model */
704 MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
706 /** Called when getting the global parameters for a model */
707 #define EV_GetModelParams(i, o) \
708 /** input */ i(string, MUTATOR_ARGV_0_string) \
709 /** command */ i(string, MUTATOR_ARGV_1_string) \
711 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
713 /** called when a bullet has hit a target */
714 #define EV_FireBullet_Hit(i, o) \
715 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
716 /** targ */ i(entity, MUTATOR_ARGV_1_entity) \
717 /** start pos */ i(vector, MUTATOR_ARGV_2_vector) \
718 /** end pos */ i(vector, MUTATOR_ARGV_3_vector) \
719 /** damage */ i(float, MUTATOR_ARGV_4_float) \
720 /**/ o(float, MUTATOR_ARGV_4_float) \
721 /** wep entity */ i(entity, MUTATOR_ARGV_5_entity) \
723 MUTATOR_HOOKABLE(FireBullet_Hit, EV_FireBullet_Hit);
725 #define EV_FixPlayermodel(i, o) \
726 /** model */ i(string, MUTATOR_ARGV_0_string) \
727 /**/ o(string, MUTATOR_ARGV_0_string) \
728 /** skin */ i(int, MUTATOR_ARGV_1_int) \
729 /**/ o(int, MUTATOR_ARGV_1_int) \
730 /** player */ i(entity, MUTATOR_ARGV_2_entity) \
732 MUTATOR_HOOKABLE(FixPlayermodel, EV_FixPlayermodel);
734 /** Return error to play frag remaining announcements */
735 MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS);
737 #define EV_GrappleHookThink(i, o) \
738 /** hook */ i(entity, MUTATOR_ARGV_0_entity) \
739 /** tarzan */ i(int, MUTATOR_ARGV_1_int) \
740 /**/ o(int, MUTATOR_ARGV_1_int) \
741 /** pulling entity */ i(entity, MUTATOR_ARGV_2_entity) \
742 /**/ o(entity, MUTATOR_ARGV_2_entity) \
743 /** velocity multiplier */ i(float, MUTATOR_ARGV_3_float) \
744 /**/ o(float, MUTATOR_ARGV_3_float) \
746 MUTATOR_HOOKABLE(GrappleHookThink, EV_GrappleHookThink);
748 #define EV_BuffModel_Customize(i, o) \
749 /** buff */ i(entity, MUTATOR_ARGV_0_entity) \
750 /** player */ i(entity, MUTATOR_ARGV_1_entity) \
752 MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize);
754 /** called at when a buff is touched. Called early, can edit buff properties. */
755 #define EV_BuffTouch(i, o) \
756 /** buff */ i(entity, MUTATOR_ARGV_0_entity) \
757 /** player */ i(entity, MUTATOR_ARGV_1_entity) \
758 /**/ o(entity, MUTATOR_ARGV_1_entity) \
760 MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch);
762 MUTATOR_HOOKABLE(SetNewParms, EV_NO_ARGS);
764 MUTATOR_HOOKABLE(SetChangeParms, EV_NO_ARGS);
766 MUTATOR_HOOKABLE(DecodeLevelParms, EV_NO_ARGS);
768 #define EV_GetRecords(i, o) \
769 /** page */ i(int, MUTATOR_ARGV_0_int) \
770 /** record list */ i(string, MUTATOR_ARGV_1_string) \
771 /**/ o(string, MUTATOR_ARGV_1_string) \
773 MUTATOR_HOOKABLE(GetRecords, EV_GetRecords);
775 #define EV_Race_FinalCheckpoint(i, o) \
776 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
778 MUTATOR_HOOKABLE(Race_FinalCheckpoint, EV_Race_FinalCheckpoint);
780 /** called when player triggered kill (or is changing teams), return error to not do anything */
781 #define EV_ClientKill(i, o) \
782 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
783 /** kill delay */ i(float, MUTATOR_ARGV_1_float) \
784 /**/ o(float, MUTATOR_ARGV_1_float) \
786 MUTATOR_HOOKABLE(ClientKill, EV_ClientKill);
788 /** called when player is about to be killed during kill command or changing teams */
789 #define EV_ClientKill_Now(i, o) \
790 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
792 MUTATOR_HOOKABLE(ClientKill_Now, EV_ClientKill_Now);
794 #define EV_FixClientCvars(i, o) \
795 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
797 MUTATOR_HOOKABLE(FixClientCvars, EV_FixClientCvars);
799 #define EV_SpectateSet(i, o) \
800 /** client */ i(entity, MUTATOR_ARGV_0_entity) \
801 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
802 /**/ o(entity, MUTATOR_ARGV_1_entity) \
804 MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
806 #define EV_SpectateNext(i, o) \
807 /** client */ i(entity, MUTATOR_ARGV_0_entity) \
808 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
809 /**/ o(entity, MUTATOR_ARGV_1_entity) \
811 MUTATOR_HOOKABLE(SpectateNext, EV_SpectateNext);
813 #define EV_SpectatePrev(i, o) \
814 /** client */ i(entity, MUTATOR_ARGV_0_entity) \
815 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
816 /**/ o(entity, MUTATOR_ARGV_1_entity) \
817 /** first */ i(entity, MUTATOR_ARGV_2_entity) \
819 MUTATOR_HOOKABLE(SpectatePrev, EV_SpectatePrev);
822 MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
823 MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
824 MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
827 /** called when player triggered kill (or is changing teams), return error to not do anything */
828 #define EV_Bot_FixCount(i, o) \
829 /** active real players */ i(int, MUTATOR_ARGV_0_int) \
830 /**/ o(int, MUTATOR_ARGV_0_int) \
831 /** real players */ i(int, MUTATOR_ARGV_1_int) \
832 /**/ o(int, MUTATOR_ARGV_1_int) \
834 MUTATOR_HOOKABLE(Bot_FixCount, EV_Bot_FixCount);
836 #define EV_ClientCommand_Spectate(i, o) \
837 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
839 MUTATOR_HOOKABLE(ClientCommand_Spectate, EV_ClientCommand_Spectate);
842 MUT_SPECCMD_CONTINUE, // return this flag to make the function continue as normal
843 MUT_SPECCMD_RETURN, // return this flag to make the function return (don't spectate)
844 MUT_SPECCMD_FORCE // return this flag to force the player to spectate, even if they're not a player
847 #define EV_CheckRules_World(i, o) \
848 /** status */ i(float, MUTATOR_ARGV_0_float) \
849 /**/ o(float, MUTATOR_ARGV_0_float) \
850 /* time limit */ i(float, MUTATOR_ARGV_1_float) \
851 /* frag limit */ i(float, MUTATOR_ARGV_2_float) \
853 MUTATOR_HOOKABLE(CheckRules_World, EV_CheckRules_World);
855 #define EV_WantWeapon(i, o) \
856 /** weapon info entity */ i(entity, MUTATOR_ARGV_0_entity) \
857 /** do want? */ i(float, MUTATOR_ARGV_1_float) \
858 /**/ o(float, MUTATOR_ARGV_1_float) \
859 /** want all guns */ i(bool, MUTATOR_ARGV_2_bool) \
860 /**/ o(bool, MUTATOR_ARGV_2_bool) \
861 /** want mutator blocked */ i(bool, MUTATOR_ARGV_3_bool) \
862 /**/ o(bool, MUTATOR_ARGV_3_bool) \
864 MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
866 #define EV_AddPlayerScore(i, o) \
867 /** score field */ i(entity, MUTATOR_ARGV_0_entity) \
868 /** score */ i(float, MUTATOR_ARGV_1_float) \
869 /**/ o(float, MUTATOR_ARGV_1_float) \
870 /** player */ i(entity, MUTATOR_ARGV_2_entity) \
872 MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
874 #define EV_GetPlayerStatus(i, o) \
875 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
877 MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus);
879 #define EV_SetWeaponArena(i, o) \
880 /** arena */ i(string, MUTATOR_ARGV_0_string) \
881 /**/ o(string, MUTATOR_ARGV_0_string) \
883 MUTATOR_HOOKABLE(SetWeaponArena, EV_SetWeaponArena);
885 #define EV_DropSpecialItems(i, o) \
886 /** target */ i(entity, MUTATOR_ARGV_0_entity) \
888 MUTATOR_HOOKABLE(DropSpecialItems, EV_DropSpecialItems);
891 * called when an admin tries to kill all monsters
892 * return 1 to prevent spawning
894 #define EV_AllowMobButcher(i, o) \
895 /** reason */ o(string, MUTATOR_ARGV_0_string) \
897 MUTATOR_HOOKABLE(AllowMobButcher, EV_AllowMobButcher);
899 MUTATOR_HOOKABLE(ReadLevelCvars, EV_NO_ARGS);
901 #define EV_SendWaypoint(i, o) \
902 /** waypoint */ i(entity, MUTATOR_ARGV_0_entity) \
903 /** to */ i(entity, MUTATOR_ARGV_1_entity) \
904 /** send flags */ i(int, MUTATOR_ARGV_2_int) \
905 /**/ o(int, MUTATOR_ARGV_2_int) \
906 /** wp flag */ i(int, MUTATOR_ARGV_3_int) \
907 /**/ o(int, MUTATOR_ARGV_3_int) \
909 MUTATOR_HOOKABLE(SendWaypoint, EV_SendWaypoint);
911 #define EV_TurretValidateTarget(i, o) \
912 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
913 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
914 /** validate flags */ i(int, MUTATOR_ARGV_2_int) \
915 /** target score */ o(float, MUTATOR_ARGV_3_float) \
917 MUTATOR_HOOKABLE(TurretValidateTarget, EV_TurretValidateTarget);
919 #define EV_TurretThink(i, o) \
920 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
922 MUTATOR_HOOKABLE(TurretThink, EV_TurretThink);
924 MUTATOR_HOOKABLE(Ent_Init, EV_NO_ARGS);
927 #define EV_PrepareExplosionByDamage(i, o) \
928 /** projectile */ i(entity, MUTATOR_ARGV_0_entity) \
929 /** attacker */ i(entity, MUTATOR_ARGV_1_entity) \
931 MUTATOR_HOOKABLE(PrepareExplosionByDamage, EV_PrepareExplosionByDamage);
933 /** called when a monster model is about to be set, allows custom paths etc. */
934 #define EV_MonsterModel(i, o) \
935 /** model */ i(string, MUTATOR_ARGV_0_string) \
936 /** output */ i(string, MUTATOR_ARGV_1_string) \
937 /**/ o(string, MUTATOR_ARGV_1_string) \
939 MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel);
942 * Called before player changes their team. Return true to block team change.
944 #define EV_Player_ChangeTeam(i, o) \
945 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
946 /** current team */ i(float, MUTATOR_ARGV_1_float) \
947 /** new team */ i(float, MUTATOR_ARGV_2_float) \
949 MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam);
952 * Called after player has changed their team.
954 #define EV_Player_ChangedTeam(i, o) \
955 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
956 /** old team */ i(float, MUTATOR_ARGV_1_float) \
957 /** current team */ i(float, MUTATOR_ARGV_2_float) \
959 MUTATOR_HOOKABLE(Player_ChangedTeam, EV_Player_ChangedTeam);
962 * Called when player is about to be killed when changing teams. Return true to block killing.
964 #define EV_Player_ChangeTeamKill(i, o) \
965 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
967 MUTATOR_HOOKABLE(Player_ChangeTeamKill, EV_Player_ChangeTeamKill);
970 #define EV_URI_GetCallback(i, o) \
971 /** id */ i(float, MUTATOR_ARGV_0_float) \
972 /** status */ i(float, MUTATOR_ARGV_1_float) \
973 /** data */ i(string, MUTATOR_ARGV_2_string) \
975 MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback);
978 * return true to prevent weapon use for a player
980 #define EV_ForbidWeaponUse(i, o) \
981 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
983 MUTATOR_HOOKABLE(ForbidWeaponUse, EV_ForbidWeaponUse);
985 /** called when creating a clone of the player (usually for corpses that stay after the player has re-spawned) */
986 #define EV_CopyBody(i, o) \
987 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
988 /** newly created clone */ i(entity, MUTATOR_ARGV_1_entity) \
989 /** keepvelocity? */ i(bool, MUTATOR_ARGV_2_bool) \
991 MUTATOR_HOOKABLE(CopyBody, EV_CopyBody);
993 /** called when sending a chat message, ret argument can be changed to prevent the message */
994 #define EV_ChatMessage(i, o) \
995 /** sender */ i(entity, MUTATOR_ARGV_0_entity) \
996 /** ret */ i(int, MUTATOR_ARGV_1_int) \
997 /**/ o(int, MUTATOR_ARGV_1_int) \
999 MUTATOR_HOOKABLE(ChatMessage, EV_ChatMessage);
1001 /** return true to prevent sending a chat (private, team or regular) message from reaching a certain player */
1002 #define EV_ChatMessageTo(i, o) \
1003 /** destination player */ i(entity, MUTATOR_ARGV_0_entity) \
1004 /** sender */ i(entity, MUTATOR_ARGV_1_entity) \
1006 MUTATOR_HOOKABLE(ChatMessageTo, EV_ChatMessageTo);
1008 /** return true to just restart the match, for modes that don't support readyrestart */
1009 MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
1011 /** called when a fusion reactor is validating its target */
1012 #define EV_FusionReactor_ValidTarget(i, o) \
1013 /** turret */ i(entity, MUTATOR_ARGV_0_entity) \
1014 /** target */ i(entity, MUTATOR_ARGV_1_entity) \
1016 MUTATOR_HOOKABLE(FusionReactor_ValidTarget, EV_FusionReactor_ValidTarget);
1019 MUT_FUSREAC_TARG_CONTINUE, // return this flag to make the function continue as normal
1020 MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
1021 MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
1024 /** return true to hide the 'teamnumbers are imbalanced' message */
1025 #define EV_HideTeamNagger(i, o) \
1026 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
1028 MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
1030 /** return true to show a waypoint while the item is spawning */
1031 #define EV_Item_ScheduleRespawn(i, o) \
1032 /** item */ i(entity, MUTATOR_ARGV_0_entity) \
1033 /** respawn time */ i(float, MUTATOR_ARGV_1_float) \
1035 MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);
1037 /** called before physics stats are set on a player, allows limited early customization */
1038 #define EV_PlayerPhysics_UpdateStats(i, o) \
1039 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
1041 MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats);
1043 /** return true to use your own aim target (or none at all) */
1044 #define EV_HavocBot_Aim(i, o) \
1045 /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
1047 MUTATOR_HOOKABLE(HavocBot_Aim, EV_HavocBot_Aim);