Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_status_effects.qc File Reference
Include dependency graph for sv_status_effects.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (status_effects, ClientDisconnect)
 MUTATOR_HOOKFUNCTION (status_effects, MakePlayerObserver)
 MUTATOR_HOOKFUNCTION (status_effects, MonsterDies)
 MUTATOR_HOOKFUNCTION (status_effects, PlayerDies)
 MUTATOR_HOOKFUNCTION (status_effects, PutClientInServer)
 MUTATOR_HOOKFUNCTION (status_effects, reset_map_global)
 MUTATOR_HOOKFUNCTION (status_effects, SpectateCopy)
 MUTATOR_HOOKFUNCTION (status_effects, SV_StartFrame)

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
ClientDisconnect  )

Definition at line 80 of file sv_status_effects.qc.

81{
82 entity player = M_ARGV(0, entity);
83
84 // don't delete possible spectatee's effects!
85 if(player.statuseffects && player.statuseffects.owner == player)
86 {
87 // just to get rid of the pickup sound
89 }
90
91 return true;
92}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
Definition all.qh:28
void StatusEffects_removeall(entity actor, int removal_type)

References ClientDisconnect, entity(), M_ARGV, STATUSEFFECT_REMOVE_NORMAL, and StatusEffects_removeall().

◆ MUTATOR_HOOKFUNCTION() [2/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
MakePlayerObserver  )

Definition at line 94 of file sv_status_effects.qc.

95{
96 entity player = M_ARGV(0, entity);
97
98 // don't delete spectatee's effects!
99 if(player.statuseffects && player.statuseffects.owner == player)
100 {
101 // just to get rid of the pickup sound
102 // no need to network updates, as there is no statuseffects object attached
104 }
105
106 // spectator has their own ent
107 StatusEffects_clearall(player.statuseffects_store);
108
109 // don't delete spectatee's effects!
110 if(player.statuseffects && player.statuseffects.owner == player)
111 StatusEffects_delete(player);
112}
void StatusEffects_delete(entity e)
void StatusEffects_clearall(entity store)

References entity(), M_ARGV, STATUSEFFECT_REMOVE_NORMAL, StatusEffects_clearall(), StatusEffects_delete(), and StatusEffects_removeall().

◆ MUTATOR_HOOKFUNCTION() [3/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
MonsterDies  )

◆ MUTATOR_HOOKFUNCTION() [4/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
PlayerDies  )

◆ MUTATOR_HOOKFUNCTION() [5/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
PutClientInServer  )

Definition at line 133 of file sv_status_effects.qc.

134{
135 entity player = M_ARGV(0, entity);
136
137 if(player.statuseffects && player.statuseffects.owner == player)
138 {
139 StatusEffects_clearall(player.statuseffects);
140 StatusEffects_update(player);
141 }
142 else
143 {
144 StatusEffects_clearall(player.statuseffects_store);
145 player.statuseffects = NULL;
146 }
147}
#define NULL
Definition post.qh:14
void StatusEffects_update(entity e)

References entity(), M_ARGV, NULL, PutClientInServer, StatusEffects_clearall(), and StatusEffects_update().

◆ MUTATOR_HOOKFUNCTION() [6/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
reset_map_global  )

Definition at line 114 of file sv_status_effects.qc.

115{
116 FOREACH_CLIENT(IS_PLAYER(it) && it.statuseffects,
117 {
118 StatusEffects_removeall(it, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
119 StatusEffects_clearall(it.statuseffects);
120 StatusEffects_update(it);
121 });
122 return false;
123}
#define IS_PLAYER(s)
Definition player.qh:243
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50

References FOREACH_CLIENT, and IS_PLAYER.

◆ MUTATOR_HOOKFUNCTION() [7/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
SpectateCopy  )

Definition at line 125 of file sv_status_effects.qc.

126{
127 entity spectatee = M_ARGV(0, entity);
128 entity client = M_ARGV(1, entity);
129
130 client.statuseffects = spectatee.statuseffects;
131}

References entity(), M_ARGV, and SpectateCopy().

◆ MUTATOR_HOOKFUNCTION() [8/8]

MUTATOR_HOOKFUNCTION ( status_effects ,
SV_StartFrame  )

Definition at line 53 of file sv_status_effects.qc.

54{
55 if(game_stopped)
56 return;
57 // TODO: explicitly only loop through entities with a valid statuseffects object
58 // NOTE: due to the way vehicles work currently, this does not function correctly! effect does not tick while inside a vehicle
59 IL_EACH(g_damagedbycontents, it.damagedbycontents,
60 {
61 if (it.move_movetype == MOVETYPE_NOCLIP || !it.statuseffects) continue;
62 StatusEffects_tick(it);
63 });
64}
float game_stopped
Definition stats.qh:81
IntrusiveList g_damagedbycontents
Definition damage.qh:135
#define IL_EACH(this, cond, body)

References g_damagedbycontents, game_stopped, and IL_EACH.