--- a/hedgewars/uStats.pas Tue Jun 11 11:48:36 2013 +0200
+++ b/hedgewars/uStats.pas Tue Aug 06 00:26:07 2013 +0400
@@ -34,9 +34,10 @@
procedure TurnReaction;
procedure SendStats;
procedure hedgehogFlight(Gear: PGear; time: Longword);
+procedure declareAchievement(id, teamname: shortstring; value: LongInt);
implementation
-uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uDebug, uMisc, uConsole;
+uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uDebug, uMisc, uConsole, uScript;
var DamageClan : Longword = 0;
DamageTotal : Longword = 0;
@@ -297,15 +298,29 @@
if winnersClan <> nil then
begin
WriteLnToConsole('WINNERS');
+ WriteLnToConsole(inttostr(winnersClan^.TeamsNumber));
for t:= 0 to winnersClan^.TeamsNumber - 1 do
WriteLnToConsole(winnersClan^.Teams[t]^.TeamName);
end
else
WriteLnToConsole('DRAW');
+ScriptCall('onAchievementsDeclaration');
++end;
+
WriteLnToConsole('');
end;
+procedure declareAchievement(id, teamname: shortstring; value: LongInt);
+begin
+ if (length(id) = 0) or (length(teamname) = 0) then exit;
+ WriteLnToConsole('ACHIEVEMENT');
+ WriteLnToConsole(id);
+ WriteLnToConsole(teamname);
+ WriteLnToConsole(inttostr(value));
+end;
+
+
procedure initModule;
begin
TotalRounds:= -1;