share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
changeset 12617 bcd679240cd2
parent 12616 88b9f41a5789
child 12619 2b529ddf1b01
equal deleted inserted replaced
12616:88b9f41a5789 12617:bcd679240cd2
   337 end
   337 end
   338 
   338 
   339 -------------- ACTIONS ------------------
   339 -------------- ACTIONS ------------------
   340 
   340 
   341 function weaponsPlatform(gear)
   341 function weaponsPlatform(gear)
   342 	saveCheckpoint("2")
   342 	if not battleZoneReached then
   343 	SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   343 		-- Player entered weapons platform before entering battle zone.
   344 	EndTurn(true)
   344 		-- Checkpoint and dialog!
   345 	weaponsAcquired = true
   345 		saveCheckpoint("2")
   346 	SetWind(60)
   346 		SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   347 	GameFlags = bor(GameFlags,gfDisableWind)
   347 		EndTurn(true)
   348 	AddAmmo(hero.gear, amRope, 0)
   348 		weaponsAcquired = true
   349 	if GetX(hero.gear) < 1900 then
   349 		SetWind(60)
   350 		AddAnim(dialog02)
   350 		GameFlags = bor(GameFlags,gfDisableWind)
   351 	end
   351 		AddAmmo(hero.gear, amRope, 0)
       
   352 		if GetX(hero.gear) < 1900 then
       
   353 			AddAnim(dialog02)
       
   354 		end
       
   355 	end
       
   356 	-- The player may screw up by going into the battle zone too early (dialog03).
       
   357 	-- In that case, the player is punished for this stupid move (no checkpoint),
       
   358 	-- but it is still theoretically possible to win by going for the weapons
       
   359 	-- very fast.
   352 end
   360 end
   353 
   361 
   354 function heroDeath(gear)
   362 function heroDeath(gear)
   355 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   363 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   356 	SendStat(siCustomAchievement, loc("You have to get the weapons and rescue the PAotH researchers."))
   364 	SendStat(siCustomAchievement, loc("You have to get the weapons and rescue the PAotH researchers."))