PlayerScore_Add(targ, SP_DEATHS, 1);
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+
if(targ != attacker) // not for suicides
if(g_weaponarena_random)
{
// after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
Weapon culprit = DEATH_WEAPONOF(deathtype);
- if(!culprit) culprit = PS(attacker).m_weapon;
- else if(!(attacker.weapons & (culprit.m_wepset))) culprit = PS(attacker).m_weapon;
+ if(!culprit) culprit = attacker.(weaponentity).m_weapon;
+ else if(!(attacker.weapons & (culprit.m_wepset))) culprit = attacker.(weaponentity).m_weapon;
if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
{
}
// after a frag, choose another random weapon set
- if (!(attacker.weapons & WepSet_FromWeapon(PS(attacker).m_weapon)))
- W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker));
+ if (!(attacker.weapons & WepSet_FromWeapon(attacker.(weaponentity).m_weapon)))
+ W_SwitchWeapon_Force(attacker, w_getbestweapon(attacker, weaponentity), weaponentity);
}
// FIXME fix the mess this is (we have REAL points now!)
string AppendItemcodes(string s, entity player)
{
- int w = PS(player).m_weapon.m_id;
- //if(w == 0)
- // w = player.switchweapon;
- if(w == 0)
- w = player.cnt; // previous weapon!
- s = strcat(s, ftos(w));
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ int w = player.(weaponentity).m_weapon.m_id;
+ if(w == 0)
+ w = player.(weaponentity).cnt; // previous weapon
+ if(w != 0 || slot == 0)
+ s = strcat(s, ftos(w));
+ }
if(time < player.strength_finished)
s = strcat(s, "S");
if(time < player.invincible_finished)
return false;
}
+bool frag_centermessage_override(entity attacker, entity targ, int deathtype, int kill_count_to_attacker, int kill_count_to_target)
+{
+ if(deathtype == DEATH_FIRE.m_id)
+ {
+ Send_Notification(NOTIF_ONE, attacker, MSG_CHOICE, CHOICE_FRAG_FIRE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? -1 : targ.ping));
+ Send_Notification(NOTIF_ONE, targ, MSG_CHOICE, CHOICE_FRAGGED_FIRE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? -1 : attacker.ping));
+ return true;
+ }
+
+ return MUTATOR_CALLHOOK(FragCenterMessage, attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target);
+}
+
.int buffs = _STAT(BUFFS); // TODO: remove
entity buff_FirstFromFlags(int _buffs);
void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
// Set final information for the death
targ.death_origin = targ.origin;
- if(targ != attacker) { targ.killer_origin = attacker.origin; }
string deathlocation = (autocvar_notification_server_allows_location ? NearestLocation(targ.death_origin) : "");
#ifdef NOTIFICATIONS_DEBUG
(IS_BOT_CLIENT(attacker) ? -1 : attacker.ping)
);
}
- else
+ else if(!frag_centermessage_override(attacker, targ, deathtype, kill_count_to_attacker, kill_count_to_target))
{
Send_Notification(
NOTIF_ONE,
Ice_Think(ice);
- RemoveGrapplingHook(targ);
+ RemoveGrapplingHooks(targ);
- FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == targ, LAMBDA(RemoveGrapplingHook(it)));
+ FOREACH_CLIENT(IS_PLAYER(it),
+ {
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(it.(weaponentity).hook.aiment == targ)
+ RemoveHook(it.(weaponentity).hook);
+ }
+ });
// add waypoint
if(show_waypoint)
return;
if(STAT(FROZEN, targ) && STAT(FROZEN, targ) != 3) // only reset health if target was frozen
+ {
targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health);
+ targ.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
+ }
STAT(FROZEN, targ) = 0;
targ.revive_progress = 0;
WaypointSprite_Kill(targ.waypointsprite_attached);
- FOREACH_CLIENT(IS_PLAYER(it) && it.hook.aiment == targ, LAMBDA(RemoveGrapplingHook(it)));
+ FOREACH_CLIENT(IS_PLAYER(it),
+ {
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(it.(weaponentity).hook.aiment == targ)
+ RemoveHook(it.(weaponentity).hook);
+ }
+ });
// remove the ice block
if(targ.iceblock)
attacker_save = attacker;
if(IS_PLAYER(targ))
- if(targ.hook)
- if(targ.hook.aiment)
- if(targ.hook.aiment == attacker)
- RemoveGrapplingHook(targ); // STOP THAT, you parasite!
+ {
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(targ.(weaponentity).hook && targ.(weaponentity).hook.aiment == attacker)
+ RemoveHook(targ.(weaponentity).hook);
+ }
+ }
// special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))