1 #include "cl_status_effects.qh"
3 METHOD(StatusEffects, m_active, bool(StatusEffects this, entity actor))
5 if(!actor) return false;
6 TC(StatusEffects, this);
7 return (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
10 METHOD(StatusEffects, m_tick, void(StatusEffects this, entity actor))
12 if(this.m_hidden || autocvar__hud_configure)
15 float currentTime = bound(0, actor.statuseffect_time[this.m_id] - time, 99);
16 addPowerupItem(this.m_name, this.m_icon, this.m_color, currentTime, this.m_lifetime, (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_PERSISTENT));
19 MUTATOR_HOOKFUNCTION(status_effects, HUD_Powerups_add)
21 if(!g_statuseffects && !autocvar__hud_configure) return;
23 // NOTE: the passed entity may be null here if we're in configure mode
24 StatusEffects_tick(g_statuseffects);