if(autocvar_g_buffs_waypoint_distance <= 0) return;
entity buff = e.buffdef;
- entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team, e, buff_waypoint, true, RADARICON_Buff);
+ entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team_forced, e, buff_waypoint, true, RADARICON_Buff);
wp.wp_extra = buff.m_id;
WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
if(!IS_PLAYER(toucher))
return; // incase mutator changed toucher
- if((this.team && DIFF_TEAM(toucher, this))
+ if((this.team_forced && toucher.team != this.team_forced)
|| (STAT(FROZEN, toucher))
|| (toucher.vehicle)
|| (!this.buffdef) // TODO: error out or maybe reset type if this occurs?
- || (time < PS(toucher).buff_shield)
+ || (time < toucher.buff_shield)
)
{
// can't touch this
if(this.buff_active)
{
- if(this.team && !this.buff_waypoint)
+ if(this.team_forced && !this.buff_waypoint)
buff_Waypoint_Spawn(this);
if(this.lifetime && time >= this.lifetime)
bool buff_Customize(entity this, entity client)
{
entity player = WaypointSprite_getviewentity(client);
- if((!this.buff_active || !this.buffdef) || (this.team && DIFF_TEAM(player, this)))
+ if((!this.buff_active || !this.buffdef) || (this.team_forced && player.team != this.team_forced))
{
this.alpha = 0.3;
if(this.effects & EF_FULLBRIGHT) { this.effects &= ~(EF_FULLBRIGHT); }
{
if(!cvar("g_buffs")) { delete(this); return; }
- if(!teamplay && this.team) { this.team = 0; }
-
entity buff = this.buffdef;
if(!buff || !buff_Available(buff))
void buff_Init_Compat(entity ent, entity replacement)
{
- if (ent.spawnflags & 2)
- ent.team = NUM_TEAM_1;
- else if (ent.spawnflags & 4)
- ent.team = NUM_TEAM_2;
+ if (teamplay)
+ {
+ if (ent.spawnflags & 2)
+ ent.team_forced = NUM_TEAM_1;
+ else if (ent.spawnflags & 4)
+ ent.team_forced = NUM_TEAM_2;
+ }
ent.buffdef = replacement;
}
else if(removal_type == STATUSEFFECT_REMOVE_NORMAL && !IS_INDEPENDENT_PLAYER(actor))
Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid);
- entity store = IS_PLAYER(actor) ? PS(actor) : actor;
- store.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
+ actor.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay); // always put in a delay, even if small
}
if(IS_PLAYER(actor))
actor.effects &= ~EF_NOSHADOW;
SUPER(Buff).m_remove(this, actor, removal_type);
}
-METHOD(Disabled, m_tick, void(StatusEffects this, entity actor))
-{
- if(time >= actor.disabled_effect_time)
- {
- Send_Effect(EFFECT_SMOKING, actor.origin + ((actor.mins + actor.maxs) * 0.5), '0 0 0', 1);
- actor.disabled_effect_time = time + 0.5;
- }
- SUPER(Disabled).m_tick(this, actor);
-}
-METHOD(Disabled, m_remove, void(StatusEffects this, entity actor, int removal_type))
-{
- actor.disabled_effect_time = 0;
- SUPER(Disabled).m_remove(this, actor, removal_type);
-}
-
METHOD(AmmoBuff, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(StatusEffects_active(BUFF_DISABILITY, frag_attacker))
if(frag_target != frag_attacker)
- StatusEffects_apply(STATUSEFFECT_Disabled, frag_target, time + autocvar_g_buffs_disability_slowtime, 0);
+ StatusEffects_apply(STATUSEFFECT_Stunned, frag_target, time + autocvar_g_buffs_disability_slowtime, 0);
if(StatusEffects_active(BUFF_INFERNO, frag_target))
{
MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_SplitHealthArmor)
{
+ // NOTE: vampire PlayerDamage_SplitHealthArmor code is similar
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
if(!StatusEffects_active(BUFF_VAMPIRE, frag_attacker))
return;
float health_take = bound(0, M_ARGV(4, float), GetResource(frag_target, RES_HEALTH));
- if(!StatusEffects_active(STATUSEFFECT_SpawnShield, frag_target) &&
- frag_target != frag_attacker &&
- IS_PLAYER(frag_attacker) &&
- !IS_DEAD(frag_target) && !STAT(FROZEN, frag_target))
+ if (!StatusEffects_active(STATUSEFFECT_SpawnShield, frag_target) && frag_target != frag_attacker
+ && IS_PLAYER(frag_attacker) && !IS_DEAD(frag_target) && !STAT(FROZEN, frag_target))
{
- GiveResource(frag_attacker, RES_HEALTH,
- autocvar_g_buffs_vampire_damage_steal * health_take);
+ GiveResource(frag_attacker, RES_HEALTH, autocvar_g_buffs_vampire_damage_steal * health_take);
}
}
entity player = M_ARGV(0, entity);
// these automatically reset, no need to worry
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_buffs_disability_speed;
}
{
entity mon = M_ARGV(0, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, mon))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, mon))
{
M_ARGV(1, float) *= autocvar_g_buffs_disability_speed; // run speed
M_ARGV(2, float) *= autocvar_g_buffs_disability_speed; // walk speed
Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
buff_RemoveAll(player, STATUSEFFECT_REMOVE_NORMAL);
- PS(player).buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
+ player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
sound(player, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
return true;
}
{
entity player = M_ARGV(1, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
M_ARGV(0, float) *= autocvar_g_buffs_disability_rate;
}
{
entity player = M_ARGV(1, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
M_ARGV(0, float) *= autocvar_g_buffs_disability_weaponspeed;
}
if(StatusEffects_active(BUFF_MEDIC, player))
{
- M_ARGV(2, float) = autocvar_g_buffs_medic_rot; // rot_mod
+ M_ARGV(3, float) = autocvar_g_buffs_medic_rot; // rot_mod
M_ARGV(4, float) = M_ARGV(1, float) = autocvar_g_buffs_medic_max; // limit_mod = max_mod
M_ARGV(2, float) = autocvar_g_buffs_medic_regen; // regen_mod
}
}
-REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
-
MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsString)
{
if(autocvar_g_buffs > 0) // only report as a mutator if they're enabled