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?
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;
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))
{
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
{
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