Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
status_effects.qc
Go to the documentation of this file.
1#include "status_effects.qh"
2
3#ifdef GAMEQC
5{
6 return this.m_active(this, actor);
7}
8
10{
11 FOREACH(StatusEffects, it.m_active(it, actor),
12 {
13 it.m_tick(it, actor);
14 });
15}
16
18{
19 entity store = actor;
20#ifdef SVQC
21 store = actor.statuseffects;
22#endif
23 if(!StatusEffects_active(this, actor))
24 return 0;
25 return store.statuseffect_time[this.m_id];
26}
27#endif
28#ifdef SVQC
29void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
30{
31 if (!actor || eff_time <= time)
32 return;
33
34 this.m_apply(this, actor, eff_time, eff_flags);
35}
36
37void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
38{
39 if(!this || !store)
40 return;
41 FOREACH(StatusEffects, true,
42 {
43 if(time_offset)
44 store.statuseffect_time[it.m_id] = time + this.statuseffect_time[it.m_id] - time_offset;
45 else
46 store.statuseffect_time[it.m_id] = this.statuseffect_time[it.m_id];
47 store.statuseffect_flags[it.m_id] = this.statuseffect_flags[it.m_id];
48 });
49}
50
51void StatusEffects_remove(StatusEffect this, entity actor, int removal_type)
52{
53 this.m_remove(this, actor, removal_type);
54}
55
56void StatusEffects_removeall(entity actor, int removal_type)
57{
58 if(!actor.statuseffects)
59 return;
60 FOREACH(StatusEffects, true,
61 {
62 it.m_remove(it, actor, removal_type);
63 });
64}
65#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float time
int m_id
Definition effect.qh:18
#define FOREACH(list, cond, body)
Definition iter.qh:19
void StatusEffects_removeall(entity actor, int removal_type)
void StatusEffects_remove(StatusEffect this, entity actor, int removal_type)
void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
float StatusEffects_gettime(StatusEffect this, entity actor)
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
void StatusEffects_tick(entity actor)