share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
changeset 12308 82951b9b3c2f
parent 12302 f7919a4df898
child 12309 6b34067a6344
equal deleted inserted replaced
12307:cbc34bb96b1f 12308:82951b9b3c2f
   116 local wepArray = {}
   116 local wepArray = {}
   117 
   117 
   118 local atkChoices = {}
   118 local atkChoices = {}
   119 local utilChoices = {}
   119 local utilChoices = {}
   120 
   120 
   121 local currHog
       
   122 local lastHog
       
   123 local started = false
   121 local started = false
   124 local switchStage = 0
   122 local switchStage = 0
   125 
   123 
   126 local lastWep = amNothing
   124 local lastWep = amNothing
   127 local shotsFired = 0
   125 local shotsFired = 0
   309 
   307 
   310 	runOnGears(StartingSetUp)
   308 	runOnGears(StartingSetUp)
   311 	runOnGears(ConvertValues)
   309 	runOnGears(ConvertValues)
   312 end
   310 end
   313 
   311 
   314 function CheckForHogSwitch()
   312 function AssignHogAmmo()
   315 
   313 	-- Re-assign ammo to this guy, so that his entire ammo set will
   316 	if (CurrentHedgehog ~= nil) then
   314 	-- be visible during another player's turn
   317 
   315 	if lastHog ~= nil then
   318 		currHog = CurrentHedgehog
   316 		ConvertValues(lastHog)
   319 
   317 	end
   320 		if currHog ~= lastHog then
   318 
   321 
   319 	-- Give the new hog what he is supposed to have, too
   322 			-- re-assign ammo to this guy, so that his entire ammo set will
   320 	ConvertValues(CurrentHedgehog)
   323 			-- be visible during another player's turn
       
   324 			if lastHog ~= nil then
       
   325 				ConvertValues(lastHog)
       
   326 			end
       
   327 
       
   328 			-- give the new hog what he is supposed to have, too
       
   329 			ConvertValues(CurrentHedgehog)
       
   330 
       
   331 		end
       
   332 
       
   333 		lastHog = currHog
       
   334 
       
   335 	end
       
   336 
       
   337 end
   321 end
   338 
   322 
   339 function onNewTurn()
   323 function onNewTurn()
   340 	CheckForHogSwitch()
   324 	AssignHogAmmo()
   341 end
   325 end
   342 
   326 
   343 --function onGameTick20()
   327 --function onGameTick20()
   344 --CheckForHogSwitch()
   328 --CheckForHogSwitch()
   345 -- if we use gfPerHogAmmo is this even needed? Err, well, weapons reset, so... yes?
   329 -- if we use gfPerHogAmmo is this even needed? Err, well, weapons reset, so... yes?