# HG changeset patch # User Wuzzy # Date 1518474187 -3600 # Node ID c08c53624c0f9a375c32aa6b6cce47b670480a88 # Parent a15413d896c392ad572c667a564fcfb49f1c9e4e Show remaining ammo when using Birdy egg or RC Plane bomb diff -r a15413d896c3 -r c08c53624c0f ChangeLog.txt --- a/ChangeLog.txt Mon Feb 12 22:22:27 2018 +0100 +++ b/ChangeLog.txt Mon Feb 12 23:23:07 2018 +0100 @@ -5,6 +5,7 @@ + New weapon: Minigun + Change weapon icons: Mudball, air mine + Add healing visual effect in Paramedics mode and a few scripts + + Show remaining ammo when using Birdy egg or RC Plane bomb * Fix time box being usable in Sudden Death with 0 health decrease * Fix chat input key being sometimes registered twice diff -r a15413d896c3 -r c08c53624c0f hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Mon Feb 12 22:22:27 2018 +0100 +++ b/hedgewars/uGearsHandlersMess.pas Mon Feb 12 23:23:07 2018 +0100 @@ -3812,6 +3812,7 @@ var HHGear: PGear; i: LongInt; + s: ansistring; dX, dY : hwFloat; fChanged: boolean; trueAngle: Longword; @@ -3890,12 +3891,17 @@ else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); - if (HHGear <> nil) and ((HHGear^.Message and gmAttack) <> 0) and (Gear^.Health <> 0) then - begin - HHGear^.Message := HHGear^.Message and (not gmAttack); - AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * - _0_5, 0); - dec(Gear^.Health) + if (HHGear <> nil) and ((HHGear^.Message and gmAttack) <> 0) then + begin + if (Gear^.Health) <> 0 then + begin + HHGear^.Message := HHGear^.Message and (not gmAttack); + AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * + _0_5, 0); + dec(Gear^.Health) + end; + s:= ansistring(inttostr(Gear^.Health)); + AddCaption(formatA(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate); end; if (HHGear <> nil) and ((HHGear^.Message and gmLJump) <> 0) and ((Gear^.State and gsttmpFlag) = 0) then @@ -4156,6 +4162,7 @@ HHGear: PGear; fuel, i: LongInt; move: hwFloat; + s: ansistring; begin HHGear := Gear^.Hedgehog^.Gear; if HHGear = nil then @@ -4217,6 +4224,8 @@ PlaySound(sndBirdyLay); dec(Gear^.FlightTime) end; + s:= ansistring(inttostr(Gear^.FlightTime)); + AddCaption(formatA(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate); end; if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then