share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
changeset 9758 3b8058b251b8
parent 9642 8a691e0f117a
child 9802 00216d609140
equal deleted inserted replaced
9757:9be28be004d4 9758:3b8058b251b8
    15 local timeForGuard1ToTurn = 1000 * 5 -- 5 sec
    15 local timeForGuard1ToTurn = 1000 * 5 -- 5 sec
    16 local timeForGuard1ToTurnLeft = timeForGuard1ToTurn
    16 local timeForGuard1ToTurnLeft = timeForGuard1ToTurn
    17 local saucerAcquired = false
    17 local saucerAcquired = false
    18 local status
    18 local status
    19 local checkPointReached = 1 -- 1 is start of the game
    19 local checkPointReached = 1 -- 1 is start of the game
    20 local objectives = loc("Go to moon by the flying saucer and complete the main mission").."|"..
    20 local objectives = loc("Go to the moon by using the flying saucer and complete the main mission").."|"..
    21 loc("Come back to this mission and visit the other planets to collect the crates").."|"..
    21 loc("Come back to this mission and visit the other planets to collect the crates").."|"..
    22 loc("Visit the Death Planet after completing all the other planets' main missions").."|"..
    22 loc("Visit the Death Planet after completing all the other planets' main missions").."|"..
    23 loc("Come back to this mission after collecting all the parts")
    23 loc("Come back to this mission after collecting all the device parts")
    24 -- dialogs
    24 -- dialogs
    25 local dialog01 = {}
    25 local dialog01 = {}
    26 local dialog02 = {}
    26 local dialog02 = {}
    27 local dialog03 = {}
    27 local dialog03 = {}
    28 local dialog04 = {}
    28 local dialog04 = {}
    31 local dialog07 = {}
    31 local dialog07 = {}
    32 local dialog08 = {}
    32 local dialog08 = {}
    33 -- mission objectives
    33 -- mission objectives
    34 local goals = {
    34 local goals = {
    35 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
    35 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
    36 	[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Travel carefully as your fuels are limited"), 1, 4500},
    36 	[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Travel carefully as your fuel is limited"), 1, 4500},
    37 	[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away").."|"..loc("Beware, any damage taken will stay until you complete the moon's main mission"), 1, 7000},
    37 	[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away").."|"..loc("Beware, any damage taken will stay until you complete the moon's main mission"), 1, 7000},
    38 	[dialog04] = {missionName, loc("Objectives"), objectives, 1, 7000},
    38 	[dialog04] = {missionName, loc("Objectives"), objectives, 1, 7000},
    39 	[dialog05] = {missionName, loc("Objectives"), objectives, 1, 7000},
    39 	[dialog05] = {missionName, loc("Objectives"), objectives, 1, 7000},
    40 	[dialog06] = {missionName, loc("Objectives"), objectives, 1, 7000},
    40 	[dialog06] = {missionName, loc("Objectives"), objectives, 1, 7000},
    41 	[dialog07] = {missionName, loc("Searching the stars!"), loc("Use the saucer and fly away").."|"..loc("Visit first the planets of Ice, Desert and Fruit"), 1, 6000},
    41 	[dialog07] = {missionName, loc("Searching the stars!"), loc("Use the saucer and fly away").."|"..loc("Visit the planets of Ice, Desert and Fruit before you proceed to the Death Planet"), 1, 6000},
    42 	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
    42 	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
    43 }
    43 }
    44 -- crates
    44 -- crates
    45 local saucerX = 3270
    45 local saucerX = 3270
    46 local saucerY = 1500
    46 local saucerY = 1500
    96 		Map = "cosmos_map" -- custom map included in file
    96 		Map = "cosmos_map" -- custom map included in file
    97 	end
    97 	end
    98 	Theme = "Nature"
    98 	Theme = "Nature"
    99 	-- I had originally hero in PAoTH team and changed it, may reconsider though
    99 	-- I had originally hero in PAoTH team and changed it, may reconsider though
   100 	-- PAoTH
   100 	-- PAoTH
   101 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")	
   101 	AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy")
   102 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   102 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   103 	AnimSetGearPosition(hero.gear, hero.x, hero.y)	
   103 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   104 	HogTurnLeft(hero.gear, true)
   104 	HogTurnLeft(hero.gear, true)
   105 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")	
   105 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
   106 	director.gear = AddHog(director.name, 0, 100, "hair_yellow")
   106 	director.gear = AddHog(director.name, 0, 100, "hair_yellow")
   107 	AnimSetGearPosition(director.gear, director.x, director.y)
   107 	AnimSetGearPosition(director.gear, director.x, director.y)
   108 	doctor.gear = AddHog(doctor.name, 0, 100, "Glasses")
   108 	doctor.gear = AddHog(doctor.name, 0, 100, "Glasses")
   109 	AnimSetGearPosition(doctor.gear, doctor.x, doctor.y)
   109 	AnimSetGearPosition(doctor.gear, doctor.x, doctor.y)
   110 	-- Guards
   110 	-- Guards
   142 			AnimSetGearPosition(hero.gear, 620, 530)
   142 			AnimSetGearPosition(hero.gear, 620, 530)
   143 		elseif GetCampaignVar("Planet") == "meteorite" then
   143 		elseif GetCampaignVar("Planet") == "meteorite" then
   144 			AnimSetGearPosition(hero.gear, 3080, 850)
   144 			AnimSetGearPosition(hero.gear, 3080, 850)
   145 		end
   145 		end
   146 	end
   146 	end
   147 	
   147 
   148 	AnimInit()
   148 	AnimInit()
   149 	AnimationSetup()
   149 	AnimationSetup()
   150 end
   150 end
   151 
   151 
   152 function onGameStart()
   152 function onGameStart()
   154 	AnimWait(hero.gear, 3000)
   154 	AnimWait(hero.gear, 3000)
   155 
   155 
   156 	FollowGear(hero.gear)
   156 	FollowGear(hero.gear)
   157 	ShowMission(loc("Spacetrip"), loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
   157 	ShowMission(loc("Spacetrip"), loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
   158 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
   158 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
   159 	
   159 
   160 	-- do checkpoint stuff needed after game starts
   160 	-- do checkpoint stuff needed after game starts
   161 	if checkPointReached == 1 then	
   161 	if checkPointReached == 1 then
   162 		AddAnim(dialog01)
   162 		AddAnim(dialog01)
   163 		AddAmmo(hero.gear, amRope, 1)
   163 		AddAmmo(hero.gear, amRope, 1)
   164 		AddAmmo(guard1.gear, amDEagle, 2)
   164 		AddAmmo(guard1.gear, amDEagle, 2)
   165 		AddAmmo(guard2.gear, amDEagle, 2)
   165 		AddAmmo(guard2.gear, amDEagle, 2)
   166 		SpawnAmmoCrate(saucerX, saucerY, amJetpack)	
   166 		SpawnAmmoCrate(saucerX, saucerY, amJetpack)
   167 		-- EVENT HANDLERS
   167 		-- EVENT HANDLERS
   168 		AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0)
   168 		AddEvent(onHeroBeforeTreePosition, {hero.gear}, heroBeforeTreePosition, {hero.gear}, 0)
   169 		AddEvent(onHeroAtSaucerPosition, {hero.gear}, heroAtSaucerPosition, {hero.gear}, 0)
   169 		AddEvent(onHeroAtSaucerPosition, {hero.gear}, heroAtSaucerPosition, {hero.gear}, 0)
   170 		AddEvent(onHeroOutOfGuardSight, {hero.gear}, heroOutOfGuardSight, {hero.gear}, 0)
   170 		AddEvent(onHeroOutOfGuardSight, {hero.gear}, heroOutOfGuardSight, {hero.gear}, 0)
   171 	elseif checkPointReached == 2 then
   171 	elseif checkPointReached == 2 then
   178 		AddAnim(dialog05)
   178 		AddAnim(dialog05)
   179 	elseif checkPointReached == 5 then
   179 	elseif checkPointReached == 5 then
   180 		-- Hero has visited a planet, he has plenty of fuels and can change planet
   180 		-- Hero has visited a planet, he has plenty of fuels and can change planet
   181 		AddAmmo(hero.gear, amJetpack, 99)
   181 		AddAmmo(hero.gear, amJetpack, 99)
   182 	end
   182 	end
   183 	
   183 
   184 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   184 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   185 	AddEvent(onNoFuelAtLand, {hero.gear}, noFuelAtLand, {hero.gear}, 0)
   185 	AddEvent(onNoFuelAtLand, {hero.gear}, noFuelAtLand, {hero.gear}, 0)
   186 	-- always check for landings
   186 	-- always check for landings
   187 	if GetCampaignVar("Planet") ~= "moon" then
   187 	if GetCampaignVar("Planet") ~= "moon" then
   188 		AddEvent(onMoonLanding, {hero.gear}, moonLanding, {hero.gear}, 0)
   188 		AddEvent(onMoonLanding, {hero.gear}, moonLanding, {hero.gear}, 0)
   189 	end
   189 	end
   190 	if GetCampaignVar("Planet") ~= "desertPlanet" then
   190 	if GetCampaignVar("Planet") ~= "desertPlanet" then
   191 		AddEvent(onDesertPlanetLanding, {hero.gear}, desertPlanetLanding, {hero.gear}, 0)
   191 		AddEvent(onDesertPlanetLanding, {hero.gear}, desertPlanetLanding, {hero.gear}, 0)
   192 	end	
   192 	end
   193 	if GetCampaignVar("Planet") ~= "fruitPlanet" then
   193 	if GetCampaignVar("Planet") ~= "fruitPlanet" then
   194 		AddEvent(onFruitPlanetLanding, {hero.gear}, fruitPlanetLanding, {hero.gear}, 0)
   194 		AddEvent(onFruitPlanetLanding, {hero.gear}, fruitPlanetLanding, {hero.gear}, 0)
   195 	end
   195 	end
   196 	if GetCampaignVar("Planet") ~= "icePlanet" then
   196 	if GetCampaignVar("Planet") ~= "icePlanet" then
   197 		AddEvent(onIcePlanetLanding, {hero.gear}, icePlanetLanding, {hero.gear}, 0)
   197 		AddEvent(onIcePlanetLanding, {hero.gear}, icePlanetLanding, {hero.gear}, 0)
   198 	end
   198 	end
   199 	if GetCampaignVar("Planet") ~= "deathPlanet" then
   199 	if GetCampaignVar("Planet") ~= "deathPlanet" then
   200 		AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0)
   200 		AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0)
   201 	end
   201 	end
   202 	
   202 
   203 	if status.death01 and not status.final then
   203 	if status.death01 and not status.final then
   204 		AddAnim(dialog08)
   204 		AddAnim(dialog08)
   205 		if GetCampaignVar("Planet") ~= "meteorite" then
   205 		if GetCampaignVar("Planet") ~= "meteorite" then
   206 			AddEvent(onMeteoriteLanding, {hero.gear}, meteoriteLanding, {hero.gear}, 0)
   206 			AddEvent(onMeteoriteLanding, {hero.gear}, meteoriteLanding, {hero.gear}, 0)
   207 		end
   207 		end
   208 	end
   208 	end
   209 	
   209 
   210 	SendHealthStatsOff()
   210 	SendHealthStatsOff()
   211 end
   211 end
   212 
   212 
   213 function onGameTick()
   213 function onGameTick()
   214 	-- maybe alert this to avoid timeForGuard1ToTurnLeft overflow
   214 	-- maybe alert this to avoid timeForGuard1ToTurnLeft overflow
   226 	CheckEvents()
   226 	CheckEvents()
   227 end
   227 end
   228 
   228 
   229 function onPrecise()
   229 function onPrecise()
   230 	if GameTime > 3000 then
   230 	if GameTime > 3000 then
   231 		SetAnimSkip(true)   
   231 		SetAnimSkip(true)
   232 	end
   232 	end
   233 end
   233 end
   234 
   234 
   235 function onAmmoStoreInit()
   235 function onAmmoStoreInit()
   236 	SetAmmo(amJetpack, 0, 0, 0, 1)
   236 	SetAmmo(amJetpack, 0, 0, 0, 1)
   313 	end
   313 	end
   314 	return false
   314 	return false
   315 end
   315 end
   316 
   316 
   317 function onNoFuelAtLand(gear)
   317 function onNoFuelAtLand(gear)
   318 	if checkPointReached > 1 and GetHealth(hero.gear) and GetY(gear) > 1400 and 
   318 	if checkPointReached > 1 and GetHealth(hero.gear) and GetY(gear) > 1400 and
   319 			GetAmmoCount(gear, amJetpack) == 0 and StoppedGear(gear) then
   319 			GetAmmoCount(gear, amJetpack) == 0 and StoppedGear(gear) then
   320 		return true
   320 		return true
   321 	end
   321 	end
   322 	return false
   322 	return false
   323 end
   323 end
   336 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   336 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   337 end
   337 end
   338 
   338 
   339 function heroAtSaucerPosition(gear)
   339 function heroAtSaucerPosition(gear)
   340 	TurnTimeLeft = 0
   340 	TurnTimeLeft = 0
   341 	-- save check point	
   341 	-- save check point
   342 	SaveCampaignVar("CosmosCheckPoint", "2")
   342 	SaveCampaignVar("CosmosCheckPoint", "2")
   343 	checkPointReached = 2
   343 	checkPointReached = 2
   344 	AddAnim(dialog02)
   344 	AddAnim(dialog02)
   345 	-- check if he was spotted by the guard
   345 	-- check if he was spotted by the guard
   346 	if guard1.turn and GetX(hero.gear) > saucerX-150 then
   346 	if guard1.turn and GetX(hero.gear) > saucerX-150 then
   347 		guard1.keepTurning = false
   347 		guard1.keepTurning = false
   348 		AddAnim(dialog03)
   348 		AddAnim(dialog03)
   349 	end	
   349 	end
   350 end
   350 end
   351 
   351 
   352 function heroOutOfGuardSight(gear)
   352 function heroOutOfGuardSight(gear)
   353 	guard1.keepTurning = true
   353 	guard1.keepTurning = true
   354 	AddAnim(dialog04)
   354 	AddAnim(dialog04)
   381 end
   381 end
   382 
   382 
   383 function fruitPlanetLanding(gear)
   383 function fruitPlanetLanding(gear)
   384 	if checkPointReached < 5 then
   384 	if checkPointReached < 5 then
   385 		AddAnim(dialog06)
   385 		AddAnim(dialog06)
   386 	else		
   386 	else
   387 		AnimCaption(hero.gear,loc("Welcome to the Fruit Planet!"))
   387 		AnimCaption(hero.gear,loc("Welcome to the Fruit Planet!"))
   388 		SaveCampaignVar("Planet", "fruitPlanet")
   388 		SaveCampaignVar("Planet", "fruitPlanet")
   389 		if status.fruit02 then
   389 		if status.fruit02 then
   390 			SaveCampaignVar("UnlockedMissions", "4")
   390 			SaveCampaignVar("UnlockedMissions", "4")
   391 			SaveCampaignVar("Mission1", "3")
   391 			SaveCampaignVar("Mission1", "3")
   403 end
   403 end
   404 
   404 
   405 function desertPlanetLanding(gear)
   405 function desertPlanetLanding(gear)
   406 	if checkPointReached < 5 then
   406 	if checkPointReached < 5 then
   407 		AddAnim(dialog06)
   407 		AddAnim(dialog06)
   408 	else		
   408 	else
   409 		AnimCaption(hero.gear,loc("Welcome to the Desert Planet!"))
   409 		AnimCaption(hero.gear,loc("Welcome to the Desert Planet!"))
   410 		SaveCampaignVar("Planet", "desertPlanet")
   410 		SaveCampaignVar("Planet", "desertPlanet")
   411 		SaveCampaignVar("UnlockedMissions", "4")
   411 		SaveCampaignVar("UnlockedMissions", "4")
   412 		SaveCampaignVar("Mission1", "4")
   412 		SaveCampaignVar("Mission1", "4")
   413 		SaveCampaignVar("Mission2", "7")
   413 		SaveCampaignVar("Mission2", "7")
   490 	-- DIALOG 01 - Start
   490 	-- DIALOG 01 - Start
   491 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   491 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   492 	table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}})
   492 	table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}})
   493 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near secret base 17 of PAotH in the rural Hogland..."),  4000}})
   493 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near secret base 17 of PAotH in the rural Hogland..."),  4000}})
   494 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("So Hog Solo, here we are..."), SAY_SAY, 2000}})
   494 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("So Hog Solo, here we are..."), SAY_SAY, 2000}})
   495 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the East there is secret base 17"), SAY_SAY, 4000}})
   495 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the east side there is secret base 17"), SAY_SAY, 4000}})
   496 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}})
   496 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}})
   497 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}})
   497 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}})
   498 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you"), SAY_SAY, 2600}})
   498 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you"), SAY_SAY, 2600}})
   499 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope"), SAY_SAY, 5000}})
   499 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope"), SAY_SAY, 5000}})
   500 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("You may find it handy"), SAY_SAY, 2300}})
   500 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("You may find it handy"), SAY_SAY, 2300}})
   507 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   507 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   508 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}})
   508 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}})
   509 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("CheckPoint reached!"),  4000}})
   509 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("CheckPoint reached!"),  4000}})
   510 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}})
   510 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}})
   511 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}})
   511 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}})
   512 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Now use it and go to the moon PAotH station to get more fuels!"), SAY_SHOUT, 5000}})
   512 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Now use it and go to the moon PAotH station to get more fuel!"), SAY_SHOUT, 5000}})
   513     table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}})
   513     table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}})
   514     -- DIALOG 03 - Hero got spotted by guard
   514     -- DIALOG 03 - Hero got spotted by guard
   515 	AddSkipFunction(dialog03, Skipanim, {dialog03})
   515 	AddSkipFunction(dialog03, Skipanim, {dialog03})
   516 	table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 4000}})
   516 	table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 4000}})
   517 	table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"),  4000}})	
   517 	table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"),  4000}})
   518 	table.insert(dialog03, {func = AnimSay, args = {guard1.gear, loc("Hey").." "..guard2.name.."! "..loc("Look, someone is stealing the saucer!"), SAY_SHOUT, 4000}})
   518 	table.insert(dialog03, {func = AnimSay, args = {guard1.gear, loc("Hey").." "..guard2.name.."! "..loc("Look, someone is stealing the saucer!"), SAY_SHOUT, 4000}})
   519 	table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}})
   519 	table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}})
   520 	table.insert(dialog03, {func = startCombat, args = {guard1.gear}})
   520 	table.insert(dialog03, {func = startCombat, args = {guard1.gear}})
   521 	-- DIALOG 04 - Hero out of sight
   521 	-- DIALOG 04 - Hero out of sight
   522 	AddSkipFunction(dialog04, Skipanim, {dialog04})
   522 	AddSkipFunction(dialog04, Skipanim, {dialog04})
   530 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}})
   530 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("Go to go back"), SAY_THINK, 2000}})
   531 	table.insert(dialog05, {func = sendStatsOnRetry, args = {hero.gear}})
   531 	table.insert(dialog05, {func = sendStatsOnRetry, args = {hero.gear}})
   532 	-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels
   532 	-- DIALOG 06 - Landing on wrong planet or on earth if not enough fuels
   533 	AddSkipFunction(dialog06, Skipanim, {dialog06})
   533 	AddSkipFunction(dialog06, Skipanim, {dialog06})
   534 	table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"),  5000}})
   534 	table.insert(dialog06, {func = AnimCaption, args = {hero.gear, loc("You have to try again!"),  5000}})
   535 	table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I run out of fuels..."), SAY_THINK, 3000}})
   535 	table.insert(dialog06, {func = AnimSay, args = {hero.gear, loc("Hm... Now I ran out of fuel..."), SAY_THINK, 3000}})
   536 	table.insert(dialog06, {func = sendStatsOnRetry, args = {hero.gear}})
   536 	table.insert(dialog06, {func = sendStatsOnRetry, args = {hero.gear}})
   537 	-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map
   537 	-- DIALOG 07 - Hero lands on Death Planet but isn't allowed yet to play this map
   538 	AddSkipFunction(dialog07, Skipanim, {dialog07})
   538 	AddSkipFunction(dialog07, Skipanim, {dialog07})
   539 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   539 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   540 	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}})
   540 	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 device parts"), SAY_THINK, 4000}})
   541 	-- DIALOG 08 - Hero wins death01
   541 	-- DIALOG 08 - Hero wins death01
   542 	AddSkipFunction(dialog08, Skipanim, {dialog08})
   542 	AddSkipFunction(dialog08, Skipanim, {dialog08})
   543 	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite shadow..."),  4000}})
   543 	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite shadow..."),  4000}})
   544 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("You did great Hog Solo! However we aren't out of danger yet!"), SAY_SHOUT, 4500}})
   544 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("You did great Hog Solo! However we aren't out of danger yet!"), SAY_SHOUT, 4500}})
   545 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("The meteorite has come too close and the anti-gravity device isn't powerful enough to get it out of order"), SAY_SHOUT, 5000}})
   545 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("The meteorite has come too close and the anti-gravity device isn't powerful enough to stop it now"), SAY_SHOUT, 5000}})
   546 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts"), SAY_SHOUT, 3000}})
   546 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts"), SAY_SHOUT, 3000}})
   547 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("PAotH has sent explosives but unfortunately the trigger mechanism seems to be faulty!"), SAY_SHOUT, 5000}})
   547 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("PAotH has sent explosives but unfortunately the trigger mechanism seems to be faulty!"), SAY_SHOUT, 5000}})
   548 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   548 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   549 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
   549 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
   550 	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
   550 	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
   557 	AnimSwitchHog(hero.gear)
   557 	AnimSwitchHog(hero.gear)
   558 	TurnTimeLeft = 0
   558 	TurnTimeLeft = 0
   559 end
   559 end
   560 
   560 
   561 function sendStats(planet)
   561 function sendStats(planet)
   562 	SendStat(siGameResult, loc("Hog Solo arrived to "..planet))
   562 	SendStat(siGameResult, loc("Hog Solo arrived at "..planet))
   563 	SendStat(siCustomAchievement, loc("Return to the mission menu by pressing the \"Go back\" button"))
   563 	SendStat(siCustomAchievement, loc("Return to the mission menu by pressing the \"Go back\" button"))
   564 	SendStat(siCustomAchievement, loc("Choose another planet by replaying the mission"))
   564 	SendStat(siCustomAchievement, loc("You can choose another planet by replaying this mission"))
   565 	SendStat(siPlayerKills,'1',teamC.name)
   565 	SendStat(siPlayerKills,'1',teamC.name)
   566 	EndGame()
   566 	EndGame()
   567 end
   567 end
   568 
   568 
   569 function sendStatsOnRetry()
   569 function sendStatsOnRetry()
   570 	SendStat(siGameResult, loc("You have to travel again"))
   570 	SendStat(siGameResult, loc("You have to travel again"))
   571 	SendStat(siCustomAchievement, loc("Your first destination is moon in order to get more fuels"))
   571 	SendStat(siCustomAchievement, loc("Your first destination is the moon in order to get more fuel"))
   572 	SendStat(siCustomAchievement, loc("You have to complete the moon main mission in order to travel to other planets"))
   572 	SendStat(siCustomAchievement, loc("You have to complete the main mission on moon in order to travel to other planets"))
   573 	SendStat(siCustomAchievement, loc("You have to be careful and not die!"))
   573 	SendStat(siCustomAchievement, loc("You have to be careful and not die!"))
   574 	SendStat(siPlayerKills,'0',teamC.name)
   574 	SendStat(siPlayerKills,'0',teamC.name)
   575 	EndGame()
   575 	EndGame()
   576 end
   576 end