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 // TODO: migrate to arrays some day when no other globals are used
19 #define M_ARGV(x, type) MUTATOR_ARGV_##x##_##type
20 #define MUTATOR_NEWGLOBAL(x, type) type MUTATOR_ARGV_##x##_##type;
22 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 0)
23 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 1)
24 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 2)
25 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 3)
26 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 4)
27 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 5)
28 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 6)
29 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 7)
30 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 8)
33 #undef MUTATOR_NEWGLOBAL
37 /** appends ":mutatorname" to ret_string for logging */
38 #define EV_BuildMutatorsString(i, o) \
39 /**/ i(string, ret_string) \
40 /**/ o(string, ret_string) \
42 MUTATOR_HOOKABLE(BuildMutatorsString, EV_BuildMutatorsString);
44 /** appends ", Mutator name" to ret_string for display */
45 #define EV_BuildMutatorsPrettyString(i, o) \
46 /**/ i(string, ret_string) \
47 /**/ o(string, ret_string) \
49 MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
51 /** appends mutator string for displaying extra gameplay tips */
52 #define EV_BuildGameplayTipsString(i, o) \
53 /**/ i(string, ret_string) \
54 /**/ o(string, ret_string) \
56 MUTATOR_HOOKABLE(BuildGameplayTipsString, EV_BuildGameplayTipsString);
58 #define EV_IsFlying(i, o) \
59 /**/ i(entity, MUTATOR_ARGV_0_entity) \
61 MUTATOR_HOOKABLE(IsFlying, EV_IsFlying);
63 #define EV_WP_Format(i, o) \
64 /**/ i(entity, MUTATOR_ARGV_0_entity) \
65 /**/ i(string, MUTATOR_ARGV_1_string) \
66 /**/ o(vector, MUTATOR_ARGV_2_vector) \
67 /**/ o(string, MUTATOR_ARGV_3_string) \
69 MUTATOR_HOOKABLE(WP_Format, EV_WP_Format);
72 * called before any player physics, may adjust variables for movement,
73 * is run AFTER bot code and idle checking on the server
75 #define EV_PlayerPhysics(i, o) \
76 /**/ i(entity, __self) \
78 MUTATOR_HOOKABLE(PlayerPhysics, EV_PlayerPhysics);
80 /** called when a player presses the jump key */
81 #define EV_PlayerJump(i, o) \
82 /**/ i(entity, __self) \
83 /**/ i(float, player_multijump) \
84 /**/ i(float, player_jumpheight) \
85 /**/ o(float, player_multijump) \
86 /**/ o(float, player_jumpheight) \
88 float player_multijump;
89 float player_jumpheight;
90 MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
92 /** called during player physics, allows adjusting the movement type used */
93 #define EV_PM_Physics(i, o) \
94 /**/ i(entity, __self) \
95 /**/ i(float, pm_maxspeed_mod) \
97 float pm_maxspeed_mod;
98 MUTATOR_HOOKABLE(PM_Physics, EV_PM_Physics);
100 /** called when a weapon model is about to be set, allows custom paths etc. */
101 #define EV_WeaponModel(i, o) \
102 /**/ i(string, weapon_model) \
103 /**/ i(string, weapon_model_output) \
104 /**/ o(string, weapon_model_output) \
107 string weapon_model_output;
108 MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);