Report long flight archievement
authorunc0rr
Sat, 24 Sep 2011 22:27:20 +0400
changeset 6014 b432c4b9cc9b
parent 6013 4c24f064851e
child 6015 daffc14a518a
Report long flight archievement
hedgewars/HHHandlers.inc
hedgewars/uStats.pas
--- a/hedgewars/HHHandlers.inc	Sat Sep 24 21:21:21 2011 +0400
+++ b/hedgewars/HHHandlers.inc	Sat Sep 24 22:27:20 2011 +0400
@@ -873,7 +873,7 @@
 
 if (hwAbs(Gear^.dY) > _0) and (Gear^.FlightTime > 0) and ((GameFlags and gfLowGravity) = 0) then
     begin
-    inc(Gear^.FlightTime, 1);
+    inc(Gear^.FlightTime);
     if Gear^.FlightTime = 3000 then
         begin
         AddCaption(GetEventString(eidHomerun), cWhiteColor, capgrpMessage);
@@ -882,6 +882,7 @@
     end
 else
     begin
+    uStats.hedgehogFlight(Gear, Gear^.FlightTime);
     Gear^.FlightTime:= 0;
     end;
 
--- a/hedgewars/uStats.pas	Sat Sep 24 21:21:21 2011 +0400
+++ b/hedgewars/uStats.pas	Sat Sep 24 22:27:20 2011 +0400
@@ -33,6 +33,7 @@
 procedure Skipped;
 procedure TurnReaction;
 procedure SendStats;
+procedure hedgehogFlight(Gear: PGear; time: Longword);
 
 implementation
 uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uDebug, uMisc;
@@ -175,6 +176,17 @@
 AmmoDamagingUsed:= AmmoDamagingUsed or Ammoz[am].isDamaging
 end;
 
+procedure hedgehogFlight(Gear: PGear; time: Longword);
+begin
+if time > 4000 then
+    begin
+    writeln('FLIGHT');
+    writeln(Gear^.Hedgehog^.Team^.TeamName);
+    writeln(time);
+    writeln;
+    end
+end;
+
 procedure SendStats;
 var i, t: LongInt;
     msd, msk: Longword; msdhh, mskhh: PHedgehog;
@@ -270,9 +282,10 @@
     writeln('WINNERS');
     for t:= 0 to winnersClan^.TeamsNumber - 1 do
         writeln(winnersClan^.Teams[t]^.TeamName);
-    writeln;
     end else
     writeln('DRAW');
+
+writeln;
 end;
 
 procedure initModule;