share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
changeset 14774 dd4daa216398
parent 14772 458a8c4e65ca
child 15130 9e1e234a417c
equal deleted inserted replaced
14773:185f07ec4d12 14774:dd4daa216398
   921       onUtilityCratePickup(crate)
   921       onUtilityCratePickup(crate)
   922     end
   922     end
   923   end
   923   end
   924 end
   924 end
   925 
   925 
   926 function RandomTurnEvents()
   926 function onCaseDrop()
   927   if GetRandom(100) < weaponCrateChance then
   927   if GetRandom(100) < weaponCrateChance then
   928     SpawnFakeAmmoCrate(0, 0, false, false)
   928     SpawnFakeAmmoCrate(0, 0, false, false)
   929     return 5000
   929     PlaySound(sndReinforce, CurrentHedgehog)
   930   elseif GetRandom(100) < utilCrateChance then
   930   elseif GetRandom(100) < utilCrateChance then
   931     SpawnFakeUtilityCrate(0, 0, false, false)
   931     SpawnFakeUtilityCrate(0, 0, false, false)
   932     return 5000
   932     PlaySound(sndReinforce, CurrentHedgehog)
   933   elseif GetRandom(100) < healthCrateChance then
   933   elseif GetRandom(100) < healthCrateChance then
   934     SpawnFakeHealthCrate(0, 0, false, false)
   934     SpawnFakeHealthCrate(0, 0, false, false)
   935     return 5000
   935     PlaySound(sndReinforce, CurrentHedgehog)
   936   end
   936   end
   937   return 0
       
   938 end
   937 end
   939 
   938 
   940 --[[
   939 --[[
   941   ##############################################################################
   940   ##############################################################################
   942   ### SUDDEN DEATH FUNCTIONS                                                 ###
   941   ### SUDDEN DEATH FUNCTIONS                                                 ###
  1350 
  1349 
  1351   -- When we are on points mode count remaining weapon/helper points
  1350   -- When we are on points mode count remaining weapon/helper points
  1352   if mode == 'points' and GetHealth(CurHog) ~= nil then
  1351   if mode == 'points' and GetHealth(CurHog) ~= nil then
  1353     savePoints(CurHog)
  1352     savePoints(CurHog)
  1354   end
  1353   end
  1355 
       
  1356   -- Run random turn events
       
  1357   RandomTurnEvents()
       
  1358 end
  1354 end
  1359 
  1355 
  1360 function savePoints(hog)
  1356 function savePoints(hog)
  1361   local team = getHogInfo(hog, 'team')
  1357   local team = getHogInfo(hog, 'team')
  1362   local hogWepPoints = 0
  1358   local hogWepPoints = 0