]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/status_effects/status_effect/superweapons.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / status_effects / status_effect / superweapons.qc
1 #include "superweapons.qh"
2
3 #ifdef CSQC
4 METHOD(Superweapons, m_active, bool(StatusEffects this, entity actor))
5 {
6     if(autocvar__hud_configure)
7         return true;
8     return SUPER(Superweapons).m_active(this, actor);
9 }
10 METHOD(Superweapons, m_tick, void(StatusEffects this, entity actor))
11 {
12     if(this.m_hidden)
13         return;
14
15     int allItems = STAT(ITEMS);
16
17     // Prevent stuff to show up on mismatch that will be fixed next frame
18     if(!(allItems & IT_SUPERWEAPON) && !autocvar__hud_configure)
19         return;
20
21     if(allItems & IT_UNLIMITED_SUPERWEAPONS)
22         return;
23
24     float currentTime = (autocvar__hud_configure) ? 13 : bound(0, actor.statuseffect_time[this.m_id] - time, 99);
25     addPowerupItem(this.m_name, this.m_icon, autocvar_hud_progressbar_superweapons_color, currentTime, this.m_lifetime, (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_PERSISTENT));
26 }
27 #endif