Don't explose mine timer in game if random (using Karma value)
authorWuzzy <Wuzzy2@mail.ru>
Sun, 07 Apr 2019 20:01:02 +0200
changeset 14752 56098968df90
parent 14751 430c90fa6062
child 14753 168be33c099a
Don't explose mine timer in game if random (using Karma value)
hedgewars/uGears.pas
hedgewars/uGearsList.pas
hedgewars/uTypes.pas
share/hedgewars/Data/Locale/de.txt
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/uGears.pas	Sun Apr 07 19:31:58 2019 +0200
+++ b/hedgewars/uGears.pas	Sun Apr 07 20:01:02 2019 +0200
@@ -279,14 +279,17 @@
                 if (curHandledGear^.Kind in [gtMine, gtSMine, gtAirMine]) then
                     begin
                     if curHandledGear^.Tex = nil then
-                        begin
-                        i:= curHandledGear^.Timer;
-                        if (i > 0) and (i < 1000)  then
-                            i:= 1
+                        if (curHandledGear^.Karma = 1) and (not (GameType in [gmtDemo, gmtRecord])) then
+                            curHandledGear^.Tex:= RenderStringTex(ansistring(trmsg[sidUnknownGearValue]), $ff808080, fntSmall)
                         else
-                            i:= curHandledGear^.Timer div 1000;
-                        curHandledGear^.Tex:= RenderStringTex(ansistring(inttostr(i)), $ff808080, fntSmall);
-                        end;
+                            begin
+                            i:= curHandledGear^.Timer;
+                            if (i > 0) and (i < 1000)  then
+                                i:= 1
+                            else
+                                i:= curHandledGear^.Timer div 1000;
+                            curHandledGear^.Tex:= RenderStringTex(ansistring(inttostr(i)), $ff808080, fntSmall);
+                            end;
                     end
                 else if ((curHandledGear^.Timer > 500) and ((curHandledGear^.Timer mod 1000) = 0)) then
                     begin
--- a/hedgewars/uGearsList.pas	Sun Apr 07 19:31:58 2019 +0200
+++ b/hedgewars/uGearsList.pas	Sun Apr 07 20:01:02 2019 +0200
@@ -430,9 +430,12 @@
                 if gear^.Timer = 0 then
                     begin
                     if cMinesTime < 0 then
-                        gear^.Timer:= getrandom(51)*100
+                        begin
+                        gear^.Timer:= getrandom(51)*100;
+                        gear^.Karma:= 1;
+                        end
                     else
-                        gear^.Timer:= cMinesTime
+                        gear^.Timer:= cMinesTime;
                     end;
                 gear^.RenderTimer:= true;
                 end;
@@ -450,14 +453,17 @@
                 gear^.Power:= cMaxWindSpeed.QWordValue div 2; // hwFloat converted. 1/2 g default. defines the "seek" speed when a gear is in range.
                 gear^.Pos:= cMaxWindSpeed.QWordValue * 3 div 2; // air friction. slows it down when not hitting stuff
                 gear^.Tag:= 0;
-                gear^.RenderTimer:= true;
                 if gear^.Timer = 0 then
                     begin
                     if cMinesTime < 0 then
-                        gear^.Timer:= getrandom(13)*100
+                        begin
+                        gear^.Timer:= getrandom(13)*100;
+                        gear^.Karma:= 1;
+                        end
                     else
-                        gear^.Timer:= cMinesTime div 4
+                        gear^.Timer:= cMinesTime div 4;
                     end;
+                gear^.RenderTimer:= true;
                 gear^.WDTimer:= gear^.Timer
                 end;
        gtSMine: begin
--- a/hedgewars/uTypes.pas	Sun Apr 07 19:31:58 2019 +0200
+++ b/hedgewars/uTypes.pas	Sun Apr 07 20:01:02 2019 +0200
@@ -509,7 +509,7 @@
             sidWinner2, sidWinner3, sidWinner4, sidWinner5, sidWinner6,
             sidWinner7, sidWinnerAll, sidTeamGone, sidTeamBack, sidAutoSkip,
             sidFPS, sidLuaParsingOff, sidLuaParsingOn, sidLuaParsingDenied,
-            sidAmmoCount, sidChat, sidChatTeam, sidChatHog);
+            sidAmmoCount, sidChat, sidChatTeam, sidChatHog, sidUnknownGearValue);
 
     TCmdHelpStrId = (
             sidCmdHeaderBasic, sidCmdTogglechat, sidCmdTeam, sidCmdMe,
--- a/share/hedgewars/Data/Locale/de.txt	Sun Apr 07 19:31:58 2019 +0200
+++ b/share/hedgewars/Data/Locale/de.txt	Sun Apr 07 20:01:02 2019 +0200
@@ -110,6 +110,7 @@
 01:45=%1: %2
 01:46=[Klan] %1: %2
 01:47=[%1]: %2
+01:48=?
 
 ; Event messages
 ; Hog (%1) died
--- a/share/hedgewars/Data/Locale/en.txt	Sun Apr 07 19:31:58 2019 +0200
+++ b/share/hedgewars/Data/Locale/en.txt	Sun Apr 07 20:01:02 2019 +0200
@@ -115,6 +115,8 @@
 01:46=[Clan] %1: %2
 ; Hedgehog chat. %1 = hog name, %2 = message
 01:47=[%1]: %2
+; Symbol for unknown mine timer
+01:48=?
 
 ; Event messages
 ; Normal hog (%1) died (0 health)