share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
changeset 12979 b6d67e975b51
parent 12978 8d1bc1de9542
child 12980 263d006c56a9
equal deleted inserted replaced
12978:8d1bc1de9542 12979:b6d67e975b51
   796   healHp = 5 * factor
   796   healHp = 5 * factor
   797 
   797 
   798   -- Add extra 10% of hogs base hp to heal
   798   -- Add extra 10% of hogs base hp to heal
   799   healHp = healHp + div(getHogInfo(CurHog, 'maxHp'), 10)
   799   healHp = healHp + div(getHogInfo(CurHog, 'maxHp'), 10)
   800 
   800 
   801   AddCaption(string.format(loc("+%d"), healHp), msgColor, capgrpMessage)
   801   HealHog(CurHog, healHp)
   802 
   802 
   803   SetEffect(CurHog, hePoisoned, 0)
   803   SetEffect(CurHog, hePoisoned, 0)
   804   SetHealth(CurHog, hogHealth + healHp)
       
   805   local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtHealthTag, healHp, false)
       
   806   -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint)
       
   807   SetVisualGearValues(effect, nil, nil, nil, nil, nil, nil, nil, nil, nil, msgColor)
       
   808 end
   804 end
   809 
   805 
   810 --[[
   806 --[[
   811  : Adds either 1 (95% chance) or 2 (5% chance) random weapon(s) based on the hog variant.
   807  : Adds either 1 (95% chance) or 2 (5% chance) random weapon(s) based on the hog variant.
   812  :
   808  :
   846     randAmmo = possibleWeapons[randIndex]
   842     randAmmo = possibleWeapons[randIndex]
   847   end
   843   end
   848 
   844 
   849   AddAmmo(CurHog, randAmmo, GetAmmoCount(CurHog, randAmmo) +factor)
   845   AddAmmo(CurHog, randAmmo, GetAmmoCount(CurHog, randAmmo) +factor)
   850   if IsHogLocal(CurHog) then
   846   if IsHogLocal(CurHog) then
   851     AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage)
   847     AddCaption(string.format(loc("%s (+%d)"), GetAmmoName(randAmmo), factor), msgColor, capgrpMessage)
   852     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
   848     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
   853     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randAmmo, nil, nil, nil, msgColor)
   849     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randAmmo, nil, nil, nil, msgColor)
   854   end
   850   end
   855 end
   851 end
   856 --[[
   852 --[[
   889     randUtility = possibleHelpers[randIndex]
   885     randUtility = possibleHelpers[randIndex]
   890   end
   886   end
   891   
   887   
   892   AddAmmo(CurHog, randUtility, GetAmmoCount(CurHog, randUtility) +factor)
   888   AddAmmo(CurHog, randUtility, GetAmmoCount(CurHog, randUtility) +factor)
   893   if IsHogLocal(CurHog) then
   889   if IsHogLocal(CurHog) then
   894     AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage)
   890     AddCaption(string.format(loc("%s (+%d)"), GetAmmoName(randUtility), factor), msgColor, capgrpMessage)
   895     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
   891     local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true)
   896     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randUtility, nil, nil, nil, msgColor)
   892     SetVisualGearValues(effect, nil, nil, nil, nil, nil, randUtility, nil, nil, nil, msgColor)
   897   end
   893   end
   898 end
   894 end
   899 
   895