share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
changeset 15428 c95efbab66e6
parent 15128 40537955de63
child 15429 c0ad952894d9
equal deleted inserted replaced
15427:b704b0c11129 15428:c95efbab66e6
   750   local hogNum = teamIndex[team]
   750   local hogNum = teamIndex[team]
   751   local hogVar = group[team][hogNum]
   751   local hogVar = group[team][hogNum]
   752 
   752 
   753   hogInfo[hog]['variant'] = hogVar
   753   hogInfo[hog]['variant'] = hogVar
   754   SetHealth(hog, variants[hogVar]["hp"])
   754   SetHealth(hog, variants[hogVar]["hp"])
       
   755   hogInfo[hog]['maxHp'] = variants[hogVar]["hp"]
   755 end
   756 end
   756 
   757 
   757 function getHogInfo(hog, info)
   758 function getHogInfo(hog, info)
   758   if hog == nil then
   759   if hog == nil then
   759     WriteLnToChat("ERROR [getHogInfo]: hog is nil!")
   760     WriteLnToChat("ERROR [getHogInfo]: hog is nil!")
  1148         i = i +1
  1149         i = i +1
  1149       end
  1150       end
  1150     end
  1151     end
  1151 
  1152 
  1152     hpDiff = div(deathMaxHP * highEnemyKillHPBonus, 100)
  1153     hpDiff = div(deathMaxHP * highEnemyKillHPBonus, 100)
  1153     newHP = curHP + hpDiff
  1154     HealHog(CurHog, hpDiff)
  1154     HealHog(CurHog, newHP)
       
  1155   -- Friendly fire! Punish hog by removing weapons and helpers from pool
  1155   -- Friendly fire! Punish hog by removing weapons and helpers from pool
  1156   -- and reduce health
  1156   -- and reduce health
  1157   else
  1157   else
  1158     highWeapons[CurHog] = {}
  1158     highWeapons[CurHog] = {}
  1159     highHelpers[CurHog] = {}
  1159     highHelpers[CurHog] = {}