}
MUTATOR_HOOKFUNCTION(nb, PlayerDies)
-{SELFPARAM();
- nb_DropBall(self);
+{
+ nb_DropBall(frag_target);
return false;
}
return closest_target;
}
/**
- * find the number of control points and generators in the same team as self
+ * find the number of control points and generators in the same team as this
*/
-int ons_Count_SelfControlPoints()
-{SELFPARAM();
+int ons_Count_SelfControlPoints(entity this)
+{
entity tmp_entity;
tmp_entity = findchain(classname, "onslaught_controlpoint");
int n = 0;
while(tmp_entity)
{
- if(SAME_TEAM(tmp_entity, self))
+ if(SAME_TEAM(tmp_entity, this))
if(tmp_entity.iscaptured)
n++;
tmp_entity = tmp_entity.chain;
tmp_entity = findchain(classname, "onslaught_generator");
while(tmp_entity)
{
- if(SAME_TEAM(tmp_entity, self))
+ if(SAME_TEAM(tmp_entity, this))
n++;
tmp_entity = tmp_entity.chain;
}
}
if ( autocvar_g_onslaught_spawn_choose )
- if ( ons_Count_SelfControlPoints() > 1 )
- stuffcmd(self, "qc_cmd_cl hud clickradar\n");
+ if ( ons_Count_SelfControlPoints(frag_target) > 1 )
+ stuffcmd(frag_target, "qc_cmd_cl hud clickradar\n");
return false;
}
}
MUTATOR_HOOKFUNCTION(buffs, PlayerDies)
-{SELFPARAM();
- if(self.buffs)
+{
+ if(frag_target.buffs)
{
- int buffid = buff_FirstFromFlags(self.buffs).m_id;
- Send_Notification(NOTIF_ALL_EXCEPT, self, MSG_INFO, INFO_ITEM_BUFF_LOST, self.netname, buffid);
- self.buffs = 0;
+ int buffid = buff_FirstFromFlags(frag_target.buffs).m_id;
+ Send_Notification(NOTIF_ALL_EXCEPT, frag_target, MSG_INFO, INFO_ITEM_BUFF_LOST, frag_target.netname, buffid);
+ frag_target.buffs = 0;
- if(self.buff_model)
+ if(frag_target.buff_model)
{
- remove(self.buff_model);
- self.buff_model = world;
+ remove(frag_target.buff_model);
+ frag_target.buff_model = world;
}
}
return false;
.float campcheck_traveled_distance;
MUTATOR_HOOKFUNCTION(campcheck, PlayerDies)
-{SELFPARAM();
- Kill_Notification(NOTIF_ONE, self, MSG_CENTER_CPID, CPID_CAMPCHECK);
-
+{
+ Kill_Notification(NOTIF_ONE, frag_target, MSG_CENTER_CPID, CPID_CAMPCHECK);
return false;
}
}
MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor)
-{SELFPARAM();
+{
if(damage_take)
- self.ok_pauseregen_finished = max(self.ok_pauseregen_finished, time + 2);
+ frag_target.ok_pauseregen_finished = max(frag_target.ok_pauseregen_finished, time + 2);
return false;
}
MUTATOR_HOOKFUNCTION(ok, PlayerDies)
{
- SELFPARAM();
entity targ = ((frag_attacker) ? frag_attacker : frag_target);
- if(IS_MONSTER(this))
+ if(IS_MONSTER(frag_target))
{
remove(other); // remove default item
other = NULL;
e.gravity = 1;
e.reset = SUB_Remove;
setorigin(e, frag_target.origin + '0 0 32');
- e.velocity = '0 0 200' + normalize(targ.origin - self.origin) * 500;
+ e.velocity = '0 0 200' + normalize(targ.origin - frag_target.origin) * 500;
SUB_SetFade(e, time + 5, 1);
- this.ok_lastwep = PS(this).m_switchweapon.m_id;
+ frag_target.ok_lastwep = PS(frag_target).m_switchweapon.m_id;
return false;
}
REGISTER_MUTATOR(pinata, cvar("g_pinata") && !cvar("g_instagib") && !cvar("g_overkill"));
MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
-{SELFPARAM();
+{
FOREACH(Weapons, it != WEP_Null, LAMBDA(
- if(self.weapons & WepSet_FromWeapon(it))
- if(PS(self).m_switchweapon != it)
+ if(frag_target.weapons & WepSet_FromWeapon(it))
+ if(PS(frag_target).m_switchweapon != it)
if(W_IsWeaponThrowable(it.m_id))
- W_ThrowNewWeapon(self, it.m_id, false, CENTER_OR_VIEWOFS(self), randomvec() * 175 + '0 0 325');
+ W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325');
));
return true;
}
MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerDies)
-{SELFPARAM();
- self.msnt_deathloc = self.origin;
+{
+ frag_target.msnt_deathloc = frag_target.origin;
return 0;
}
}
MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
-{SELFPARAM();
+{
FOREACH_CLIENT(IS_SPEC(it), LAMBDA(
setself(it);
- if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == this)
+ if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == frag_target)
{
if(self.autospec_flags & ASF_SHOWWHAT)
superspec_msg("", "", self, sprintf("^7Following %s^7 due to followkiller\n", frag_attacker.netname), 2);
}
));
- setself(this);
+ setself(frag_target);
return false;
}
if(accuracy_isgooddamage(attacker, this))
attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
- WITH(entity, self, this, MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype));
+ MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype);
excess = frag_damage;
Weapon wep = PS(this).m_weapon;
}
MUTATOR_HOOKFUNCTION(ca, PlayerDies)
-{SELFPARAM();
+{
ca_LastPlayerForTeam_Notify();
if(!allowed_to_spawn)
- self.respawn_flags = RESPAWN_SILENT;
+ frag_target.respawn_flags = RESPAWN_SILENT;
if(!warmup_stage)
eliminatedPlayers.SendFlags |= 1;
return 1;
}
MUTATOR_HOOKFUNCTION(cts, PlayerDies)
-{SELFPARAM();
- self.respawn_flags |= RESPAWN_FORCE;
- race_AbandonRaceCheck(self);
+{
+ frag_target.respawn_flags |= RESPAWN_FORCE;
+ race_AbandonRaceCheck(frag_target);
return false;
}
}
MUTATOR_HOOKFUNCTION(ft, PlayerDies)
-{SELFPARAM();
+{
if(round_handler_IsActive())
if(round_handler_CountdownRunning())
{
- if(STAT(FROZEN, self))
- freezetag_Unfreeze(world);
+ if(STAT(FROZEN, frag_target))
+ WITH(entity, self, frag_target, freezetag_Unfreeze(world));
freezetag_count_alive_players();
return 1; // let the player die so that he can respawn whenever he wants
}
|| frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
{
// let the player die, he will be automatically frozen when he respawns
- if(STAT(FROZEN, self) != 1)
+ if(STAT(FROZEN, frag_target) != 1)
{
freezetag_Add_Score(frag_attacker);
freezetag_count_alive_players();
freezetag_LastPlayerForTeam_Notify();
}
else
- freezetag_Unfreeze(world); // remove ice
- self.health = 0; // Unfreeze resets health
- self.freezetag_frozen_timeout = -2; // freeze on respawn
+ WITH(entity, self, frag_target, freezetag_Unfreeze(world)); // remove ice
+ frag_target.health = 0; // Unfreeze resets health
+ frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
return 1;
}
- if(STAT(FROZEN, self))
+ if(STAT(FROZEN, frag_target))
return 1;
- freezetag_Freeze(frag_attacker);
+ WITH(entity, self, frag_target, freezetag_Freeze(frag_attacker));
freezetag_LastPlayerForTeam_Notify();
if(frag_attacker == frag_target || frag_attacker == world)
// ==============
MUTATOR_HOOKFUNCTION(ka, PlayerDies)
-{SELFPARAM();
+{
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
{
if(frag_target.ballcarried) { // add to amount of times killing carrier
PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
}
- if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has died, drop it
+ if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it
return 0;
}
}
MUTATOR_HOOKFUNCTION(kh, PlayerDies)
-{SELFPARAM();
- if(self == other)
- kh_Key_DropAll(self, true);
+{
+ if(frag_target == other)
+ kh_Key_DropAll(frag_target, true);
else if(IS_PLAYER(other))
- kh_Key_DropAll(self, false);
+ kh_Key_DropAll(frag_target, false);
else
- kh_Key_DropAll(self, true);
+ kh_Key_DropAll(frag_target, true);
return 0;
}
}
MUTATOR_HOOKFUNCTION(lms, PlayerDies)
-{SELFPARAM();
- self.respawn_flags |= RESPAWN_FORCE;
-
+{
+ frag_target.respawn_flags |= RESPAWN_FORCE;
return false;
}
}
MUTATOR_HOOKFUNCTION(rc, PlayerDies)
-{SELFPARAM();
- self.respawn_flags |= RESPAWN_FORCE;
- race_AbandonRaceCheck(self);
+{
+ frag_target.respawn_flags |= RESPAWN_FORCE;
+ race_AbandonRaceCheck(frag_target);
return false;
}