# HG changeset patch # User Wuzzy # Date 1554660062 -7200 # Node ID 56098968df90f6ab023c2d21c45ece1e6612064e # Parent 430c90fa6062cadd2417da0349e13c033d3e5bd3 Don't explose mine timer in game if random (using Karma value) diff -r 430c90fa6062 -r 56098968df90 hedgewars/uGears.pas --- 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 diff -r 430c90fa6062 -r 56098968df90 hedgewars/uGearsList.pas --- 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 diff -r 430c90fa6062 -r 56098968df90 hedgewars/uTypes.pas --- 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, diff -r 430c90fa6062 -r 56098968df90 share/hedgewars/Data/Locale/de.txt --- 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 diff -r 430c90fa6062 -r 56098968df90 share/hedgewars/Data/Locale/en.txt --- 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)