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 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
78 /** ticrate*/ i(float, MUTATOR_ARGV_1_float) \
80 MUTATOR_HOOKABLE(PlayerPhysics, EV_PlayerPhysics);
82 /** called when a player presses the jump key */
83 #define EV_PlayerJump(i, o) \
84 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
85 /** jump height */ i(float, MUTATOR_ARGV_1_float) \
86 /**/ o(float, MUTATOR_ARGV_1_float) \
87 /** multijump */ i(bool, MUTATOR_ARGV_2_bool) \
88 /**/ o(bool, MUTATOR_ARGV_2_bool) \
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 /** player */ i(entity, MUTATOR_ARGV_0_entity) \
95 /** maxspeed_mod */ i(float, MUTATOR_ARGV_1_float) \
96 /** tick rate */ i(float, MUTATOR_ARGV_2_float) \
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 /** model */ i(string, MUTATOR_ARGV_0_string) \
103 /** output */ i(string, MUTATOR_ARGV_1_string) \
104 /**/ o(string, MUTATOR_ARGV_1_string) \
106 MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);