1 #ifndef COMMON_MUTATORS_EVENTS_H
2 #define COMMON_MUTATORS_EVENTS_H
4 #define EV_NO_ARGS(i, o)
9 #define MUTATOR_TYPES(_, x) \
18 #define MUTATOR_ARGV(x, type) MUTATOR_ARGV_##x##_##type
19 #define MUTATOR_NEWGLOBAL(x, type) type MUTATOR_ARGV_##x##_##type;
21 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 0)
22 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 1)
23 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 2)
26 #undef MUTATOR_NEWGLOBAL
30 /** appends ":mutatorname" to ret_string for logging */
31 #define EV_BuildMutatorsString(i, o) \
32 /**/ i(string, ret_string) \
33 /**/ o(string, ret_string) \
35 MUTATOR_HOOKABLE(BuildMutatorsString, EV_BuildMutatorsString);
37 /** appends ", Mutator name" to ret_string for display */
38 #define EV_BuildMutatorsPrettyString(i, o) \
39 /**/ i(string, ret_string) \
40 /**/ o(string, ret_string) \
42 MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
44 /** appends mutator string for displaying extra gameplay tips */
45 #define EV_BuildGameplayTipsString(i, o) \
46 /**/ i(string, ret_string) \
47 /**/ o(string, ret_string) \
49 MUTATOR_HOOKABLE(BuildGameplayTipsString, EV_BuildGameplayTipsString);
51 #define EV_IsFlying(i, o) \
52 /**/ i(entity, MUTATOR_ARGV_0_entity) \
54 MUTATOR_HOOKABLE(IsFlying, EV_IsFlying);
56 #define EV_WP_Format(i, o) \
57 /**/ i(entity, MUTATOR_ARGV_0_entity) \
58 /**/ i(string, MUTATOR_ARGV_0_string) \
59 /**/ o(vector, MUTATOR_ARGV_0_vector) \
60 /**/ o(string, MUTATOR_ARGV_0_string) \
62 MUTATOR_HOOKABLE(WP_Format, EV_WP_Format);
65 * called before any player physics, may adjust variables for movement,
66 * is run AFTER bot code and idle checking on the server
68 #define EV_PlayerPhysics(i, o) \
69 /**/ i(entity, __self) \
71 MUTATOR_HOOKABLE(PlayerPhysics, EV_PlayerPhysics);
73 /** called when a player presses the jump key */
74 #define EV_PlayerJump(i, o) \
75 /**/ i(entity, __self) \
76 /**/ i(float, player_multijump) \
77 /**/ i(float, player_jumpheight) \
78 /**/ o(float, player_multijump) \
79 /**/ o(float, player_jumpheight) \
81 float player_multijump;
82 float player_jumpheight;
83 MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
85 /** called during player physics, allows adjusting the movement type used */
86 #define EV_PM_Physics(i, o) \
87 /**/ i(entity, __self) \
88 /**/ i(float, pm_maxspeed_mod) \
90 float pm_maxspeed_mod;
91 MUTATOR_HOOKABLE(PM_Physics, EV_PM_Physics);
93 /** called when a weapon model is about to be set, allows custom paths etc. */
94 #define EV_WeaponModel(i, o) \
95 /**/ i(string, weapon_model) \
96 /**/ i(string, weapon_model_output) \
97 /**/ o(string, weapon_model_output) \
100 string weapon_model_output;
101 MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);