X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fbase.qh;h=893ebb301ff439ffbed18757f6da29cc95cf92b8;hb=3df4becf0c2766d0ca530b53019907a79bc44b75;hp=d74201f976f9445a56e4da5a98599f9d227a4999;hpb=a64d8a6a5b0a3ed53934ee72229c64112233db5a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/base.qh b/qcsrc/server/mutators/base.qh index d74201f97..893ebb301 100644 --- a/qcsrc/server/mutators/base.qh +++ b/qcsrc/server/mutators/base.qh @@ -46,10 +46,22 @@ void Mutator_Remove(mutatorfunc_t func, string name); // calls error() on fail MUTATOR_HOOKABLE(MakePlayerObserver); // called when a player becomes observer, after shared setup +MUTATOR_HOOKABLE(PutClientInServer); + entity self; // client wanting to spawn + MUTATOR_HOOKABLE(PlayerSpawn); entity spawn_spot; // spot that was used, or world // called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) +MUTATOR_HOOKABLE(reset_map_global); + // called in reset_map + +MUTATOR_HOOKABLE(reset_map_players); + // called in reset_map + +MUTATOR_HOOKABLE(ForbidPlayerScore_Clear); + // returns 1 if clearing player score shall not be allowed + MUTATOR_HOOKABLE(ClientDisconnect); // called when a player disconnects @@ -59,6 +71,12 @@ MUTATOR_HOOKABLE(PlayerDies); entity frag_inflictor; entity frag_attacker; entity frag_target; // same as self + float frag_deathtype; + +MUTATOR_HOOKABLE(PlayerJump); + // called when a player presses the jump key + // INPUT, OUTPUT: + float player_multijump; MUTATOR_HOOKABLE(GiveFragsForKill); // called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill @@ -97,6 +115,11 @@ MUTATOR_HOOKABLE(BuildMutatorsPrettyString); // INPUT, OUTPUT: string ret_string; +MUTATOR_HOOKABLE(CustomizeWaypoint); + // called every frame + // customizes the waypoint for spectators + // INPUT: self = waypoint, other = player, other.enemy = spectator + MUTATOR_HOOKABLE(FilterItem); // 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 @@ -104,7 +127,7 @@ MUTATOR_HOOKABLE(FilterItem); MUTATOR_HOOKABLE(TurretSpawn); // return error to request removal // INPUT: self - turret - + MUTATOR_HOOKABLE(OnEntityPreSpawn); // return error to prevent entity spawn, or modify the entity @@ -140,7 +163,7 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor); // INPUT, OUTPUT: float damage_take; float damage_save; - + MUTATOR_HOOKABLE(PlayerDamage_Calculate); // called to adjust damage and force values which are applied to the player, used for e.g. strength damage/force multiplier // i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage). @@ -157,7 +180,7 @@ MUTATOR_HOOKABLE(PlayerPowerups); // called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items. // INPUT entity self; - float olditems; // also technically output, but since it is at the end of the function it's useless for that :P + float olditems; // also technically output, but since it is at the end of the function it's useless for that :P MUTATOR_HOOKABLE(PlayerUseKey); // called when the use key is pressed @@ -208,7 +231,7 @@ MUTATOR_HOOKABLE(SV_StartFrame); MUTATOR_HOOKABLE(SetModname); // OUT string modname; // name of the mutator/mod if it warrants showing as such in the server browser - + MUTATOR_HOOKABLE(Item_Spawn); // called for each item being spawned on a map, including dropped weapons // return 1 to remove an item @@ -221,19 +244,13 @@ MUTATOR_HOOKABLE(SetWeaponreplace); entity other; // weapon info // IN+OUT string ret_string; - + MUTATOR_HOOKABLE(Item_RespawnCountdown); // called when an item is about to respawn // INPUT+OUTPUT: string item_name; vector item_color; - -MUTATOR_HOOKABLE(Item_GiveTo); - // called when an item is given to a player - entity giveitem; - float player_wswitch; - float player_pickedup; - + MUTATOR_HOOKABLE(BotShouldAttack); // called when a bot checks a target to attack // INPUT @@ -244,7 +261,7 @@ MUTATOR_HOOKABLE(PortalTeleport); // allows you to strip a player of an item if they go through the teleporter to help prevent cheating // INPUT entity self; - + MUTATOR_HOOKABLE(HelpMePing); // called whenever a player uses impulse 33 (help me) in cl_impulse.qc // normally help me ping uses self.waypointsprite_attachedforcarrier, @@ -252,21 +269,32 @@ MUTATOR_HOOKABLE(HelpMePing); // in a special manner using this hook // INPUT entity self; // the player who pressed impulse 33 - + +MUTATOR_HOOKABLE(VehicleSpawn); + // called when a vehicle initializes + // return TRUE to remove the vehicle + MUTATOR_HOOKABLE(VehicleEnter); // called when a player enters a vehicle // allows mutators to set special settings in this event // INPUT entity vh_player; // player entity vh_vehicle; // vehicle - + +MUTATOR_HOOKABLE(VehicleTouch); + // called when a player touches a vehicle + // return TRUE to stop player from entering the vehicle + // INPUT + entity self; // vehicle + entity other; // player + MUTATOR_HOOKABLE(VehicleExit); // called when a player exits a vehicle // allows mutators to set special settings in this event // INPUT entity vh_player; // player entity vh_vehicle; // vehicle - + MUTATOR_HOOKABLE(AbortSpeedrun); // called when a speedrun is aborted and the player is teleported back to start position // INPUT @@ -276,6 +304,9 @@ MUTATOR_HOOKABLE(ItemTouch); // called at when a item is touched. Called early, can edit item properties. entity self; // item entity other; // player + #define MUT_ITEMTOUCH_CONTINUE 0 // return this flag to make the function continue as normal + #define MUT_ITEMTOUCH_RETURN 1 // return this flag to make the function return (handled entirely by mutator) + #define MUT_ITEMTOUCH_PICKUP 2 // return this flag to have the item "picked up" and taken even after mutator handled it MUTATOR_HOOKABLE(ClientConnect); // called at when a player connect