Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
cl_status_effects.qc
Go to the documentation of this file.
2
4{
5 // TODO: allow per-entity status effects on the client side
6 actor = g_statuseffects;
7
8 if(!actor) return false;
9 TC(StatusEffect, this);
10 return (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
11}
12
14{
16 return;
17
18 float currentTime = bound(0, actor.statuseffect_time[this.m_id] - time, 99);
19 addPowerupItem(this.m_name, this.m_icon, this.m_color, currentTime, this.m_lifetime, (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_PERSISTENT));
20}
21
22MUTATOR_HOOKFUNCTION(status_effects, HUD_Powerups_add)
23{
25
26 // NOTE: the passed entity may be null here if we're in configure mode
28}
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:335
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
bool m_hidden
Whether the effect is displayed in the HUD.
Definition all.qh:39
virtual void m_active()
virtual void m_tick()
float m_lifetime
Lifetime scale for HUD progress bars.
Definition all.qh:41
vector m_color
Definition all.qh:37
void addPowerupItem(string name, string icon, vector color, float currentTime, float lifeTime, bool isInfinite)
Definition powerups.qc:38
string m_name
Definition scores.qh:142
float time
bool autocvar__hud_configure
Definition hud_config.qh:3
#define TC(T, sym)
Definition _all.inc:82
float bound(float min, float value, float max)
@ STATUSEFFECT_FLAG_PERSISTENT
Effect is currently being granted passively.
Definition all.qh:23
@ STATUSEFFECT_FLAG_ACTIVE
Definition all.qh:22
#define METHOD(cname, name, prototype)
Definition oo.qh:269
void StatusEffects_tick(entity actor)
StatusEffect g_statuseffects