if not(targ.classname == STR_PLAYER) { backtrace("Obituary called on non-player?!\n"); return; }
// Declarations
- string s1 = "", s2 = "";
- float f1 = 0, f2 = 0, f3 = 0;
float notif_firstblood = FALSE;
//dprint(sprintf("Obituary(): Deathtype = %s (%d), Attacker = %s, Inflictor = %s, Target = %s...\n", Deathtype_Name(deathtype), deathtype, attacker.netname, inflictor.netname, targ.netname));
{
if(deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
{
- s1 = targ.netname;
- f1 = targ.team;
+ Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, "", targ.team, 0, 0);
}
else
{
{
case DEATH_MIRRORDAMAGE:
{
- s1 = targ.netname;
- f1 = targ.killcount;
+ Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, "", targ.killcount, 0, 0);
break;
}
default:
{
- s1 = targ.netname;
- f1 = targ.killcount;
- s2 = "";
- f2 = f3 = 0;
+ Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, "", targ.killcount, 0, 0);
break;
}
}
LogDeath("suicide", deathtype, targ, targ);
GiveFrags(attacker, targ, -1, deathtype);
}
-
- Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, 0);
}
else if not(Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, "", targ.killcount, 0))
{
// ======
else if(attacker.classname == "player")
{
- s1 = attacker.netname;
- s2 = targ.netname;
-
if(!IsDifferentTeam(attacker, targ))
{
LogDeath("tk", deathtype, attacker, targ);
attacker.killcount = 0;
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, s2);
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, s1);
- Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), s2, s1, targ.killcount);
+ Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname);
+ Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname);
+ Send_Notification(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), targ.netname, attacker.netname, targ.killcount);
// In this case, the death message will ALWAYS be "foo was betrayed by bar"
// No need for specific death/weapon messages...
PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
}
- /*if(notif_firstblood) // first blood, no kill sprees yet
- {
- if(targ.istypefrag)
- {
- if(attacker.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE, targ.netname, -1, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG_FIRST, targ.netname, -1);
-
- if(targ.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE, attacker.netname, -2, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST, attacker.netname, -2);
- }
- else
- {
- if(attacker.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_FIRST_VERBOSE, targ.netname, -1, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_FIRST, targ.netname, -1);
-
- if(targ.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED_FIRST_VERBOSE, attacker.netname, -2, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED_FIRST, attacker.netname, -2);
- }
-
- // -1 means firstblood
- if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, -1, -1))
- Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, -1, -1, 0);
- }
- else // normal frags, kill sprees listed
- {
- if(targ.istypefrag)
- {
- if(attacker.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE, targ.netname, attacker.killcount, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, targ.netname, attacker.killcount);
-
- if(targ.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, attacker.netname, 0, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, attacker.netname, 0);
- }
- else
- {
- if(attacker.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_VERBOSE, targ.netname, attacker.killcount, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, targ.netname, attacker.killcount);
-
- if(targ.FRAG_VERBOSE)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED_VERBOSE, attacker.netname, 0, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, attacker.netname, 0);
- }
-
- if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, targ.killcount, attacker.killcount))
- Obituary_SpecialDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, targ.killcount, attacker.killcount, 0);
- }*/
-
float kill_count_to_attacker;
float kill_count_to_target;
if(notif_firstblood)
case DEATH_CUSTOM:
{
- s1 = targ.netname;
- s2 = deathmessage;
- f1 = targ.killcount;
- if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
- f2 = f3 = 0;
+ Obituary_SpecialDeath(targ, FALSE, deathtype,
+ targ.netname,
+ ((strstrofs(deathmessage, "%", 0) < 0) ? strcat("%s ", deathmessage) : deathmessage),
+ targ.killcount,
+ 0,
+ 0);
break;
}
default:
{
- s1 = targ.netname;
- f1 = targ.killcount;
- s2 = "";
- f2 = f3 = 0;
+ Obituary_SpecialDeath(targ, FALSE, deathtype, targ.netname, "", targ.killcount, 0, 0);
break;
}
}
AnnounceTo(targ, "botlike");
PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
}
-
- Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, f3);
}
// Set final information for the death