# HG changeset patch # User Wuzzy # Date 1554672067 -7200 # Node ID c6b7f4a4122c549b121e398466e8c2b3c3cb750e # Parent bc0e86b0347b2a2635b6d0513b5f5914f4bd2398 Hide health of fake health crates diff -r bc0e86b0347b -r c6b7f4a4122c hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Apr 07 23:08:33 2019 +0200 +++ b/hedgewars/uGears.pas Sun Apr 07 23:21:07 2019 +0200 @@ -1151,6 +1151,7 @@ begin gear^.Pos := gear^.Pos + posCaseHealth; gear^.RenderHealth:= true; + gear^.Karma:= 2; // health crate is smaller than the other crates gear^.Radius := cCaseHealthRadius; if(FinishedTurnsTotal > -1) then diff -r bc0e86b0347b -r c6b7f4a4122c hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Sun Apr 07 23:08:33 2019 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Sun Apr 07 23:21:07 2019 +0200 @@ -2482,7 +2482,15 @@ begin FreeAndNilTexture(Gear^.Tex); if ((Gear^.State and gstFrozen) = 0) then - Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff80ff80, fnt16); + // Karma=2: Always hide health + if (Gear^.Karma = 2) then + Gear^.Tex := RenderStringTex(ansistring(trmsg[sidUnknownGearValue]), $ff80ff80, fnt16) + // Karma=1: Hide health in game, but show in demo + else if (Gear^.Karma = 1) and (GameType in [gmtDemo, gmtRecord]) then + Gear^.Tex := RenderStringTex(ansistring(trmsg[sidUnknownGearValue]), $ff80ff80, fnt16) + // Always show health (default) + else + Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff80ff80, fnt16); end; if Gear^.Timer = 500 then begin