--- a/hedgewars/uTeams.pas Thu Jan 04 16:27:45 2007 +0000
+++ b/hedgewars/uTeams.pas Thu Jan 04 18:54:24 2007 +0000
@@ -34,6 +34,8 @@
AttacksNum: Longword;
visStepPos: LongWord;
BotLevel : LongWord; // 0 - Human player
+ DamageGiven: Longword;
+ MaxStepDamage: Longword;
end;
TTeam = record
Next: PTeam;
@@ -67,6 +69,7 @@
procedure RestoreTeamsFromSave;
function CheckForWin: boolean;
procedure SetWeapon(weap: TAmmoType);
+procedure SendStats;
implementation
uses uMisc, uWorld, uAI, uLocale, uConsole;
@@ -109,6 +112,7 @@
SendStat(siGameResult, s);
AddGear(0, 0, gtATFinishGame, 0, 0, 0, 2000)
end;
+SendStats
end;
procedure SwitchHedgehog;
@@ -317,6 +321,28 @@
end
end;
+procedure SendStats;
+var p: PTeam;
+ i: integer;
+ msd: Longword; msdhh: PHedgehog;
+begin
+msd:= 0; msdhh:= nil;
+p:= TeamsList;
+while p <> nil do
+ begin
+ for i:= 0 to cMaxHHIndex do
+ if p.Hedgehogs[i].MaxStepDamage > msd then
+ begin
+ msdhh:= @p.Hedgehogs[i];
+ msd:= p.Hedgehogs[i].MaxStepDamage
+ end;
+ p:= p.Next
+ end;
+if msdhh <> nil then SendStat(siMaxStepDamage, inttostr(msdhh.MaxStepDamage) + ' ' +
+ msdhh.Name + ' (' + msdhh.Team.TeamName + ')');
+if KilledHHs > 0 then SendStat(siKilledHHs, inttostr(KilledHHs));
+end;
+
initialization
finalization