X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fevents.qh;h=a4cf9df8ef30cc5e6554f4403112a28723a07e84;hp=240f8fc25fac301033bee840e7bfcd1ce8cd0198;hb=5453f53da1df88742c11c71e4dc5b9c3e3d24c62;hpb=821767330613f134fe04791532f44e63741ee6c6 diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 240f8fc25..a4cf9df8e 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -27,6 +27,12 @@ MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer); /**/ MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn); +/** returns true if client should be put as player on connection */ +#define EV_AutoJoinOnConnection(i, o) \ + /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(AutoJoinOnConnection, EV_AutoJoinOnConnection); + /** called when player spawns to determine whether to give them random start weapons. Return true to forbid giving them. */ #define EV_ForbidRandomStartWeapons(i, o) \ /** player */ i(entity, MUTATOR_ARGV_0_entity) \ @@ -123,6 +129,8 @@ MUTATOR_HOOKABLE(ItemSound, EV_ItemSound); /** target */ i(entity, MUTATOR_ARGV_1_entity) \ /** frag score */ i(float, MUTATOR_ARGV_2_float) \ /** */ o(float, MUTATOR_ARGV_2_float) \ + /** deathtype */ i(float, MUTATOR_ARGV_3_float) \ + /** wep entity */ i(entity, MUTATOR_ARGV_4_entity) \ /**/ MUTATOR_HOOKABLE(GiveFragsForKill, EV_GiveFragsForKill); @@ -241,7 +249,7 @@ MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint); MUTATOR_HOOKABLE(FilterItemDefinition, EV_FilterItemDefinition); /** - * checks if the current item may be spawned (.items and .weapons may be read and written to, as well as the ammo_ fields) + * checks if the current item may be spawned (.items may be read and written to, as well as the ammo_ fields) * return error to request removal */ #define EV_FilterItem(i, o) \ @@ -411,7 +419,8 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor /** mirrordamage */ i(float, MUTATOR_ARGV_5_float) \ /** mirrordamage */ o(float, MUTATOR_ARGV_5_float) \ /** force */ i(vector, MUTATOR_ARGV_6_vector) \ - /** force */ o(vector, MUTATOR_ARGV_6_vector) \ + /** force */ o(vector, MUTATOR_ARGV_6_vector) \ + /** weapon entity */ i(entity, MUTATOR_ARGV_7_entity) \ /**/ MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate); @@ -736,6 +745,30 @@ RESOURCE_* constants for resource types. Return true to forbid giving. */ /**/ MUTATOR_HOOKABLE(GiveResourceWithLimit, EV_GiveResourceWithLimit); +/** Called when some resource is being taken from an entity. See RESOURCE_* constants +for resource types. Return true to forbid giving. */ +#define EV_TakeResource(i, o) \ + /** receiver */ i(entity, MUTATOR_ARGV_0_entity) \ + /** resource type */ i(int, MUTATOR_ARGV_1_int) \ + /**/ o(int, MUTATOR_ARGV_1_int) \ + /** amount */ i(float, MUTATOR_ARGV_2_float) \ + /**/ o(float, MUTATOR_ARGV_2_float) \ + /**/ +MUTATOR_HOOKABLE(TakeResource, EV_TakeResource); + +/** Called when some resource is being taken from an entity, with a limit. See +RESOURCE_* constants for resource types. Return true to forbid giving. */ +#define EV_TakeResourceWithLimit(i, o) \ + /** receiver */ i(entity, MUTATOR_ARGV_0_entity) \ + /** resource type */ i(int, MUTATOR_ARGV_1_int) \ + /**/ o(int, MUTATOR_ARGV_1_int) \ + /** amount */ i(float, MUTATOR_ARGV_2_float) \ + /**/ o(float, MUTATOR_ARGV_2_float) \ + /** limit */ i(float, MUTATOR_ARGV_3_float) \ + /**/ o(float, MUTATOR_ARGV_3_float) \ + /**/ +MUTATOR_HOOKABLE(TakeResourceWithLimit, EV_TakeResourceWithLimit); + /** called at when a player connect */ #define EV_ClientConnect(i, o) \ /** player */ i(entity, MUTATOR_ARGV_0_entity) \ @@ -1141,3 +1174,21 @@ enum { MUT_VOTEPARSE_INVALID, // return -1 (vote parsed but counted as invalid, no action or vote) MUT_VOTEPARSE_UNACCEPTABLE // return 0 (vote parameter counted as unacceptable, warns caller) }; + +/** + * Called when freezing an entity (monster or player), return true to force showing a waypoint + */ +#define EV_Freeze(i, o) \ + /** targ */ i(entity, MUTATOR_ARGV_0_entity) \ + /** revive speed */ i(float, MUTATOR_ARGV_1_float) \ + /** frozen type */ i(int, MUTATOR_ARGV_2_int) \ + /**/ +MUTATOR_HOOKABLE(Freeze, EV_Freeze); + +/** + * Called when an entity (monster or player) is defrosted + */ +#define EV_Unfreeze(i, o) \ + /** targ */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(Unfreeze, EV_Unfreeze);