share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
branchspacecampaign
changeset 9586 0b2494d87d99
parent 9585 d079e1cc2806
child 9587 d6ddcafb1c56
equal deleted inserted replaced
9585:d079e1cc2806 9586:0b2494d87d99
   414 function noFuelAtLand(gear)
   414 function noFuelAtLand(gear)
   415 	AddAnim(dialog06)
   415 	AddAnim(dialog06)
   416 end
   416 end
   417 
   417 
   418 function heroDeath(gear)
   418 function heroDeath(gear)
   419 	EndGame()
   419 	sendStatsOnRetry()
   420 end
   420 end
   421 
   421 
   422 -------------- ANIMATIONS ------------------
   422 -------------- ANIMATIONS ------------------
   423 
   423 
   424 function Skipanim(anim)
   424 function Skipanim(anim)
   428     if CurrentHedgehog ~= hero.gear and anim ~= dialog03 then
   428     if CurrentHedgehog ~= hero.gear and anim ~= dialog03 then
   429 		AnimSwitchHog(hero.gear)
   429 		AnimSwitchHog(hero.gear)
   430 	elseif anim == dialog03 then
   430 	elseif anim == dialog03 then
   431 		startCombat()
   431 		startCombat()
   432 	elseif anim == dialog05 or anim == dialog06 then
   432 	elseif anim == dialog05 or anim == dialog06 then
   433 		EndGame()
   433 		sendStatsOnRetry()
   434 	end
   434 	end
   435 end
   435 end
   436 
   436 
   437 function AnimationSetup()
   437 function AnimationSetup()
   438 	-- DIALOG 01 - Start
   438 	-- DIALOG 01 - Start
   474 	table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}})
   474 	table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}})
   475 	-- DIALOG 05 - Hero returned from moon without fuels
   475 	-- DIALOG 05 - Hero returned from moon without fuels
   476 	AddSkipFunction(dialog05, Skipanim, {dialog05})
   476 	AddSkipFunction(dialog05, Skipanim, {dialog05})
   477 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuels!"), SAY_THINK, 6000}})
   477 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuels!"), SAY_THINK, 6000}})
   478 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}})
   478 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}})
   479 	table.insert(dialog05, {func = EndGame, args = {hero.gear}})
   479 	table.insert(dialog05, {func = sendStatsOnRetry, args = {hero.gear}})
   480 	-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels
   480 	-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels
   481 	AddSkipFunction(dialog06, Skipanim, {dialog06})
   481 	AddSkipFunction(dialog06, Skipanim, {dialog06})
   482 	table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"),  5000}})
   482 	table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"),  5000}})
   483 	table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I run out of fuels..."), SAY_THINK, 3000}})
   483 	table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I run out of fuels..."), SAY_THINK, 3000}})
   484 	table.insert(dialog06, {func = EndGame, args = {hero.gear}})
   484 	table.insert(dialog06, {func = sendStatsOnRetry, args = {hero.gear}})
   485 	-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map
   485 	-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map
   486 	AddSkipFunction(dialog07, Skipanim, {dialog07})
   486 	AddSkipFunction(dialog07, Skipanim, {dialog07})
   487 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   487 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   488 	table.insert(dialog07, {func = AnimSay, args = {hero.gear, loc("I am not ready for this planet yet. I should visit it when I have found all the other parts"), SAY_THINK, 4000}})
   488 	table.insert(dialog07, {func = AnimSay, args = {hero.gear, loc("I am not ready for this planet yet. I should visit it when I have found all the other parts"), SAY_THINK, 4000}})
   489 end
   489 end
   501 	SendStat('siCustomAchievement', loc("Return to the mission menu by pressing the \"Go back\" button")) --11
   501 	SendStat('siCustomAchievement', loc("Return to the mission menu by pressing the \"Go back\" button")) --11
   502 	SendStat('siCustomAchievement', loc("Choose another planet by replaying the mission")) --11
   502 	SendStat('siCustomAchievement', loc("Choose another planet by replaying the mission")) --11
   503 	SendStat('siPlayerKills','1',teamC.name)
   503 	SendStat('siPlayerKills','1',teamC.name)
   504 	EndGame()
   504 	EndGame()
   505 end
   505 end
       
   506 
       
   507 function sendStatsOnRetry()
       
   508 	SendStat('siGameResult', loc("You have to travel again")) --1
       
   509 	SendStat('siCustomAchievement', loc("Your first destination is moon in order to get more fuels")) --11
       
   510 	SendStat('siCustomAchievement', loc("You have to complete the moon main mission in order to travel to other planets")) --11
       
   511 	SendStat('siCustomAchievement', loc("You have to be careful and not die!")) --11
       
   512 	SendStat('siPlayerKills','0',teamC.name)
       
   513 	EndGame()
       
   514 end