hedgewars/uStats.pas
branch0.9.19
changeset 9135 151c8e553de2
parent 9080 9b42757d7e71
child 9138 9e94a9bc8c7e
--- 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;