share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
branchspacecampaign
changeset 9589 20facc736354
parent 9587 d6ddcafb1c56
child 9590 347e799f01de
equal deleted inserted replaced
9588:797b8a41f8ca 9589:20facc736354
   151 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
   151 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
   152 	
   152 	
   153 	-- do checkpoint stuff needed after game starts
   153 	-- do checkpoint stuff needed after game starts
   154 	if checkPointReached == 1 then	
   154 	if checkPointReached == 1 then	
   155 		AddAnim(dialog01)
   155 		AddAnim(dialog01)
   156 		AddAmmo(hero.gear, amJetpack, 2)
   156 		AddAmmo(hero.gear, amRope, 2)
   157 		AddAmmo(guard1.gear, amDEagle, 2)
   157 		AddAmmo(guard1.gear, amDEagle, 2)
   158 		AddAmmo(guard2.gear, amDEagle, 2)
   158 		AddAmmo(guard2.gear, amDEagle, 2)
   159 		SpawnAmmoCrate(saucerX, saucerY, amJetpack)	
   159 		SpawnAmmoCrate(saucerX, saucerY, amJetpack)	
   160 		-- EVENT HANDLERS
   160 		-- EVENT HANDLERS
   161 		AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0)
   161 		AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0)
   331 	guard1.keepTurning = true
   331 	guard1.keepTurning = true
   332 	AddAnim(dialog04)
   332 	AddAnim(dialog04)
   333 end
   333 end
   334 
   334 
   335 function moonLanding(gear)
   335 function moonLanding(gear)
   336 	AnimCaption(hero.gear,loc("Welcome to the moon!"))
       
   337 	SaveCampaignVar("Planet", "moon")
       
   338 	if checkPointReached == 1 then
   336 	if checkPointReached == 1 then
   339 		-- player climbed the moon with rope
   337 		-- player climbed the moon with rope
   340 		FollowGear(doctor.gear)
   338 		FollowGear(doctor.gear)
   341 		AnimSay(doctor.gear, loc("One cannot simply walk in moon with rope!"), SAY_SHOUT, 4000)
   339 		AnimSay(doctor.gear, loc("One cannot simply walk in moon with rope!"), SAY_SHOUT, 4000)
   342 		SendStat('siGameResult', loc("Hog Solo has to travel to the moon by flying saucer")) --1
   340 		SendStat('siGameResult', loc("This is the wrong way!")) --1
   343 		SendStat('siCustomAchievement', loc("Collect the crate with the flying saucer")) --11
   341 		SendStat('siCustomAchievement', loc("Collect the crate with the flying saucer")) --11
   344 		SendStat('siCustomAchievement', loc("Fly to the moon")) --11
   342 		SendStat('siCustomAchievement', loc("Fly to the moon")) --11
   345 		SendStat('siPlayerKills','0',teamC.name)
   343 		SendStat('siPlayerKills','0',teamC.name)
   346 		EndGame()
   344 		EndGame()
   347 	end
   345 	else
   348 	if checkPointReached ~= 5 then
   346 		if checkPointReached ~= 5 then
   349 		SaveCampaignVar("CosmosCheckPoint", "4")
   347 			SaveCampaignVar("CosmosCheckPoint", "4")
   350 		SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   348 			SaveCampaignVar("HeroHealth",GetHealth(hero.gear))
   351 	end
   349 		end
   352 	SaveCampaignVar("UnlockedMissions", "2")
   350 		AnimCaption(hero.gear,loc("Welcome to the moon!"))
   353 	SaveCampaignVar("Mission1", "2")
   351 		SaveCampaignVar("Planet", "moon")
   354 	SaveCampaignVar("Mission2", "1")
   352 		SaveCampaignVar("UnlockedMissions", "2")
   355 	sendStats(loc("the moon"))
   353 		SaveCampaignVar("Mission1", "2")
       
   354 		SaveCampaignVar("Mission2", "1")
       
   355 		sendStats(loc("the moon"))
       
   356 	end
   356 end
   357 end
   357 
   358 
   358 function fruitPlanetLanding(gear)
   359 function fruitPlanetLanding(gear)
   359 	if checkPointReached < 5 then
   360 	if checkPointReached < 5 then
   360 		AddAnim(dialog06)
   361 		AddAnim(dialog06)