]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/base.qh
Convert more calls
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / base.qh
index 8f22ef2f53acc90243347da560acd8d0e3f92e3d..2a9a48adba70d76f669f29f5646b34861d917935 100644 (file)
@@ -151,90 +151,118 @@ MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
 float frag_score;
 MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill);
 
+/** called when the match ends */
 MUTATOR_HOOKABLE(MatchEnd, EV_NO_ARGS);
-       // called when the match ends
 
-MUTATOR_HOOKABLE(GetTeamCount, EV_NO_ARGS);
-       // should adjust ret_float to contain the team count
-       // INPUT, OUTPUT:
-               float ret_float;
+/** should adjust ret_float to contain the team count */
+#define EV_GetTeamCount(i, o) \
+    /**/ i(float, ret_float) \
+    /**/ o(float, ret_float) \
+    /**/
+float ret_float;
+MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount);
 
-MUTATOR_HOOKABLE(SpectateCopy, EV_NO_ARGS);
-       // copies variables for spectating "other" to "self"
-       // INPUT:
-//             entity other;
+/** copies variables for spectating "other" to "self" */
+#define EV_SpectateCopy(i, o) \
+    /**/ i(entity, other) \
+    /**/ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy);
 
+/** returns 1 if throwing the current weapon shall not be allowed */
 MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon, EV_NO_ARGS);
-       // returns 1 if throwing the current weapon shall not be allowed
 
-MUTATOR_HOOKABLE(WeaponRateFactor, EV_NO_ARGS);
-       // allows changing attack rate
-       // INPUT, OUTPUT:
-               float weapon_rate;
+/** allows changing attack rate */
+#define EV_WeaponRateFactor(i, o) \
+    /**/ i(float, weapon_rate) \
+    /**/ o(float, weapon_rate) \
+    /**/
+float weapon_rate;
+MUTATOR_HOOKABLE(WeaponRateFactor, EV_WeaponRateFactor);
 
-MUTATOR_HOOKABLE(WeaponSpeedFactor, EV_NO_ARGS);
-       // allows changing weapon speed (projectiles mostly)
-       // INPUT, OUTPUT:
-               //float ret_float;
+/** allows changing weapon speed (projectiles mostly) */
+#define EV_WeaponSpeedFactor(i, o) \
+    /**/ i(float, ret_float) \
+    /**/ o(float, ret_float) \
+    /**/
+MUTATOR_HOOKABLE(WeaponSpeedFactor, EV_WeaponSpeedFactor);
 
+/** adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}} */
 MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS);
-       // adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}}
 
-MUTATOR_HOOKABLE(BuildMutatorsString, EV_NO_ARGS);
-       // appends ":mutatorname" to ret_string for logging
-       // INPUT, OUTPUT:
-               string ret_string;
+/** appends ":mutatorname" to ret_string for logging */
+#define EV_BuildMutatorsString(i, o) \
+    /**/ i(string, ret_string) \
+    /**/ o(string, ret_string) \
+    /**/
+string ret_string;
+MUTATOR_HOOKABLE(BuildMutatorsString, EV_BuildMutatorsString);
 
-MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_NO_ARGS);
-       // appends ", Mutator name" to ret_string for display
-       // INPUT, OUTPUT:
-//             string ret_string;
+/** appends ", Mutator name" to ret_string for display */
+#define EV_BuildMutatorsPrettyString(i, o) \
+    /**/ i(string, ret_string) \
+    /**/ o(string, ret_string) \
+    /**/
+MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
 
-MUTATOR_HOOKABLE(CustomizeWaypoint, EV_NO_ARGS);
-       // called every frame
-       // customizes the waypoint for spectators
-       // INPUT: self = waypoint, other = player, other.enemy = spectator
+/** called every frame. customizes the waypoint for spectators */
+#define EV_CustomizeWaypoint(i, o) \
+    /** waypoint */ i(entity, self) \
+    /** player; other.enemy = spectator */ i(entity, other) \
+    /**/
+MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
 
+/**
+ * checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
+ * return error to request removal
+ */
 MUTATOR_HOOKABLE(FilterItem, EV_NO_ARGS);
-       // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
-       // return error to request removal
 
-MUTATOR_HOOKABLE(TurretSpawn, EV_NO_ARGS);
-       // return error to request removal
-       // INPUT: self - turret
+/** return error to request removal */
+#define EV_TurretSpawn(i, o) \
+    /** turret */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
 
+/** return error to prevent entity spawn, or modify the entity */
 MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_NO_ARGS);
-       // return error to prevent entity spawn, or modify the entity
 
+/** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
 MUTATOR_HOOKABLE(PlayerPreThink, EV_NO_ARGS);
-       // runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators
 
+/** TODO change this into a general PlayerPostThink hook? */
 MUTATOR_HOOKABLE(GetPressedKeys, EV_NO_ARGS);
-       // TODO change this into a general PlayerPostThink hook?
 
+/**
+ * called before any player physics, may adjust variables for movement,
+ * is run AFTER bot code and idle checking
+ */
 MUTATOR_HOOKABLE(PlayerPhysics, EV_NO_ARGS);
-       // called before any player physics, may adjust variables for movement,
-       // is run AFTER bot code and idle checking
 
-MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS);
-       // is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client
-       // INPUT:
-               float get_cvars_f;
-               string get_cvars_s;
-
-MUTATOR_HOOKABLE(EditProjectile, EV_NO_ARGS);
-       // can edit any "just fired" projectile
-       // INPUT:
-//             entity self;
-//             entity other;
+/** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
+#define EV_GetCvars(i, o) \
+    /**/ i(float, get_cvars_f) \
+    /**/ i(string, get_cvars_s) \
+    /**/
+float get_cvars_f;
+string get_cvars_s;
+MUTATOR_HOOKABLE(GetCvars, EV_GetCvars);
+
+/** can edit any "just fired" projectile */
+#define EV_EditProjectile(i, o) \
+    /**/ i(entity, self) \
+    /**/ i(entity, other) \
+    /**/
+MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
 
+/** called when a monster spawns */
 MUTATOR_HOOKABLE(MonsterSpawn, EV_NO_ARGS);
-       // called when a monster spawns
 
-MUTATOR_HOOKABLE(MonsterDies, EV_NO_ARGS);
-       // called when a monster dies
-       // INPUT:
-//             entity frag_attacker;
+/** called when a monster dies */
+#define EV_MonsterDies(i, o) \
+    /**/ i(entity, frag_attacker) \
+    /**/
+MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
 
 MUTATOR_HOOKABLE(MonsterRespawn, EV_NO_ARGS);
        // called when a monster wants to respawn