X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fevents.qh;h=881938f06809030eb83eb4c28aa10241de785165;hb=047e80d3190ef626c6029a655677ff1a08e66e3a;hp=71542d543646272a29184fefad9194f175e475f3;hpb=b13f0907bb1f099662521558e8af590faf4984a8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 71542d543..881938f06 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -12,7 +12,7 @@ MUTATOR_HOOKABLE(MakePlayerObserver, EV_MakePlayerObserver) /** */ #define EV_PutClientInServer(i, o) \ - /** client wanting to spawn */ i(entity, self) \ + /** client wanting to spawn */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer); @@ -106,6 +106,7 @@ MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump); /** called when someone was fragged by "self", and is expected to change frag_score to adjust scoring for the kill */ #define EV_GiveFragsForKill(i, o) \ + /**/ i(entity, __self) \ /** same as self */ i(entity, frag_attacker) \ /**/ i(entity, frag_target) \ /**/ i(float, frag_score) \ @@ -128,7 +129,7 @@ MUTATOR_HOOKABLE(GetTeamCount, EV_GetTeamCount); /** copies variables for spectating "other" to "self" */ #define EV_SpectateCopy(i, o) \ /**/ i(entity, other) \ - /**/ i(entity, self) \ + /**/ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy); @@ -137,9 +138,11 @@ MUTATOR_HOOKABLE(SpectateCopy, EV_SpectateCopy); /**/ i(string, format_escape) \ /**/ i(string, format_replacement) \ /**/ o(string, format_replacement) \ + /**/ i(string, format_message) \ /**/ string format_escape; string format_replacement; +string format_message; MUTATOR_HOOKABLE(FormatMessage, EV_FormatMessage); /** returns 1 if throwing the current weapon shall not be allowed */ @@ -165,7 +168,7 @@ MUTATOR_HOOKABLE(SetStartItems, EV_NO_ARGS); /** called every frame. customizes the waypoint for spectators */ #define EV_CustomizeWaypoint(i, o) \ - /** waypoint */ i(entity, self) \ + /** waypoint */ i(entity, __self) \ /** player; other.enemy = spectator */ i(entity, other) \ /**/ MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint); @@ -178,10 +181,24 @@ MUTATOR_HOOKABLE(FilterItem, EV_NO_ARGS); /** return error to request removal */ #define EV_TurretSpawn(i, o) \ - /** turret */ i(entity, self) \ + /** turret */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn); +/** return error to not attack */ +#define EV_TurretFire(i, o) \ + /** turret */ i(entity, __self) \ + /**/ +MUTATOR_HOOKABLE(TurretFire, EV_TurretFire); + +/** return error to not attack */ +#define EV_Turret_CheckFire(i, o) \ + /**/ i(bool, ret_bool) \ + /**/ o(bool, ret_bool) \ + /**/ +bool ret_bool; +MUTATOR_HOOKABLE(Turret_CheckFire, EV_Turret_CheckFire); + /** return error to prevent entity spawn, or modify the entity */ MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_NO_ARGS); @@ -208,7 +225,7 @@ MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS); // NOTE: Can't use EV_GetCvars because o /** can edit any "just fired" projectile */ #define EV_EditProjectile(i, o) \ - /**/ i(entity, self) \ + /**/ i(entity, __self) \ /**/ i(entity, other) \ /**/ MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile); @@ -222,6 +239,13 @@ MUTATOR_HOOKABLE(MonsterSpawn, EV_NO_ARGS); /**/ MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies); +/** called when a monster dies */ +#define EV_MonsterRemove(i, o) \ + /**/ i(entity, rem_mon) \ + /**/ +entity rem_mon; // avoiding ovewriting self & other +MUTATOR_HOOKABLE(MonsterRemove, EV_MonsterRemove); + /** called when a monster wants to respawn */ #define EV_MonsterRespawn(i, o) \ /**/ i(entity, other) \ @@ -285,6 +309,7 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor * i'm not sure if I should change this around slightly (Naming of the entities, and also how they're done in g_damage). */ #define EV_PlayerDamage_Calculate(i, o) \ + /**/ i(entity, frag_inflictor) \ /**/ i(entity, frag_attacker) \ /**/ i(entity, frag_target) \ /**/ i(float, frag_deathtype) \ @@ -314,7 +339,7 @@ MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged); /** called at the end of player_powerups() in cl_client.qc, used for manipulating the values which are set by powerup items. */ #define EV_PlayerPowerups(i, o) \ - /**/ i(entity, self) \ + /**/ i(entity, __self) \ /**/ i(int, olditems) \ /**/ int olditems; @@ -324,21 +349,17 @@ MUTATOR_HOOKABLE(PlayerPowerups, EV_PlayerPowerups); * called every player think frame * return 1 to disable regen */ -#define EV_PlayerRegen(i, o) \ - /**/ i(float, regen_mod_max) \ - /**/ o(float, regen_mod_max) \ - /**/ i(float, regen_mod_regen) \ - /**/ o(float, regen_mod_regen) \ - /**/ i(float, regen_mod_rot) \ - /**/ o(float, regen_mod_rot) \ - /**/ i(float, regen_mod_limit) \ - /**/ o(float, regen_mod_limit) \ - /**/ float regen_mod_max; float regen_mod_regen; float regen_mod_rot; float regen_mod_limit; -MUTATOR_HOOKABLE(PlayerRegen, EV_PlayerRegen); +float regen_health; +float regen_health_linear; +float regen_health_rot; +float regen_health_rotlinear; +float regen_health_stable; +float regen_health_rotstable; +MUTATOR_HOOKABLE(PlayerRegen, EV_NO_ARGS); /** * called when the use key is pressed @@ -380,12 +401,23 @@ int cmd_argc; string cmd_string; MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand); +/** please read EV_SV_ParseClientCommand description before using */ +#define EV_SV_ParseServerCommand(i, o) \ + /** command name */ i(string, cmd_name) \ + /** also, argv() can be used */ i(int, cmd_argc) \ + /** whole command, use only if you really have to */ i(string, cmd_string) \ + /**/ +//string cmd_name; +//int cmd_argc; +//string cmd_string; +MUTATOR_HOOKABLE(SV_ParseServerCommand, EV_SV_ParseServerCommand); + /** * called when a spawnpoint is being evaluated * return 1 to make the spawnpoint unusable */ #define EV_Spawn_Score(i, o) \ - /** player wanting to spawn */ i(entity, self) \ + /** player wanting to spawn */ i(entity, __self) \ /** spot to be evaluated */ i(entity, spawn_spot) \ /** _x is priority, _y is "distance" */ i(vector, spawn_score) \ /**/ o(vector, spawn_score) \ @@ -407,12 +439,12 @@ MUTATOR_HOOKABLE(SetModname, EV_SetModname); * return 1 to remove an item */ #define EV_Item_Spawn(i, o) \ - /** the item */ i(entity, self) \ + /** the item */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(Item_Spawn, EV_Item_Spawn); #define EV_SetWeaponreplace(i, o) \ - /** map entity */ i(entity, self) \ + /** map entity */ i(entity, __self) \ /** weapon info */ i(entity, other) \ /**/ i(string, ret_string) \ /**/ o(string, ret_string) \ @@ -442,7 +474,7 @@ MUTATOR_HOOKABLE(BotShouldAttack, EV_BotShouldAttack); * allows you to strip a player of an item if they go through the teleporter to help prevent cheating */ #define EV_PortalTeleport(i, o) \ - /**/ i(entity, self) \ + /**/ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport); @@ -453,7 +485,7 @@ MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport); * in a special manner using this hook */ #define EV_HelpMePing(i, o) \ - /** the player who pressed impulse 33 */ i(entity, self) \ + /** the player who pressed impulse 33 */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(HelpMePing, EV_HelpMePing); @@ -480,7 +512,7 @@ MUTATOR_HOOKABLE(VehicleEnter, EV_VehicleEnter); * return true to stop player from entering the vehicle */ #define EV_VehicleTouch(i, o) \ - /** vehicle */ i(entity, self) \ + /** vehicle */ i(entity, __self) \ /** player */ i(entity, other) \ /**/ MUTATOR_HOOKABLE(VehicleTouch, EV_VehicleTouch); @@ -497,13 +529,13 @@ MUTATOR_HOOKABLE(VehicleExit, EV_VehicleExit); /** called when a speedrun is aborted and the player is teleported back to start position */ #define EV_AbortSpeedrun(i, o) \ - /** player */ i(entity, self) \ + /** player */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(AbortSpeedrun, EV_AbortSpeedrun); /** called at when a item is touched. Called early, can edit item properties. */ #define EV_ItemTouch(i, o) \ - /** item */ i(entity, self) \ + /** item */ i(entity, __self) \ /** player */ i(entity, other) \ /**/ MUTATOR_HOOKABLE(ItemTouch, EV_ItemTouch); @@ -516,12 +548,12 @@ enum { /** called at when a player connect */ #define EV_ClientConnect(i, o) \ - /** player */ i(entity, self) \ + /** player */ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(ClientConnect, EV_ClientConnect); #define EV_HavocBot_ChooseRole(i, o) \ - /**/ i(entity, self) \ + /**/ i(entity, __self) \ /**/ MUTATOR_HOOKABLE(HavocBot_ChooseRole, EV_HavocBot_ChooseRole); @@ -536,4 +568,71 @@ enum { MUT_ACCADD_INVALID, // return this flag to make the function always continue MUT_ACCADD_INDIFFERENT // return this flag to make the function always return }; + +/** Called when clearing the global parameters for a model */ +MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS); + +/** Called when getting the global parameters for a model */ +#define EV_GetModelParams(i, o) \ + /** entity id */ i(string, checkmodel_input) \ + /** entity id */ i(string, checkmodel_command) \ + /**/ +string checkmodel_input, checkmodel_command; +MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams); + +/** called when a bullet has hit a target */ +#define EV_FireBullet_Hit(i, o) \ + /**/ i(entity, __self) \ + /**/ i(entity, bullet_hit) \ + /**/ i(vector, bullet_startpos) \ + /**/ i(vector, bullet_endpos) \ + /**/ i(float, frag_damage) \ + /**/ o(float, frag_damage) \ + /**/ +entity bullet_hit; +//vector bullet_hitloc; // the end pos matches the hit location, apparently +vector bullet_startpos; +vector bullet_endpos; +//float frag_damage; +MUTATOR_HOOKABLE(FireBullet_Hit, EV_FireBullet_Hit); + +#define EV_FixPlayermodel(i, o) \ + /**/ i(string, ret_string) \ + /**/ o(string, ret_string) \ + /**/ i(int, ret_int) \ + /**/ o(int, ret_int) \ + /**/ +int ret_int; +MUTATOR_HOOKABLE(FixPlayermodel, EV_FixPlayermodel); + +/** Return error to play frag remaining announcements */ +MUTATOR_HOOKABLE(Scores_CountFragsRemaining, EV_NO_ARGS); + +#define EV_GrappleHookThink(i, o) \ + /**/ i(entity, __self) \ + /**/ i(int, hook_tarzan) \ + /**/ o(int, hook_tarzan) \ + /**/ i(entity, hook_pullentity) \ + /**/ o(entity, hook_pullentity) \ + /**/ i(float, hook_velmultiplier) \ + /**/ o(float, hook_velmultiplier) \ + /**/ +int hook_tarzan; +entity hook_pullentity; +float hook_velmultiplier; +MUTATOR_HOOKABLE(GrappleHookThink, EV_GrappleHookThink); + +#define EV_BuffModel_Customize(i, o) \ + /**/ i(entity, __self) \ + /**/ i(entity, buff_player) \ + /**/ +entity buff_player; +MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize); + +/** called at when a buff is touched. Called early, can edit buff properties. */ +#define EV_BuffTouch(i, o) \ + /** item */ i(entity, __self) \ + /** player */ i(entity, other) \ + /**/ +MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch); #endif