Xonotic
sv_status_effects.qc File Reference
+ Include dependency graph for sv_status_effects.qc:

Go to the source code of this file.

Functions

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

Function Documentation

◆ MUTATOR_HOOKFUNCTION() [1/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
SV_StartFrame   
)

Definition at line 53 of file sv_status_effects.qc.

References g_damagedbycontents, and IL_EACH.

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 }
#define IL_EACH(this, cond, body)
IntrusiveList g_damagedbycontents
Definition: damage.qh:155

◆ MUTATOR_HOOKFUNCTION() [2/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
PlayerDies   
)

Definition at line 66 of file sv_status_effects.qc.

References entity(), M_ARGV, and STATUSEFFECT_REMOVE_NORMAL.

67 {
68  entity frag_target = M_ARGV(2, entity);
69 
70  StatusEffects_removeall(frag_target, STATUSEFFECT_REMOVE_NORMAL);
71 }
entity() spawn
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [3/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
ClientDisconnect   
)

Definition at line 73 of file sv_status_effects.qc.

References entity(), M_ARGV, and STATUSEFFECT_REMOVE_NORMAL.

74 {
75  entity player = M_ARGV(0, entity);
76 
77  StatusEffects_removeall(player, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
78  return true;
79 }
entity() spawn
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [4/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
MakePlayerObserver   
)

Definition at line 81 of file sv_status_effects.qc.

References entity(), M_ARGV, and STATUSEFFECT_REMOVE_NORMAL.

82 {
83  entity player = M_ARGV(0, entity);
84 
85  // no need to network updates, as there is no statuseffects object attached
86  StatusEffects_removeall(player, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
87  StatusEffects_clearall(player.statuseffects_store);
88 
89  // don't delete spectatee's effects!
90  if(player.statuseffects && player.statuseffects.owner == player)
91  StatusEffects_delete(player);
92 }
entity() spawn
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [5/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
reset_map_global   
)

Definition at line 94 of file sv_status_effects.qc.

References FOREACH_CLIENT, and IS_PLAYER.

95 {
96  FOREACH_CLIENT(IS_PLAYER(it) && it.statuseffects,
97  {
98  StatusEffects_removeall(it, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
99  StatusEffects_clearall(it.statuseffects);
100  StatusEffects_update(it);
101  });
102  return false;
103 }
#define FOREACH_CLIENT(cond, body)
Definition: utils.qh:49
#define IS_PLAYER(v)
Definition: utils.qh:9

◆ MUTATOR_HOOKFUNCTION() [6/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
SpectateCopy   
)

Definition at line 105 of file sv_status_effects.qc.

References entity(), and M_ARGV.

106 {
107  entity spectatee = M_ARGV(0, entity);
108  entity client = M_ARGV(1, entity);
109 
110  client.statuseffects = spectatee.statuseffects;
111 }
entity() spawn
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [7/7]

MUTATOR_HOOKFUNCTION ( status_effects  ,
PutClientInServer   
)

Definition at line 113 of file sv_status_effects.qc.

References entity(), M_ARGV, and NULL.

114 {
115  entity player = M_ARGV(0, entity);
116 
117  if(player.statuseffects && player.statuseffects.owner == player)
118  {
119  StatusEffects_clearall(player.statuseffects);
120  StatusEffects_update(player);
121  }
122  else
123  {
124  StatusEffects_clearall(player.statuseffects_store);
125  player.statuseffects = NULL;
126  }
127 }
entity() spawn
#define NULL
Definition: post.qh:17
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function: