share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
branchspacecampaign
changeset 9630 df942cfac4e6
parent 9629 1655c50d9c51
child 9632 9dd1c36d8b54
equal deleted inserted replaced
9629:1655c50d9c51 9630:df942cfac4e6
   206 		AddAmmo(hero.gear, amRope, 2)
   206 		AddAmmo(hero.gear, amRope, 2)
   207 		AddAmmo(hero.gear, amBazooka, 3)
   207 		AddAmmo(hero.gear, amBazooka, 3)
   208 		AddAmmo(hero.gear, amParachute, 1)
   208 		AddAmmo(hero.gear, amParachute, 1)
   209 		AddAmmo(hero.gear, amGrenade, 6)
   209 		AddAmmo(hero.gear, amGrenade, 6)
   210 		AddAmmo(hero.gear, amDEagle, 4)
   210 		AddAmmo(hero.gear, amDEagle, 4)
       
   211 		AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1)))
   211 	
   212 	
   212 		AddAnim(dialog01)
   213 		AddAnim(dialog01)
   213 	elseif checkPointReached == 2 or checkPointReached == 3 then
   214 	elseif checkPointReached == 2 or checkPointReached == 3 then
   214 		ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0)
   215 		ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0)
   215 		loadHeroAmmo()
   216 		loadHeroAmmo()
   470 
   471 
   471 function saveCheckPointLocal(cpoint)
   472 function saveCheckPointLocal(cpoint)
   472 	-- save checkpoint
   473 	-- save checkpoint
   473 	saveCheckpoint(cpoint)	
   474 	saveCheckpoint(cpoint)	
   474 	SaveCampaignVar("HeroHealth", GetHealth(hero.gear))
   475 	SaveCampaignVar("HeroHealth", GetHealth(hero.gear))
   475 	-- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal
   476 	-- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal - rcplane
   476 	SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade)..
   477 	SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade)..
   477 			GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle)..
   478 			GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle)..
   478 			GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction)..GetAmmoCount(hero.gear, amPortalGun))
   479 			GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction)..
       
   480 			GetAmmoCount(hero.gear, amPortalGun)..GetAmmoCount(hero.gear, amRCPlane))
   479 	AnimCaption(hero.gear, loc("Checkpoint reached!"), 5000)
   481 	AnimCaption(hero.gear, loc("Checkpoint reached!"), 5000)
   480 end
   482 end
   481 
   483 
   482 function loadHeroAmmo()
   484 function loadHeroAmmo()
   483 	-- hero ammo
   485 	-- hero ammo
   491 	-- weird, if 0 bazooka isn't displayed in the weapons menu
   493 	-- weird, if 0 bazooka isn't displayed in the weapons menu
   492 	if tonumber(ammo:sub(7,7)) > 0 then
   494 	if tonumber(ammo:sub(7,7)) > 0 then
   493 		AddAmmo(hero.gear, amConstruction, tonumber(ammo:sub(7,7)))
   495 		AddAmmo(hero.gear, amConstruction, tonumber(ammo:sub(7,7)))
   494 	end
   496 	end
   495 	AddAmmo(hero.gear, amPortalGun, tonumber(ammo:sub(8,8)))
   497 	AddAmmo(hero.gear, amPortalGun, tonumber(ammo:sub(8,8)))
       
   498 	AddAmmo(hero.gear, amRCPlane, tonumber(ammo:sub(9,9)))
   496 end
   499 end
   497 
   500 
   498 function checkForWin()
   501 function checkForWin()
   499 	if cratesFound ==  0 then
   502 	if cratesFound ==  0 then
   500 		-- have to look more		
   503 		-- have to look more