* rename Superweapons class to Superweapon because class names should always be singular
* rename StatusEffects class to StatusEffect because class names should always be singular
* rename StatusEffect registry to StatusEffects because registry names should always be plural
* rename Powerup class child of StatusEffect to PowerupStatusEffect so to remove ambiguity
with Powerup child of Pickup
// edge detection postprocess handling done second (used by hud_powerup)
float sharpen_intensity = 0;
- FOREACH(StatusEffect, it.instanceOfPowerups,
+ FOREACH(StatusEffects, it.instanceOfPowerupStatusEffect,
{
float powerup_finished = StatusEffects_gettime(it, g_statuseffects) - time;
if(powerup_finished > 0)
#include <common/mutators/mutator/status_effects/all.qh>
-CLASS(Webbed, StatusEffects)
+CLASS(Webbed, StatusEffect)
ATTRIB(Webbed, netname, string, "webbed");
#if 0
// NOTE: status effect name and icon disabled as they are not displayed
string BUFF_NAME(int i)
{
- Buff b = REGISTRY_GET(StatusEffect, i);
+ Buff b = REGISTRY_GET(StatusEffects, i);
return strcat(rgb_to_hexcolor(b.m_color), b.m_name);
}
#include <common/mutators/mutator/waypoints/all.qh>
#endif
-#define REGISTER_BUFF(id, inst) REGISTER(StatusEffect, BUFF_##id, m_id, inst)
+#define REGISTER_BUFF(id, inst) REGISTER(StatusEffects, BUFF_##id, m_id, inst)
#include <common/mutators/mutator/status_effects/_mod.qh>
-CLASS(Buff, StatusEffects)
+CLASS(Buff, StatusEffect)
#ifdef GAMEQC
ATTRIB(Buff, m_itemid, int, IT_BUFF);
#endif
ENDCLASS(Buff)
STATIC_INIT(REGISTER_BUFFS) {
- FOREACH(StatusEffect, it.instanceOfBuff, {
+ FOREACH(StatusEffects, it.instanceOfBuff, {
it.m_sprite = strzone(strcat("buff-", it.netname));
});
}
string s = M_ARGV(1, string);
if (s == WP_Buff.netname || s == RADARICON_Buff.netname)
{
- Buff b = REGISTRY_GET(StatusEffect, this.wp_extra);
+ Buff b = REGISTRY_GET(StatusEffects, this.wp_extra);
M_ARGV(2, vector) = b.m_color;
M_ARGV(3, string) = b.m_name;
M_ARGV(4, string) = b.m_icon;
void buff_NewType(entity ent)
{
RandomSelection_Init();
- FOREACH(StatusEffect, it.instanceOfBuff && buff_Available(it),
+ FOREACH(StatusEffects, it.instanceOfBuff && buff_Available(it),
{
// if it's already been chosen, give it a lower priority
float myseencount = (it.buff_seencount > 0) ? it.buff_seencount : 1; // no division by zero please!
{
if(!actor.statuseffects)
return;
- FOREACH(StatusEffect, it.instanceOfBuff,
+ FOREACH(StatusEffects, it.instanceOfBuff,
{
it.m_remove(it, actor, removal_type);
});
{
if(!actor.statuseffects)
return NULL;
- FOREACH(StatusEffect, it.instanceOfBuff && it.m_active(it, actor), { return it; });
+ FOREACH(StatusEffects, it.instanceOfBuff && it.m_active(it, actor), { return it; });
return NULL;
}
return offset_y + (intersect_y - offset_y) * logn(((damg - offset_x) * ((base - 1) / intersect_x)) + 1, base);
}
-METHOD(Buff, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(Buff, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
if(IS_PLAYER(actor))
actor.effects |= EF_NOSHADOW; // does not play well with buff icon
SUPER(Buff).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(Buff, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(Buff, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(wasactive)
SUPER(Buff).m_remove(this, actor, removal_type);
}
-METHOD(AmmoBuff, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(AmmoBuff, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive)
}
SUPER(AmmoBuff).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(AmmoBuff, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(AmmoBuff, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(wasactive)
actor.buff_ammo_prev_infitems = 0;
SUPER(AmmoBuff).m_remove(this, actor, removal_type);
}
-METHOD(AmmoBuff, m_tick, void(StatusEffects this, entity actor))
+METHOD(AmmoBuff, m_tick, void(StatusEffect this, entity actor))
{
if(IS_PLAYER(actor))
{
}
-METHOD(FlightBuff, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(FlightBuff, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive)
}
SUPER(FlightBuff).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(FlightBuff, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(FlightBuff, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(wasactive)
SUPER(FlightBuff).m_remove(this, actor, removal_type);
}
-METHOD(MagnetBuff, m_tick, void(StatusEffects this, entity actor))
+METHOD(MagnetBuff, m_tick, void(StatusEffect this, entity actor))
{
if(IS_PLAYER(actor))
{
return;
}
- if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_AMMO)) || (!StatusEffects_active(STATUSEFFECT_Superweapons, actor) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
+ if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_AMMO)) || (!StatusEffects_active(STATUSEFFECT_Superweapon, actor) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
#include "invisibility.qh"
#ifdef SVQC
-METHOD(InvisibilityStatusEffect, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(InvisibilityStatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(removal_type == STATUSEFFECT_REMOVE_TIMEOUT && wasactive && IS_PLAYER(actor))
}
SUPER(InvisibilityStatusEffect).m_remove(this, actor, removal_type);
}
-METHOD(InvisibilityStatusEffect, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(InvisibilityStatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive && IS_PLAYER(actor))
}
SUPER(InvisibilityStatusEffect).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(InvisibilityStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(InvisibilityStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
play_countdown(actor, StatusEffects_gettime(this, actor), SND_POWEROFF);
if(!actor.vehicle)
SPAWNFUNC_ITEM(item_invisibility, ITEM_Invisibility)
SPAWNFUNC_ITEM(item_buff_invisibility, ITEM_Invisibility)
-CLASS(InvisibilityStatusEffect, Powerups)
- ATTRIB(InvisibilityStatusEffect, netname, string, "invisibility");
- ATTRIB(InvisibilityStatusEffect, m_name, string, _("Invisibility"));
- ATTRIB(InvisibilityStatusEffect, m_color, vector, '0.5 0.5 1');
- ATTRIB(InvisibilityStatusEffect, m_icon, string, "buff_invisible");
+CLASS(InvisibilityStatusEffect, PowerupStatusEffect)
+ ATTRIB(InvisibilityStatusEffect, netname, string, "invisibility");
+ ATTRIB(InvisibilityStatusEffect, m_name, string, _("Invisibility"));
+ ATTRIB(InvisibilityStatusEffect, m_color, vector, '0.5 0.5 1');
+ ATTRIB(InvisibilityStatusEffect, m_icon, string, "buff_invisible");
ENDCLASS(InvisibilityStatusEffect)
REGISTER_STATUSEFFECT(Invisibility, NEW(InvisibilityStatusEffect));
#include "shield.qh"
#ifdef SVQC
-METHOD(ShieldStatusEffect, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(ShieldStatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(removal_type == STATUSEFFECT_REMOVE_TIMEOUT && wasactive && IS_PLAYER(actor))
actor.effects &= ~(EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
SUPER(ShieldStatusEffect).m_remove(this, actor, removal_type);
}
-METHOD(ShieldStatusEffect, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(ShieldStatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive && IS_PLAYER(actor))
}
SUPER(ShieldStatusEffect).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(ShieldStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(ShieldStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
play_countdown(actor, StatusEffects_gettime(this, actor), SND_POWEROFF);
actor.effects |= (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
}
#endif
#ifdef CSQC
-METHOD(ShieldStatusEffect, m_active, bool(StatusEffects this, entity actor))
+METHOD(ShieldStatusEffect, m_active, bool(StatusEffect this, entity actor))
{
if(autocvar__hud_configure)
return true;
return SUPER(ShieldStatusEffect).m_active(this, actor);
}
-METHOD(ShieldStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(ShieldStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
if(this.m_hidden)
return;
SPAWNFUNC_ITEM(item_shield, ITEM_Shield)
SPAWNFUNC_ITEM(item_invincible, ITEM_Shield)
-CLASS(ShieldStatusEffect, Powerups)
- ATTRIB(ShieldStatusEffect, netname, string, "invincible"); // NOTE: referring to as invincible so that it matches the powerup item
- ATTRIB(ShieldStatusEffect, m_name, string, _("Shield"));
- ATTRIB(ShieldStatusEffect, m_icon, string, "shield");
+CLASS(ShieldStatusEffect, PowerupStatusEffect)
+ ATTRIB(ShieldStatusEffect, netname, string, "invincible"); // NOTE: referring to as invincible so that it matches the powerup item
+ ATTRIB(ShieldStatusEffect, m_name, string, _("Shield"));
+ ATTRIB(ShieldStatusEffect, m_icon, string, "shield");
ENDCLASS(ShieldStatusEffect)
REGISTER_STATUSEFFECT(Shield, NEW(ShieldStatusEffect));
#include "speed.qh"
#ifdef SVQC
-METHOD(SpeedStatusEffect, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(SpeedStatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(removal_type == STATUSEFFECT_REMOVE_TIMEOUT && wasactive && IS_PLAYER(actor))
stopsound(actor, CH_TRIGGER_SINGLE); // get rid of the pickup sound
SUPER(SpeedStatusEffect).m_remove(this, actor, removal_type);
}
-METHOD(SpeedStatusEffect, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(SpeedStatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive && IS_PLAYER(actor))
}
SUPER(SpeedStatusEffect).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(SpeedStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(SpeedStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
play_countdown(actor, StatusEffects_gettime(this, actor), SND_POWEROFF);
SUPER(SpeedStatusEffect).m_tick(this, actor);
SPAWNFUNC_ITEM(item_speed, ITEM_Speed)
SPAWNFUNC_ITEM(item_buff_speed, ITEM_Speed)
-CLASS(SpeedStatusEffect, Powerups)
- ATTRIB(SpeedStatusEffect, netname, string, "speed");
- ATTRIB(SpeedStatusEffect, m_name, string, _("Speed"));
- ATTRIB(SpeedStatusEffect, m_color, vector, '0.1 1 0.84');
- ATTRIB(SpeedStatusEffect, m_icon, string, "buff_speed");
+CLASS(SpeedStatusEffect, PowerupStatusEffect)
+ ATTRIB(SpeedStatusEffect, netname, string, "speed");
+ ATTRIB(SpeedStatusEffect, m_name, string, _("Speed"));
+ ATTRIB(SpeedStatusEffect, m_color, vector, '0.1 1 0.84');
+ ATTRIB(SpeedStatusEffect, m_icon, string, "buff_speed");
ENDCLASS(SpeedStatusEffect)
REGISTER_STATUSEFFECT(Speed, NEW(SpeedStatusEffect));
#include "strength.qh"
#ifdef SVQC
-METHOD(StrengthStatusEffect, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(StrengthStatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(removal_type == STATUSEFFECT_REMOVE_TIMEOUT && wasactive && IS_PLAYER(actor))
actor.effects &= ~(EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
SUPER(StrengthStatusEffect).m_remove(this, actor, removal_type);
}
-METHOD(StrengthStatusEffect, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(StrengthStatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(!wasactive && IS_PLAYER(actor))
}
SUPER(StrengthStatusEffect).m_apply(this, actor, eff_time, eff_flags);
}
-METHOD(StrengthStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(StrengthStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
play_countdown(actor, StatusEffects_gettime(this, actor), SND_POWEROFF);
actor.effects |= (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
}
#endif
#ifdef CSQC
-METHOD(StrengthStatusEffect, m_active, bool(StatusEffects this, entity actor))
+METHOD(StrengthStatusEffect, m_active, bool(StatusEffect this, entity actor))
{
if(autocvar__hud_configure)
return true;
return SUPER(StrengthStatusEffect).m_active(this, actor);
}
-METHOD(StrengthStatusEffect, m_tick, void(StatusEffects this, entity actor))
+METHOD(StrengthStatusEffect, m_tick, void(StatusEffect this, entity actor))
{
if(this.m_hidden)
return;
SPAWNFUNC_ITEM(item_strength, ITEM_Strength)
-CLASS(StrengthStatusEffect, Powerups)
- ATTRIB(StrengthStatusEffect, netname, string, "strength");
- ATTRIB(StrengthStatusEffect, m_name, string, _("Strength"));
- ATTRIB(StrengthStatusEffect, m_icon, string, "strength");
+CLASS(StrengthStatusEffect, PowerupStatusEffect)
+ ATTRIB(StrengthStatusEffect, netname, string, "strength");
+ ATTRIB(StrengthStatusEffect, m_name, string, _("Strength"));
+ ATTRIB(StrengthStatusEffect, m_icon, string, "strength");
ENDCLASS(StrengthStatusEffect)
REGISTER_STATUSEFFECT(Strength, NEW(StrengthStatusEffect));
ENDCLASS(Powerup)
#include <common/mutators/mutator/status_effects/all.qh>
-CLASS(Powerups, StatusEffects)
+CLASS(PowerupStatusEffect, StatusEffect)
#ifdef GAMEQC
- ATTRIB(Powerups, m_sound_rm, Sound, SND_POWEROFF);
+ ATTRIB(PowerupStatusEffect, m_sound_rm, Sound, SND_POWEROFF);
#endif
-ENDCLASS(Powerups)
+ENDCLASS(PowerupStatusEffect)
}
}
-void powerups_DropItem(entity this, StatusEffects effect, bool freezeTimer)
+void powerups_DropItem(entity this, StatusEffect effect, bool freezeTimer)
{
float t = StatusEffects_gettime(effect, this);
float timeleft = t - time;
entity frag_target = M_ARGV(2, entity);
- FOREACH(StatusEffect, it.instanceOfPowerups,
+ FOREACH(StatusEffects, it.instanceOfPowerupStatusEffect,
{
if(StatusEffects_active(it, frag_target))
powerups_DropItem(frag_target, it, autocvar_g_powerups_drop_ondeath == 2);
entity player = M_ARGV(0, entity);
- FOREACH(StatusEffect, it.instanceOfPowerups,
+ FOREACH(StatusEffects, it.instanceOfPowerupStatusEffect,
{
if(StatusEffects_active(it, player)) {
powerups_DropItem(player, it, autocvar_g_powerups_drop == 2);
#pragma once
#ifdef GAMEQC
- #include <common/sounds/all.qh>
+ #include <common/sounds/all.qh>
#endif
-REGISTRY(StatusEffect, 32)
-REGISTER_REGISTRY(StatusEffect)
-#define REGISTER_STATUSEFFECT(id, inst) REGISTER(StatusEffect, STATUSEFFECT, id, m_id, inst)
+REGISTRY(StatusEffects, 32)
+REGISTER_REGISTRY(StatusEffects)
+#define REGISTER_STATUSEFFECT(id, inst) REGISTER(StatusEffects, STATUSEFFECT, id, m_id, inst)
-REGISTRY_SORT(StatusEffect)
-REGISTRY_CHECK(StatusEffect)
+REGISTRY_SORT(StatusEffects)
+REGISTRY_CHECK(StatusEffects)
-REGISTRY_DEFINE_GET(StatusEffect, NULL)
-STATIC_INIT(StatusEffect) { FOREACH(StatusEffect, true, it.m_id = i); }
+REGISTRY_DEFINE_GET(StatusEffects, NULL)
+STATIC_INIT(StatusEffects) { FOREACH(StatusEffects, true, it.m_id = i); }
enum
{
STATUSEFFECT_REMOVE_CLEAR ///< Effect is being forcibly removed without calling any additional mechanics.
};
-CLASS(StatusEffects, Object)
- ATTRIB(StatusEffects, m_id, int, 0);
- ATTRIB(StatusEffects, m_name, string);
- ATTRIB(StatusEffects, m_icon, string);
- ATTRIB(StatusEffects, m_color, vector, '1 1 1');
- /** Whether the effect is displayed in the HUD */
- ATTRIB(StatusEffects, m_hidden, bool, false);
- /** Lifetime scale for HUD progress bars */
- ATTRIB(StatusEffects, m_lifetime, float, 30);
+CLASS(StatusEffect, Object)
+ ATTRIB(StatusEffect, m_id, int, 0);
+ ATTRIB(StatusEffect, m_name, string);
+ ATTRIB(StatusEffect, m_icon, string);
+ ATTRIB(StatusEffect, m_color, vector, '1 1 1');
+ /** Whether the effect is displayed in the HUD */
+ ATTRIB(StatusEffect, m_hidden, bool, false);
+ /** Lifetime scale for HUD progress bars */
+ ATTRIB(StatusEffect, m_lifetime, float, 30);
#ifdef GAMEQC
- ATTRIB(StatusEffects, m_sound, Sound, SND_Null);
- ATTRIB(StatusEffects, m_sound_rm, Sound, SND_Null);
- METHOD(StatusEffects, m_tick, void(StatusEffects this, entity actor));
- METHOD(StatusEffects, m_active, bool(StatusEffects this, entity actor));
- /** Stores times of status effects, the id being the index */
- ATTRIBARRAY(StatusEffects, statuseffect_time, float, REGISTRY_MAX(StatusEffect));
- ATTRIBARRAY(StatusEffects, statuseffect_flags, int, REGISTRY_MAX(StatusEffect));
+ ATTRIB(StatusEffect, m_sound, Sound, SND_Null);
+ ATTRIB(StatusEffect, m_sound_rm, Sound, SND_Null);
+ METHOD(StatusEffect, m_tick, void(StatusEffect this, entity actor));
+ METHOD(StatusEffect, m_active, bool(StatusEffect this, entity actor));
+ /** Stores times of status effects, the id being the index */
+ ATTRIBARRAY(StatusEffect, statuseffect_time, float, REGISTRY_MAX(StatusEffects));
+ ATTRIBARRAY(StatusEffect, statuseffect_flags, int, REGISTRY_MAX(StatusEffects));
#endif
#ifdef SVQC
- METHOD(StatusEffects, m_apply, void(StatusEffects this, entity actor, float eff_time, int eff_flags));
- METHOD(StatusEffects, m_remove, void(StatusEffects this, entity actor, int removal_type));
- /** Sets the persistent flag and updates client side if returning true */
- METHOD(StatusEffects, m_persistent, bool(StatusEffects this, entity actor)) { return false; };
+ METHOD(StatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, int eff_flags));
+ METHOD(StatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type));
+ /** Sets the persistent flag and updates client side if returning true */
+ METHOD(StatusEffect, m_persistent, bool(StatusEffect this, entity actor)) { return false; };
#endif
- METHOD(StatusEffects, display, void(StatusEffects this, void(string name, string icon) returns))
- {
- TC(StatusEffects, this);
- returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
- }
-ENDCLASS(StatusEffects)
+ METHOD(StatusEffect, display, void(StatusEffect this, void(string name, string icon) returns))
+ {
+ TC(StatusEffect, this);
+ returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
+ }
+ENDCLASS(StatusEffect)
#include "cl_status_effects.qh"
-METHOD(StatusEffects, m_active, bool(StatusEffects this, entity actor))
+METHOD(StatusEffect, m_active, bool(StatusEffect this, entity actor))
{
if(!actor) return false;
- TC(StatusEffects, this);
+ TC(StatusEffect, this);
return (actor.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
}
-METHOD(StatusEffects, m_tick, void(StatusEffects this, entity actor))
+METHOD(StatusEffect, m_tick, void(StatusEffect this, entity actor))
{
if(this.m_hidden || autocvar__hud_configure)
return;
#include "burning.qh"
#ifdef SVQC
-METHOD(Burning, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(Burning, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
actor.effects &= ~EF_FLAME;
SUPER(Burning).m_remove(this, actor, removal_type);
}
-METHOD(Burning, m_persistent, bool(StatusEffects this, entity actor))
+METHOD(Burning, m_persistent, bool(StatusEffect this, entity actor))
{
return (autocvar_g_balance_contents_playerdamage_lava_burn && actor.waterlevel && actor.watertype == CONTENT_LAVA);
}
-METHOD(Burning, m_tick, void(StatusEffects this, entity actor))
+METHOD(Burning, m_tick, void(StatusEffect this, entity actor))
{
if(STAT(FROZEN, actor) || (actor.waterlevel && actor.watertype != CONTENT_LAVA))
{
#ifdef GAMEQC
SOUND(Burning_Remove, "desertfactory/steam_burst");
#endif
-CLASS(Burning, StatusEffects)
+CLASS(Burning, StatusEffect)
ATTRIB(Burning, netname, string, "burning");
#if 0
// NOTE: status effect name and icon disabled as they are not displayed
#include "burning.qh"
#ifdef SVQC
-METHOD(SpawnShield, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(SpawnShield, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
actor.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT);
SUPER(SpawnShield).m_remove(this, actor, removal_type);
}
-METHOD(SpawnShield, m_tick, void(StatusEffects this, entity actor))
+METHOD(SpawnShield, m_tick, void(StatusEffect this, entity actor))
{
if(time >= game_starttime)
actor.effects |= (EF_ADDITIVE | EF_FULLBRIGHT);
#include <common/mutators/mutator/status_effects/all.qh>
-CLASS(SpawnShield, StatusEffects)
+CLASS(SpawnShield, StatusEffect)
ATTRIB(SpawnShield, netname, string, "spawnshield");
#if 0
// NOTE: status effect name and icon disabled as they are not displayed
#include "stunned.qh"
#ifdef SVQC
-METHOD(Stunned, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(Stunned, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
actor.effects &= ~EF_SHOCK;
SUPER(Stunned).m_remove(this, actor, removal_type);
}
#if 0
// TODO: some infinite source of stunning? e.g. some electric current
-METHOD(Stunned, m_persistent, bool(StatusEffects this, entity actor))
+METHOD(Stunned, m_persistent, bool(StatusEffect this, entity actor))
{
return true;
}
#endif
-METHOD(Stunned, m_tick, void(StatusEffects this, entity actor))
+METHOD(Stunned, m_tick, void(StatusEffect this, entity actor))
{
if(STAT(FROZEN, actor))
{
#ifdef GAMEQC
SOUND(Stunned_Remove, "onslaught/ons_spark1");
#endif
-CLASS(Stunned, StatusEffects)
+CLASS(Stunned, StatusEffect)
ATTRIB(Stunned, netname, string, "stunned");
#if 0
// NOTE: status effect name and icon disabled as they are not displayed
#include "superweapons.qh"
#ifdef SVQC
-METHOD(Superweapons, m_persistent, bool(StatusEffects this, entity actor))
+METHOD(Superweapon, m_persistent, bool(StatusEffect this, entity actor))
{
return (actor.items & IT_UNLIMITED_SUPERWEAPONS);
}
#endif
#ifdef CSQC
-METHOD(Superweapons, m_active, bool(StatusEffects this, entity actor))
+METHOD(Superweapon, m_active, bool(StatusEffect this, entity actor))
{
if(autocvar__hud_configure)
return true;
- return SUPER(Superweapons).m_active(this, actor);
+ return SUPER(Superweapon).m_active(this, actor);
}
-METHOD(Superweapons, m_tick, void(StatusEffects this, entity actor))
+METHOD(Superweapon, m_tick, void(StatusEffect this, entity actor))
{
if(this.m_hidden)
return;
#include <common/mutators/mutator/status_effects/all.qh>
-CLASS(Superweapons, StatusEffects)
- ATTRIB(Superweapons, netname, string, "superweapons");
- ATTRIB(Superweapons, m_name, string, _("Superweapons"));
- ATTRIB(Superweapons, m_icon, string, "superweapons");
+CLASS(Superweapon, StatusEffect)
+ ATTRIB(Superweapon, netname, string, "superweapons");
+ ATTRIB(Superweapon, m_name, string, _("Superweapons"));
+ ATTRIB(Superweapon, m_icon, string, "superweapons");
#ifdef GAMEQC
- ATTRIB(Superweapons, m_sound_rm, Sound, SND_POWEROFF);
+ ATTRIB(Superweapon, m_sound_rm, Sound, SND_POWEROFF);
#endif
-ENDCLASS(Superweapons)
-REGISTER_STATUSEFFECT(Superweapons, NEW(Superweapons));
+ENDCLASS(Superweapon)
+REGISTER_STATUSEFFECT(Superweapon, NEW(Superweapon));
#include "status_effects.qh"
#ifdef GAMEQC
-bool StatusEffects_active(StatusEffects this, entity actor)
+bool StatusEffects_active(StatusEffect this, entity actor)
{
return this.m_active(this, actor);
}
void StatusEffects_tick(entity actor)
{
- FOREACH(StatusEffect, it.m_active(it, actor),
+ FOREACH(StatusEffects, it.m_active(it, actor),
{
it.m_tick(it, actor);
});
}
-float StatusEffects_gettime(StatusEffects this, entity actor)
+float StatusEffects_gettime(StatusEffect this, entity actor)
{
entity store = actor;
#ifdef SVQC
}
#endif
#ifdef SVQC
-void StatusEffects_apply(StatusEffects this, entity actor, float eff_time, int eff_flags)
+void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
{
if (!actor || eff_time <= time)
return;
this.m_apply(this, actor, eff_time, eff_flags);
}
-void StatusEffects_copy(StatusEffects this, entity store, float time_offset)
+void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
{
if(!this || !store)
return;
- FOREACH(StatusEffect, true,
+ FOREACH(StatusEffects, true,
{
if(time_offset)
store.statuseffect_time[it.m_id] = time + this.statuseffect_time[it.m_id] - time_offset;
});
}
-void StatusEffects_remove(StatusEffects this, entity actor, int removal_type)
+void StatusEffects_remove(StatusEffect this, entity actor, int removal_type)
{
this.m_remove(this, actor, removal_type);
}
{
if(!actor.statuseffects)
return;
- FOREACH(StatusEffect, true,
+ FOREACH(StatusEffects, true,
{
it.m_remove(it, actor, removal_type);
});
#ifdef GAMEQC
/** Entity statuseffects */
-.StatusEffects statuseffects;
+.StatusEffect statuseffects;
/** Player statuseffects storage (holds previous state) */
-.StatusEffects statuseffects_store;
+.StatusEffect statuseffects_store;
REGISTER_NET_LINKED(ENT_CLIENT_STATUSEFFECTS)
const int StatusEffects_groups_minor = 8; // must be a multiple of 8 (one byte) to optimize bandwidth usage
-const int StatusEffects_groups_major = 4; // must be >= ceil(REGISTRY_COUNT(StatusEffect) / StatusEffects_groups_minor)
+const int StatusEffects_groups_major = 4; // must be >= ceil(REGISTRY_COUNT(StatusEffects) / StatusEffects_groups_minor)
#endif
// no need to perform these checks on both server and client
{
if (StatusEffects_groups_minor / 8 != floor(StatusEffects_groups_minor / 8))
error("StatusEffects_groups_minor is not a multiple of 8.");
- int min_major_value = ceil(REGISTRY_COUNT(StatusEffect) / StatusEffects_groups_minor);
+ int min_major_value = ceil(REGISTRY_COUNT(StatusEffects) / StatusEffects_groups_minor);
if (StatusEffects_groups_major < min_major_value)
error(sprintf("StatusEffects_groups_major can not be < %d.", min_major_value));
}
#endif
#ifdef CSQC
-StatusEffects g_statuseffects;
+StatusEffect g_statuseffects;
void StatusEffects_entremove(entity this)
{
if(g_statuseffects == this)
if (!(minorBits & BIT(j))) {
continue;
}
- const StatusEffects it = REGISTRY_GET(StatusEffect, StatusEffects_groups_minor * i + j);
+ const StatusEffect it = REGISTRY_GET(StatusEffects, StatusEffects_groups_minor * i + j);
this.statuseffect_time[it.m_id] = ReadFloat();
this.statuseffect_flags[it.m_id] = ReadByte();
}
#ifdef SVQC
int SEFminorBitsArr[StatusEffects_groups_major];
-void StatusEffects_Write(StatusEffects data, StatusEffects store)
+void StatusEffects_Write(StatusEffect data, StatusEffect store)
{
if (!data) {
WriteShort(MSG_ENTITY, 0);
return;
}
- TC(StatusEffects, data);
+ TC(StatusEffect, data);
for (int i = 0; i < StatusEffects_groups_major; ++i)
SEFminorBitsArr[i] = 0;
int majorBits = 0;
- FOREACH(StatusEffect, true, {
+ FOREACH(StatusEffects, true, {
.float fld = statuseffect_time[it.m_id];
.int flg = statuseffect_flags[it.m_id];
const bool changed = (store.(fld) != data.(fld) || store.(flg) != data.(flg));
if (!(minorBits & BIT(j)))
continue;
- const entity it = REGISTRY_GET(StatusEffect, StatusEffects_groups_minor * i + j);
+ const entity it = REGISTRY_GET(StatusEffects, StatusEffects_groups_minor * i + j);
WriteFloat(MSG_ENTITY, data.statuseffect_time[it.m_id]);
WriteByte(MSG_ENTITY, data.statuseffect_flags[it.m_id]);
}
#undef G_MINOR
#ifdef SVQC
-bool StatusEffects_Send(StatusEffects this, Client to, int sf)
+bool StatusEffects_Send(StatusEffect this, Client to, int sf)
{
- TC(StatusEffects, this);
+ TC(StatusEffect, this);
WriteHeader(MSG_ENTITY, ENT_CLIENT_STATUSEFFECTS);
StatusEffects_Write(this, to.statuseffects_store);
return true;
void StatusEffects_new(entity this)
{
- StatusEffects eff = NEW(StatusEffects);
+ StatusEffect eff = NEW(StatusEffect);
this.statuseffects = eff;
eff.owner = this;
if(this.statuseffects_store)
Net_LinkEntity(eff, false, 0, StatusEffects_Send);
}
}
+
void StatusEffects_delete(entity e) { delete(e.statuseffects); e.statuseffects = NULL; }
// may be called on non-player entities, should be harmless!
+
void StatusEffects_update(entity e) { e.statuseffects.SendFlags = 0xFFFFFF; }
// this clears the storage entity instead of the statuseffects object, useful for map resets and such
return; // safety net
// NOTE: you will need to perform StatusEffects_update after this to update the storage entity
// (unless store is the storage entity)
- FOREACH(StatusEffect, true, {
+ FOREACH(StatusEffects, true, {
store.statuseffect_time[it.m_id] = 0;
store.statuseffect_flags[it.m_id] = 0;
});
}
-void StatusEffectsStorage_attach(entity e) { e.statuseffects_store = NEW(StatusEffects); e.statuseffects_store.drawonlytoclient = e; }
+void StatusEffectsStorage_attach(entity e) { e.statuseffects_store = NEW(StatusEffect); e.statuseffects_store.drawonlytoclient = e; }
void StatusEffectsStorage_delete(entity e) { delete(e.statuseffects_store); e.statuseffects_store = NULL; }
// called when an entity is deleted with delete() / remove()
#endif
#ifdef GAMEQC
-bool StatusEffects_active(StatusEffects this, entity actor);
+bool StatusEffects_active(StatusEffect this, entity actor);
// runs every SV_StartFrame on the server
// called by HUD_Powerups_add on the client
// accesses the status effect timer, returns 0 if the entity has no statuseffects object
// pass g_statuseffects as the actor on client side
// pass the entity with a .statuseffects on server side
-float StatusEffects_gettime(StatusEffects this, entity actor);
+float StatusEffects_gettime(StatusEffect this, entity actor);
#endif
#ifdef SVQC
// call when applying the effect to an entity
-void StatusEffects_apply(StatusEffects this, entity actor, float eff_time, int eff_flags);
+void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags);
// copies all the status effect fields to the specified storage entity
// does not perform an update
-void StatusEffects_copy(StatusEffects this, entity store, float time_offset);
+void StatusEffects_copy(StatusEffect this, entity store, float time_offset);
// call when removing the effect
-void StatusEffects_remove(StatusEffects this, entity actor, int removal_type);
+void StatusEffects_remove(StatusEffect this, entity actor, int removal_type);
void StatusEffects_removeall(entity actor, int removal_type);
#endif
#include "sv_status_effects.qh"
-METHOD(StatusEffects, m_active, bool(StatusEffects this, entity actor))
+METHOD(StatusEffect, m_active, bool(StatusEffect this, entity actor))
{
- TC(StatusEffects, this);
+ TC(StatusEffect, this);
if(!actor.statuseffects)
return false; // safety net
return (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE);
}
-METHOD(StatusEffects, m_tick, void(StatusEffects this, entity actor))
+METHOD(StatusEffect, m_tick, void(StatusEffect this, entity actor))
{
- StatusEffects data = actor.statuseffects;
+ StatusEffect data = actor.statuseffects;
.int flg = statuseffect_flags[this.m_id];
int oldflag = data.(flg);
data.(flg) = BITSET(data.(flg), STATUSEFFECT_FLAG_PERSISTENT, this.m_persistent(this, actor));
}
}
-METHOD(StatusEffects, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
+METHOD(StatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, float eff_flags))
{
if(!actor.statuseffects)
StatusEffects_new(actor);
StatusEffects_update(actor);
}
-METHOD(StatusEffects, m_remove, void(StatusEffects this, entity actor, int removal_type))
+METHOD(StatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type))
{
- StatusEffects data = actor.statuseffects;
+ StatusEffect data = actor.statuseffects;
if(!data)
return;
// NOTE: persistent effects do not make a sound on removal, this is intended as a workaround for #2620
PS(this).dual_weapons = '0 0 0';
if(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS)
- StatusEffects_apply(STATUSEFFECT_Superweapons, this, time + autocvar_g_balance_superweapons_time, 0);
+ StatusEffects_apply(STATUSEFFECT_Superweapon, this, time + autocvar_g_balance_superweapons_time, 0);
this.items = start_items;
{
if (!(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS))
{
- StatusEffects_remove(STATUSEFFECT_Superweapons, this, STATUSEFFECT_REMOVE_NORMAL);
+ StatusEffects_remove(STATUSEFFECT_Superweapon, this, STATUSEFFECT_REMOVE_NORMAL);
this.items &= ~IT_SUPERWEAPON;
//Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
}
else
{
- play_countdown(this, StatusEffects_gettime(STATUSEFFECT_Superweapons, this), SND_POWEROFF);
- if (time >= StatusEffects_gettime(STATUSEFFECT_Superweapons, this))
+ play_countdown(this, StatusEffects_gettime(STATUSEFFECT_Superweapon, this), SND_POWEROFF);
+ if (time >= StatusEffects_gettime(STATUSEFFECT_Superweapon, this))
{
this.items &= ~IT_SUPERWEAPON;
STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
}
else if(STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS)
{
- if (time < StatusEffects_gettime(STATUSEFFECT_Superweapons, this) || (this.items & IT_UNLIMITED_SUPERWEAPONS))
+ if (time < StatusEffects_gettime(STATUSEFFECT_Superweapon, this) || (this.items & IT_UNLIMITED_SUPERWEAPONS))
{
this.items |= IT_SUPERWEAPON;
if(!(this.items & IT_UNLIMITED_SUPERWEAPONS))
}
else
{
- if(StatusEffects_active(STATUSEFFECT_Superweapons, this))
- StatusEffects_remove(STATUSEFFECT_Superweapons, this, STATUSEFFECT_REMOVE_TIMEOUT);
+ if(StatusEffects_active(STATUSEFFECT_Superweapon, this))
+ StatusEffects_remove(STATUSEFFECT_Superweapon, this, STATUSEFFECT_REMOVE_TIMEOUT);
STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
}
}
- else if(StatusEffects_active(STATUSEFFECT_Superweapons, this)) // cheaper to check than to update each frame!
+ else if(StatusEffects_active(STATUSEFFECT_Superweapon, this)) // cheaper to check than to update each frame!
{
- StatusEffects_remove(STATUSEFFECT_Superweapons, this, STATUSEFFECT_REMOVE_CLEAR);
+ StatusEffects_remove(STATUSEFFECT_Superweapon, this, STATUSEFFECT_REMOVE_CLEAR);
}
}
if (!(this.spawnflags & 8))
{
- FOREACH(StatusEffect, it.instanceOfPowerups,
+ FOREACH(StatusEffects, it.instanceOfPowerupStatusEffect,
{
it.m_remove(it, actor, STATUSEFFECT_REMOVE_NORMAL);
});
if (item.superweapons_finished)
{
pickedup = true;
- float t = StatusEffects_gettime(STATUSEFFECT_Superweapons, player);
- StatusEffects_apply(STATUSEFFECT_Superweapons, player, t + item.superweapons_finished, 0);
+ float t = StatusEffects_gettime(STATUSEFFECT_Superweapon, player);
+ StatusEffects_apply(STATUSEFFECT_Superweapon, player, t + item.superweapons_finished, 0);
}
// always eat teamed entities
else if(argv(j) == "fuel_regen") this.items |= ITEM_JetpackRegen.m_itemid;
else
{
- FOREACH(StatusEffect, it.instanceOfBuff,
+ FOREACH(StatusEffects, it.instanceOfBuff,
{
string s = Buff_CompatName(argv(j));
if(s == it.netname)
res = GetResource(this, RES_FUEL); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "fuel");
res = GetResource(this, RES_HEALTH); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "health");
res = GetResource(this, RES_ARMOR); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "armor");
- FOREACH(StatusEffect, it.instanceOfBuff, str = sprintf("%s %s%d %s", str, valueprefix, this.buffs_finished * boolean(this.buffdef == it), it.netname));
+ FOREACH(StatusEffects, it.instanceOfBuff, str = sprintf("%s %s%d %s", str, valueprefix, this.buffs_finished * boolean(this.buffdef == it), it.netname));
FOREACH(Weapons, it != WEP_Null, str = sprintf("%s %s%d %s", str, itemprefix, !!(STAT(WEAPONS, this) & (it.m_wepset)), it.netname));
}
this.netname = strzone(str);
return SetResourceExplicit(e, res_type, new_val);
}
-bool GiveStatusEffect(entity e, StatusEffects this, int op, float val)
+bool GiveStatusEffect(entity e, StatusEffect this, int op, float val)
{
bool had_eff = StatusEffects_active(this, e);
float new_eff_time = ((had_eff) ? StatusEffects_gettime(this, e) : time);
PREGIVE_STATUSEFFECT(e, STATUSEFFECT_Shield);
PREGIVE_STATUSEFFECT(e, STATUSEFFECT_Speed);
PREGIVE_STATUSEFFECT(e, STATUSEFFECT_Invisibility);
- //PREGIVE_STATUSEFFECT(e, STATUSEFFECT_Superweapons);
+ //PREGIVE_STATUSEFFECT(e, STATUSEFFECT_Superweapon);
PREGIVE_RESOURCE(e, RES_BULLETS);
PREGIVE_RESOURCE(e, RES_CELLS);
PREGIVE_RESOURCE(e, RES_SHELLS);
continue;
case "ALL":
got += GiveBit(e, items, ITEM_JetpackRegen.m_itemid, op, val);
- FOREACH(StatusEffect, it.instanceOfPowerups, got += GiveStatusEffect(e, it, op, val));
+ FOREACH(StatusEffects, it.instanceOfPowerupStatusEffect, got += GiveStatusEffect(e, it, op, val));
got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val);
case "all":
got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN)),
got += GiveWeapon(e, it.m_id, op, val));
//case "allbuffs": // all buffs makes a player god, do not want!
- //FOREACH(StatusEffect, it.instanceOfBuff, got += GiveBuff(e, it, op, val));
+ //FOREACH(StatusEffects, it.instanceOfBuff, got += GiveBuff(e, it, op, val));
case "allammo":
got += GiveResourceValue(e, RES_CELLS, op, val);
got += GiveResourceValue(e, RES_SHELLS, op, val);
got += GiveStatusEffect(e, STATUSEFFECT_Invisibility, op, val);
break;
case "superweapons":
- got += GiveStatusEffect(e, STATUSEFFECT_Superweapons, op, val);
+ got += GiveStatusEffect(e, STATUSEFFECT_Superweapon, op, val);
break;
case "cells":
got += GiveResourceValue(e, RES_CELLS, op, val);
got += GiveResourceValue(e, RES_FUEL, op, val);
break;
default:
- FOREACH(StatusEffect, it.instanceOfBuff && buff_Available(it) && Buff_CompatName(cmd) == it.netname,
+ FOREACH(StatusEffects, it.instanceOfBuff && buff_Available(it) && Buff_CompatName(cmd) == it.netname,
{
got += GiveBuff(e, it, op, val);
break;
POSTGIVE_RES_ROT(e, RES_ARMOR, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_ARMOR25, SND_Null);
POSTGIVE_RES_ROT(e, RES_HEALTH, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null);
- if(!StatusEffects_active(STATUSEFFECT_Superweapons, e))
+ if(!StatusEffects_active(STATUSEFFECT_Superweapon, e))
{
// also give default superweapon time if player had no superweapons and just got one
if(!g_weaponarena && !(save_weapons & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
- StatusEffects_apply(STATUSEFFECT_Superweapons, e, time + autocvar_g_balance_superweapons_time, 0);
+ StatusEffects_apply(STATUSEFFECT_Superweapon, e, time + autocvar_g_balance_superweapons_time, 0);
}
if(e.statuseffects)
});
if(superweapons <= 1)
{
- wep.superweapons_finished = StatusEffects_gettime(STATUSEFFECT_Superweapons, own);
- StatusEffects_remove(STATUSEFFECT_Superweapons, own, STATUSEFFECT_REMOVE_CLEAR);
+ wep.superweapons_finished = StatusEffects_gettime(STATUSEFFECT_Superweapon, own);
+ StatusEffects_remove(STATUSEFFECT_Superweapon, own, STATUSEFFECT_REMOVE_CLEAR);
}
else
{
- float timeleft = StatusEffects_gettime(STATUSEFFECT_Superweapons, own) - time;
+ float timeleft = StatusEffects_gettime(STATUSEFFECT_Superweapon, own) - time;
float weptimeleft = timeleft / superweapons;
wep.superweapons_finished = time + weptimeleft;
if(own.statuseffects)
{
// TODO: this doesn't explicitly enable the effect, use apply here?
- own.statuseffects.statuseffect_time[STATUSEFFECT_Superweapons.m_id] -= weptimeleft;
+ own.statuseffects.statuseffect_time[STATUSEFFECT_Superweapon.m_id] -= weptimeleft;
StatusEffects_update(own);
}
}