share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
changeset 13029 905449169319
parent 12987 ba99ecc53cf0
child 13030 da691787fcd2
equal deleted inserted replaced
13028:8b6d8418d580 13029:905449169319
   409   ### WEAPON, UTILITY AND AMMO FUNCTIONS                                     ###
   409   ### WEAPON, UTILITY AND AMMO FUNCTIONS                                     ###
   410   ##############################################################################
   410   ##############################################################################
   411 ]]--
   411 ]]--
   412 
   412 
   413 function clearHogAmmo(hog)
   413 function clearHogAmmo(hog)
   414   local lastNum = amRubber
   414   for val=0, AmmoTypeMax do
   415 
       
   416   if amAirMine ~= nil then
       
   417     lastNum = amAirMine
       
   418   end
       
   419 
       
   420   for val=0,lastNum do
       
   421     AddAmmo(hog, val, 0)
   415     AddAmmo(hog, val, 0)
   422   end
   416   end
   423 end
   417 end
   424 
   418 
   425 function autoSelectAmmo(hog, var)
   419 function autoSelectAmmo(hog, var)
  1350 function savePoints(hog)
  1344 function savePoints(hog)
  1351   local team = getHogInfo(hog, 'team')
  1345   local team = getHogInfo(hog, 'team')
  1352   local hogWepPoints = 0
  1346   local hogWepPoints = 0
  1353   local hogHlpPoints = 0
  1347   local hogHlpPoints = 0
  1354 
  1348 
  1355   for ammoType=0,amAirMine do
  1349   for ammoType=0, AmmoTypeMax do
  1356     local ammoCount = GetAmmoCount(hog, ammoType)
  1350     local ammoCount = GetAmmoCount(hog, ammoType)
  1357 
  1351 
  1358     if pointsWeaponVal[ammoType] ~= nil then
  1352     if pointsWeaponVal[ammoType] ~= nil then
  1359       hogWepPoints = hogWepPoints + (pointsWeaponVal[ammoType] * ammoCount)
  1353       hogWepPoints = hogWepPoints + (pointsWeaponVal[ammoType] * ammoCount)
  1360     elseif pointsHelperVal[ammoType] ~= nil then
  1354     elseif pointsHelperVal[ammoType] ~= nil then
  1481   ### GAME START FUNCTIONS                                                   ###
  1475   ### GAME START FUNCTIONS                                                   ###
  1482   ##############################################################################
  1476   ##############################################################################
  1483 ]]--
  1477 ]]--
  1484 
  1478 
  1485 function onAmmoStoreInit()
  1479 function onAmmoStoreInit()
  1486   local lastNum = amAirMine
  1480   for val=0, AmmoTypeMax do
  1487 
       
  1488   for val=0,lastNum do
       
  1489     SetAmmo(val, 0, 0, 0, 0)
  1481     SetAmmo(val, 0, 0, 0, 0)
  1490   end
  1482   end
  1491 end
  1483 end
  1492 
  1484 
  1493 function onParameters()
  1485 function onParameters()