Make the timer red when it is the get-away time
authorWuzzy <almikes@aol.com>
Sat, 30 Apr 2016 20:55:16 +0200
changeset 11918 232b57a70aca
parent 11917 d3a852554aa7
child 11919 c9bad8a01185
Make the timer red when it is the get-away time
hedgewars/uGearsHedgehog.pas
hedgewars/uTeams.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
--- a/hedgewars/uGearsHedgehog.pas	Sat Apr 30 20:35:55 2016 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Sat Apr 30 20:55:16 2016 +0200
@@ -559,6 +559,7 @@
                 if (CurAmmoGear <> nil) and (CurAmmoGear^.State and gstSubmersible <> 0) and CheckCoordInWater(hwRound(CurAmmoGear^.X), hwRound(CurAmmoGear^.Y)) then
                      TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 25
                 else TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
+                IsGetAwayTime := true;
                 end;
             if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then
                 HHGear^.State:= HHGear^.State or gstAttacked;
--- a/hedgewars/uTeams.pas	Sat Apr 30 20:35:55 2016 +0200
+++ b/hedgewars/uTeams.pas	Sat Apr 30 20:55:16 2016 +0200
@@ -320,6 +320,7 @@
     TagTurnTimeLeft:= 0;
     NextClan:= false;
     end;
+IsGetAwayTime:= false;
 
 if (TurnTimeLeft > 0) and (CurrentHedgehog^.BotLevel = 0) then
     begin
--- a/hedgewars/uVariables.pas	Sat Apr 30 20:35:55 2016 +0200
+++ b/hedgewars/uVariables.pas	Sat Apr 30 20:55:16 2016 +0200
@@ -96,6 +96,7 @@
     TurnClockActive : boolean;
     TagTurnTimeLeft : Longword;
     ReadyTimeLeft   : Longword;
+    IsGetAwayTime   : boolean;
     cSuddenDTurns   : LongInt;
     cDamagePercent  : LongInt;
     cMineDudPercent : LongWord;
@@ -2652,6 +2653,7 @@
     LeftImpactTimer     := 0;
     RightImpactTimer    := 0;
     TurnTimeLeft        := 0;
+    IsGetAwayTime       := false;
     TurnClockActive     := true;
     TagTurnTimeLeft     := 0;
     cSuddenDTurns       := 15;
--- a/hedgewars/uWorld.pas	Sat Apr 30 20:35:55 2016 +0200
+++ b/hedgewars/uWorld.pas	Sat Apr 30 20:55:16 2016 +0200
@@ -1444,6 +1444,8 @@
             dec(t, 32);
             if (ReadyTimeLeft <> 0) then
                 spr := sprBigDigitGreen
+            else if IsGetAwayTime then
+                spr := sprBigDigitRed
             else
                 spr := sprBigDigit;
             DrawSprite(spr, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);