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

Go to the source code of this file.

Functions

bool StatusEffects_active (StatusEffect this, entity actor)
void StatusEffects_apply (StatusEffect this, entity actor, float eff_time, int eff_flags)
void StatusEffects_copy (StatusEffect this, entity store, float time_offset)
float StatusEffects_gettime (StatusEffect this, entity actor)
void StatusEffects_remove (StatusEffect this, entity actor, int removal_type)
void StatusEffects_removeall (entity actor, int removal_type)
void StatusEffects_tick (entity actor)

Function Documentation

◆ StatusEffects_active()

◆ StatusEffects_apply()

void StatusEffects_apply ( StatusEffect this,
entity actor,
float eff_time,
int eff_flags )

Definition at line 31 of file status_effects.qc.

32{
33 if (!actor || eff_time <= time)
34 return;
35
36 this.m_apply(this, actor, eff_time, eff_flags);
37}
float time

References entity(), and time.

Referenced by buff_Disability_ApplyStunned(), buff_Touch(), Fire_AddDamage(), GiveBuff(), GiveItems(), GiveStatusEffect(), Item_GiveTo(), M_Mage_Defend_Shield(), Monster_Spawn(), nade_ice_freeze(), and PutPlayerInServer().

◆ StatusEffects_copy()

void StatusEffects_copy ( StatusEffect this,
entity store,
float time_offset )

Definition at line 39 of file status_effects.qc.

40{
41 if(!this || !store)
42 return;
43 FOREACH(StatusEffects, true,
44 {
45 if(time_offset)
46 store.statuseffect_time[it.m_id] = time + this.statuseffect_time[it.m_id] - time_offset;
47 else
48 store.statuseffect_time[it.m_id] = this.statuseffect_time[it.m_id];
49 store.statuseffect_flags[it.m_id] = this.statuseffect_flags[it.m_id];
50 });
51}
#define FOREACH(list, cond, body)
Definition iter.qh:19

References entity(), FOREACH, and time.

Referenced by CheatImpulse().

◆ StatusEffects_gettime()

float StatusEffects_gettime ( StatusEffect this,
entity actor )

Definition at line 17 of file status_effects.qc.

18{
19 entity store = actor;
20#ifdef SVQC
21 store = actor.statuseffects;
22#endif
23 if(!store) return 0;
24 float eff_time = store.statuseffect_time[this.m_id];
25 // if effect end time has passed and m_tick hasn't removed the effect yet
26 // return current time since the effect is actually still active in this frame
27 return (eff_time < time ? time : eff_time);
28}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int m_id
Definition effect.qh:19

References entity(), m_id, and time.

Referenced by Fire_AddDamage(), Fire_ApplyDamage(), GiveBuff(), GiveStatusEffect(), havocbot_goalrating_enemyplayers(), Item_GiveTo(), MUTATOR_HOOKFUNCTION(), player_powerups(), powerups_DropItem(), and W_ThrowNewWeapon().

◆ StatusEffects_remove()

void StatusEffects_remove ( StatusEffect this,
entity actor,
int removal_type )

Definition at line 53 of file status_effects.qc.

54{
55 this.m_remove(this, actor, removal_type);
56}

References entity().

Referenced by Damage(), GiveBuff(), GiveStatusEffect(), invasion_SpawnChosenMonster(), player_powerups(), W_ThrowNewWeapon(), and weapon_prepareattack_do().

◆ StatusEffects_removeall()

void StatusEffects_removeall ( entity actor,
int removal_type )

Definition at line 58 of file status_effects.qc.

59{
60 if(!actor.statuseffects)
61 return;
62 FOREACH(StatusEffects, true,
63 {
64 it.m_remove(it, actor, removal_type);
65 });
66}

References entity(), and FOREACH.

Referenced by ctf_Handle_Pickup(), ctf_RespawnFlag(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().

◆ StatusEffects_tick()

void StatusEffects_tick ( entity actor)

Definition at line 9 of file status_effects.qc.

10{
11 FOREACH(StatusEffects, it.m_active(it, actor),
12 {
13 it.m_tick(it, actor);
14 });
15}

References entity(), and FOREACH.

Referenced by MUTATOR_HOOKFUNCTION().