Battalion: Standardize the crate pickup message
authorWuzzy <Wuzzy2@mail.ru>
Mon, 12 Feb 2018 15:08:13 +0100
changeset 12984 b6d67e975b51
parent 12983 8d1bc1de9542
child 12985 263d006c56a9
Battalion: Standardize the crate pickup message
share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Feb 12 14:50:06 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Feb 12 15:08:13 2018 +0100
@@ -798,13 +798,9 @@
   -- Add extra 10% of hogs base hp to heal
   healHp = healHp + div(getHogInfo(CurHog, 'maxHp'), 10)
 
-  AddCaption(string.format(loc("+%d"), healHp), msgColor, capgrpMessage)
+  HealHog(CurHog, healHp)
 
   SetEffect(CurHog, hePoisoned, 0)
-  SetHealth(CurHog, hogHealth + healHp)
-  local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtHealthTag, healHp, false)
-  -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint)
-  SetVisualGearValues(effect, nil, nil, nil, nil, nil, nil, nil, nil, nil, msgColor)
 end
 
 --[[
@@ -848,7 +844,7 @@
 
   AddAmmo(CurHog, randAmmo, GetAmmoCount(CurHog, randAmmo) +factor)
   if IsHogLocal(CurHog) then
-    AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage)
+    AddCaption(string.format(loc("%s (+%d)"), GetAmmoName(randAmmo), factor), msgColor, capgrpMessage)
     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randAmmo, nil, nil, nil, msgColor)
   end
@@ -891,7 +887,7 @@
   
   AddAmmo(CurHog, randUtility, GetAmmoCount(CurHog, randUtility) +factor)
   if IsHogLocal(CurHog) then
-    AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage)
+    AddCaption(string.format(loc("%s (+%d)"), GetAmmoName(randUtility), factor), msgColor, capgrpMessage)
     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randUtility, nil, nil, nil, msgColor)
   end