1 #ifndef COMMON_MUTATORS_EVENTS_H
2 #define COMMON_MUTATORS_EVENTS_H
4 #define EV_NO_ARGS(i, o)
8 #define MUTATOR_TYPES(_, x) \
17 // TODO: migrate to arrays some day when no other globals are used
18 #define M_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)
24 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 3)
25 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 4)
26 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 5)
27 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 6)
28 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 7)
29 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 8)
30 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 9)
31 MUTATOR_TYPES(MUTATOR_NEWGLOBAL, 10)
34 #undef MUTATOR_NEWGLOBAL
38 /** appends ":mutatorname" to argument for logging */
39 #define EV_BuildMutatorsString(i, o) \
40 /** mutator string */ i(string, MUTATOR_ARGV_0_string) \
41 /**/ o(string, MUTATOR_ARGV_0_string) \
43 MUTATOR_HOOKABLE(BuildMutatorsString, EV_BuildMutatorsString);
45 /** appends ", Mutator name" to ret_string for display */
46 #define EV_BuildMutatorsPrettyString(i, o) \
47 /** mutator string */ i(string, MUTATOR_ARGV_0_string) \
48 /**/ o(string, MUTATOR_ARGV_0_string) \
50 MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
52 /** appends mutator string for displaying extra gameplay tips */
53 #define EV_BuildGameplayTipsString(i, o) \
54 /** tips string */ i(string, MUTATOR_ARGV_0_string) \
55 /**/ o(string, MUTATOR_ARGV_0_string) \
57 MUTATOR_HOOKABLE(BuildGameplayTipsString, EV_BuildGameplayTipsString);
59 #define EV_IsFlying(i, o) \
60 /**/ i(entity, MUTATOR_ARGV_0_entity) \
62 MUTATOR_HOOKABLE(IsFlying, EV_IsFlying);
64 #define EV_WP_Format(i, o) \
65 /**/ i(entity, MUTATOR_ARGV_0_entity) \
66 /**/ i(string, MUTATOR_ARGV_1_string) \
67 /**/ o(vector, MUTATOR_ARGV_2_vector) \
68 /**/ o(string, MUTATOR_ARGV_3_string) \
70 MUTATOR_HOOKABLE(WP_Format, EV_WP_Format);
73 * called before any player physics, may adjust variables for movement,
74 * is run AFTER bot code and idle checking on the server
76 #define EV_PlayerPhysics(i, o) \
77 /**/ i(entity, __self) \
79 MUTATOR_HOOKABLE(PlayerPhysics, EV_PlayerPhysics);
81 /** called when a player presses the jump key */
82 #define EV_PlayerJump(i, o) \
83 /**/ i(entity, __self) \
84 /**/ i(float, player_multijump) \
85 /**/ i(float, player_jumpheight) \
86 /**/ o(float, player_multijump) \
87 /**/ o(float, player_jumpheight) \
89 float player_multijump;
90 float player_jumpheight;
91 MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
93 /** called during player physics, allows adjusting the movement type used */
94 #define EV_PM_Physics(i, o) \
95 /**/ i(entity, __self) \
96 /**/ i(float, pm_maxspeed_mod) \
98 float pm_maxspeed_mod;
99 MUTATOR_HOOKABLE(PM_Physics, EV_PM_Physics);
101 /** called when a weapon model is about to be set, allows custom paths etc. */
102 #define EV_WeaponModel(i, o) \
103 /**/ i(string, weapon_model) \
104 /**/ i(string, weapon_model_output) \
105 /**/ o(string, weapon_model_output) \
108 string weapon_model_output;
109 MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);