kill logs changes

-logs removed from LastManStanding
-additional callbacks added
stable-5.1
David Dormagen 2010-12-13 23:35:32 +01:00
parent 3c81601719
commit bf4b2ca37e
6 changed files with 50 additions and 41 deletions

View File

@ -67,8 +67,8 @@ protected func RelaunchPlayer(int plr, int killer)
if (GetRelaunchCount(plr) < 0)
return EliminatePlayer(plr);
// Log messages.
LogKill(killer, plr);
// the kill logs rule cares about logging the respawn
// ..
// Kill bonus: 1 extra relaunch per MIME_KillsToRelaunch kills.
// Only if killer exists and has not committed suicide.
@ -136,17 +136,11 @@ protected func RemovePlayer(int plr)
/*-- Statistics --*/
private func LogKill(int killer, int victim)
func GetAdditionalPlayerRelaunchString(object clonk, int victim, int killer)
{
var msg;
// Determine kill-part.
if (killer == victim || !GetPlayerName(killer)) // Suicide or unknown killer.
msg = Format("$MsgSelfKill$", GetPlayerName(victim));
else if (GetPlayerTeam(killer) && GetPlayerTeam(killer) == GetPlayerTeam(victim)) // Teamkill.
msg = Format("$MsgTeamKill$", GetPlayerName(victim), GetPlayerName(killer));
else // Normal kill.
msg = Format("$MsgKill$", GetPlayerName(victim), GetPlayerName(killer));
// Determine relaunch part.
if(!GetPlayerName(victim)) return;
var msg=GetTaggedPlayerName(victim);
if (GetRelaunchCount(victim) < 0) // Player eliminated.
msg = Format("%s %s", msg, "$MsgFail$");
else if (GetRelaunchCount(victim) == 0) // Last relaunch.
@ -155,9 +149,8 @@ private func LogKill(int killer, int victim)
msg = Format("%s %s", msg, "$MsgRelaunch1$");
else // Multiple relaunches remaining.
msg = Format("%s %s", msg, Format("$MsgRelaunchX$", GetRelaunchCount(victim)));
// Log message.
Log(msg);
return;
return msg;
}
local Name = "$Name$";

View File

@ -1,13 +1,9 @@
Name=Last Man Standing
MsgKill=%s wurde von %s getötet und hat
MsgSelfKill=%s ist gestorben und hat
MsgTeamKill=%s wurde von seinem Kameraden %s getötet und hat
MsgRelaunch0=keine Relaunches mehr übrig.
MsgRelaunch1=noch einen Relauch übrig.
MsgRelaunchX=noch %d Relaunches übrig.
MsgFail=verloren.
MsgRelaunch0=hat keine Relaunches mehr übrig.
MsgRelaunch1=hat noch einen Relauch übrig.
MsgRelaunchX=hat noch %d Relaunches übrig.
MsgFail=hat verloren.
MsgRelaunchGained=%s has made four kills and gained a relaunch.

View File

@ -1,13 +1,9 @@
Name=Last Man Standing
MsgKill=%s was killed by %s, and has
MsgSelfKill=%s died, and has
MsgTeamKill=%s was killed by its teammate %s, and has
MsgRelaunch0=no relaunches left.
MsgRelaunch1=one relaunch left.
MsgRelaunchX=%d relaunches left.
MsgFail=lost.
MsgRelaunch0=has no relaunches left.
MsgRelaunch1=has one relaunch left.
MsgRelaunchX=has %d relaunches left.
MsgFail=is out.
MsgRelaunchGained=%s has made four kills and gained a relaunch.

View File

@ -19,17 +19,39 @@ func OnClonkDeath(object clonk, int killed_by)
// Only log for existing players and clonks.
if (plr == NO_OWNER || !GetPlayerName(plr) || !clonk)
return;
ScheduleCall(this, "OnClonkDeathEx", 1, 0, clonk, plr, killed_by);
return _inherited(clonk, killed_by, ...);
}
func OnClonkDeathEx(object clonk, int plr, int killed_by)
{
if(!GetPlayerName(plr)) return;
var name="Clonk";
if(clonk) name=clonk.Prototype->GetName();
// Assert there are three StringTbl entries for each.
var which_one = Random(3) + 1;
var log="";
if (!GetPlayerName(killed_by))
return Log(Translate(Format("KilledByGaya%d", which_one)), GetTaggedPlayerName(plr), clonk.Prototype->GetName());
if (plr == killed_by)
return Log(Translate(Format("Selfkill%d", which_one)), GetTaggedPlayerName(plr), clonk.Prototype->GetName());
if (!Hostile(plr,killed_by))
return Log(Translate(Format("Teamkill%d", which_one)), GetTaggedPlayerName(plr), clonk.Prototype->GetName(), GetTaggedPlayerName(killed_by));
Log(Translate(Format("KilledByPlayer%d", which_one)), GetTaggedPlayerName(plr), clonk.Prototype->GetName(), GetTaggedPlayerName(killed_by));
log=Format(Translate(Format("KilledByGaya%d", which_one)), GetTaggedPlayerName(plr), name);
else if (plr == killed_by)
log=Format(Translate(Format("Selfkill%d", which_one)), GetTaggedPlayerName(plr), name);
else if (!Hostile(plr,killed_by))
log=Format(Translate(Format("Teamkill%d", which_one)), GetTaggedPlayerName(plr), name, GetTaggedPlayerName(killed_by));
else log=Format(Translate(Format("KilledByPlayer%d", which_one)), GetTaggedPlayerName(plr), name, GetTaggedPlayerName(killed_by));
var relaunches=GameCall("GetPlayerRelaunches", plr);
if(relaunches != nil)
{
log=Format("%s %s", log, Format(Translate("Relaunches"), GetTaggedPlayerName(plr), relaunches));
}
var other=GameCall("GetAdditionalPlayerRelaunchString", clonk, plr, killed_by);
if(other)
{
log=Format("%s %s", log, other);
}
Log(log);
}
local Name = "$Name$";

View File

@ -12,4 +12,5 @@ KilledByGaya2=%ss %s stirbt von alleine.
KilledByGaya3=%s hat einen %s an Gaya verloren.
Teamkill1=%s hat einen %s an %s verloren. Teamkiller!
Teamkill2=%ss %s ist bei %s in Ungnade gefallen.
Teamkill3=%ss %s wurde von %s sauber hintergangen.
Teamkill3=%ss %s wurde von %s sauber hintergangen.
Relaunches=%s hat %d Relaunches übrig!

View File

@ -12,4 +12,5 @@ KilledByGaya2=%s's %s dies on its own.
KilledByGaya3=%s lost a %s to Gaya.
Teamkill1=%s has lost a %s to %s. Teamkiller!
Teamkill2=%s's %s fell out of %s's favour.
Teamkill3=%s's %s was denied by %s.
Teamkill3=%s's %s was denied by %s.
Relaunches=%s has %d relaunches left!