share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
changeset 12557 b745e322a366
parent 12556 846fa8bb856e
child 12558 0116cfdf9074
equal deleted inserted replaced
12556:846fa8bb856e 12557:b745e322a366
    35 -- mission objectives
    35 -- mission objectives
    36 local goals = {
    36 local goals = {
    37 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
    37 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
    38 	[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},
    38 	[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},
    39 	[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},
    39 	[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},
    40 	[dialog04] = {missionName, loc("Objectives"), objectives, 1, 7000},
       
    41 	[dialog05] = {missionName, loc("Objectives"), objectives, 1, 7000},
       
    42 	[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},
    40 	[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},
    43 	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
    41 	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
    44 }
    42 }
       
    43 goals[dialog04] = goals[dialog02]
    45 -- crates
    44 -- crates
    46 local saucerX = 3270
    45 local saucerX = 3270
    47 local saucerY = 1500
    46 local saucerY = 1500
    48 -- hogs
    47 -- hogs
    49 local hero = {}
    48 local hero = {}
   388 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   387 	AnimCaption(hero.gear, loc("Use the rope to get to the crate"),  4000)
   389 end
   388 end
   390 
   389 
   391 function prepareDialog02(gear)
   390 function prepareDialog02(gear)
   392 	if StoppedGear(gear) and guard1.keepTurning and checkPointReached < 2 then
   391 	if StoppedGear(gear) and guard1.keepTurning and checkPointReached < 2 then
       
   392 		SetGearMessage(hero.gear, 0)
   393 		EndTurn(true)
   393 		EndTurn(true)
   394 		-- save check point
   394 		-- save check point
   395 		SaveCampaignVar("CosmosCheckPoint", "2")
   395 		SaveCampaignVar("CosmosCheckPoint", "2")
   396 		checkPointReached = 2
   396 		checkPointReached = 2
   397 		AddAnim(dialog02)
   397 		AddAnim(dialog02)
   398 	end
   398 	end
   399 end
   399 end
   400 
   400 
   401 function heroAcquiredSaucer(gear)
   401 function heroAcquiredSaucer(gear)
   402 	SetGearMessage(hero.gear, 0)
       
   403 	-- check if he was spotted by the guard
   402 	-- check if he was spotted by the guard
   404 	if guard1.turn and guard1.keepTurning and GetX(hero.gear) > saucerX-150 then
   403 	if guard1.turn and guard1.keepTurning and GetX(hero.gear) > saucerX-150 then
   405 		guard1.keepTurning = false
   404 		guard1.keepTurning = false
   406 		SetGearVelocity(gear, 0, 0)
   405 		SetGearVelocity(gear, 0, 0)
   407 		AddAnim(dialog03)
   406 		AddAnim(dialog03)
   609 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you, Dr. Cornelius."), SAY_SAY, 1600}})
   608 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you, Dr. Cornelius."), SAY_SAY, 1600}})
   610 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I'll make good use of it."), SAY_SAY, 4500}})
   609 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I'll make good use of it."), SAY_SAY, 4500}})
   611 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("It would be wiser to steal the space ship while the PAotH guards are taking a brake!"), SAY_SAY, 7000}})
   610 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("It would be wiser to steal the space ship while the PAotH guards are taking a brake!"), SAY_SAY, 7000}})
   612 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Remember! Many will seek the anti-gravity device! Now go, hurry up!"), SAY_SAY, 4000}})
   611 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Remember! Many will seek the anti-gravity device! Now go, hurry up!"), SAY_SAY, 4000}})
   613 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
   612 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
       
   613 	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
   614 	-- DIALOG 02 - Hero got the saucer
   614 	-- DIALOG 02 - Hero got the saucer
   615 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   615 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   616 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}})
   616 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 500}})
   617 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Checkpoint reached!"),  4000}})
   617 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Checkpoint reached!"),  4000}})
   618 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}})
   618 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("Got the saucer!"), SAY_SHOUT, 2000}})
   619 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}})
   619 	table.insert(dialog02, {func = AnimSay, args = {director.gear, loc("Nice!"), SAY_SHOUT, 1000}})
   620 	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}})
   620 	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}})
   621     table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}})
   621 	table.insert(dialog02, {func = AnimGearWait, args = {hero.gear, 500}})
   622     -- DIALOG 03 - Hero got spotted by guard
   622 	table.insert(dialog02, {func = ShowMission, args = goals[dialog02]})
       
   623 	-- DIALOG 03 - Hero got spotted by guard
   623 	AddSkipFunction(dialog03, Skipanim, {dialog03})
   624 	AddSkipFunction(dialog03, Skipanim, {dialog03})
   624 	table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 500}})
   625 	table.insert(dialog03, {func = AnimWait, args = {guard1.gear, 500}})
   625 	table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"), 1000}})
   626 	table.insert(dialog03, {func = AnimCaption, args = {guard1.gear, loc("Prepare to flee!"), 1000}})
   626 	table.insert(dialog03, {func = AnimSay, args = {guard1.gear, string.format(loc("Hey, %s! Look, someone is stealing the saucer!"), guard2.name), SAY_SHOUT, 4000}})
   627 	table.insert(dialog03, {func = AnimSay, args = {guard1.gear, string.format(loc("Hey, %s! Look, someone is stealing the saucer!"), guard2.name), SAY_SHOUT, 4000}})
   627 	table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}})
   628 	table.insert(dialog03, {func = AnimSay, args = {guard2.gear, loc("I'll get him!"), SAY_SAY, 4000}})
   628 	table.insert(dialog03, {func = startCombat, args = {guard1.gear}})
   629 	table.insert(dialog03, {func = startCombat, args = {guard1.gear}})
       
   630 	table.insert(dialog03, {func = ShowMission, args = goals[dialog03]})
   629 	-- DIALOG 04 - Hero out of sight
   631 	-- DIALOG 04 - Hero out of sight
   630 	AddSkipFunction(dialog04, Skipanim, {dialog04})
   632 	AddSkipFunction(dialog04, Skipanim, {dialog04})
   631 	table.insert(dialog04, {func = AnimCaption, args = {guard1.gear, loc("You are out of danger, time to go to the moon!"),  4000}})
   633 	table.insert(dialog04, {func = AnimCaption, args = {guard1.gear, loc("You are out of danger, time to go to the moon!"),  4000}})
   632 	table.insert(dialog04, {func = AnimSay, args = {guard1.gear, loc("I guess we lost him!"), SAY_SAY, 3000}})
   634 	table.insert(dialog04, {func = AnimSay, args = {guard1.gear, loc("I guess we lost him!"), SAY_SAY, 3000}})
   633 	table.insert(dialog04, {func = AnimSay, args = {guard2.gear, loc("We should better report this and continue our watch!"), SAY_SAY, 5000}})
   635 	table.insert(dialog04, {func = AnimSay, args = {guard2.gear, loc("We should better report this and continue our watch!"), SAY_SAY, 5000}})
   634 	table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}})
   636 	table.insert(dialog04, {func = AnimSwitchHog, args = {hero.gear}})
       
   637 	table.insert(dialog04, {func = ShowMission, args = goals[dialog03]})
   635 	-- DIALOG 05 - Hero returned from moon without fuels
   638 	-- DIALOG 05 - Hero returned from moon without fuels
   636 	AddSkipFunction(dialog05, Skipanim, {dialog05})
   639 	AddSkipFunction(dialog05, Skipanim, {dialog05})
   637 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuel!"), SAY_THINK, 6000}})
   640 	table.insert(dialog05, {func = AnimSay, args = {hero.gear, loc("I guess I can't go far without fuel!"), SAY_THINK, 6000}})
   638 	if abandonedPlanetMission then
   641 	if abandonedPlanetMission then
   639 		-- Hog solo is mad he has to play the moon main mission from start. Very sarcastic tone. ;-)
   642 		-- Hog solo is mad he has to play the moon main mission from start. Very sarcastic tone. ;-)
   658 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts."), SAY_SHOUT, 3000}})
   661 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts."), SAY_SHOUT, 3000}})
   659 	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}})
   662 	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}})
   660 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   663 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   661 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
   664 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
   662 	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
   665 	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
       
   666 	table.insert(dialog08, {func = ShowMission, args = unpack(goals[dialog08])})
   663 end
   667 end
   664 
   668 
   665 ------------------- custom "animation" functions --------------------------
   669 ------------------- custom "animation" functions --------------------------
   666 
   670 
   667 function startCombat()
   671 function startCombat()