share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
changeset 14488 7bb7e5e54f70
parent 14401 6c21bd8547dd
child 14501 4e7fbbdca061
equal deleted inserted replaced
14487:d72fb761aa59 14488:7bb7e5e54f70
    30 local dialog07 = {}
    30 local dialog07 = {}
    31 local dialog08 = {}
    31 local dialog08 = {}
    32 local dialog09 = {}
    32 local dialog09 = {}
    33 -- mission objectives
    33 -- mission objectives
    34 local goals = {
    34 local goals = {
    35 	["init"] = {missionName, loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
    35 	["init"] = {missionName, loc("Getting ready"), loc("Find all the parts of the anti-gravity device.")..
    36 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), 1, 0},
    36 	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), 1, 0},
    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 	[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},
   116 		Map = "cosmos2_map"
   116 		Map = "cosmos2_map"
   117 	else
   117 	else
   118 		Map = "cosmos_map" -- custom map included in file
   118 		Map = "cosmos_map" -- custom map included in file
   119 	end
   119 	end
   120 	Theme = "Nature"
   120 	Theme = "Nature"
   121 	-- I had originally hero in PAotH team and changed it, may reconsider though
   121 	-- Hero
   122 	-- PAotH
   122 	teamC.name = AddMissionTeam(teamC.color)
   123 	AddTeam(teamC.name, teamC.color, "Simple", "Island", "Default", "hedgewars")
   123 	hero.gear = AddMissionHog(100)
   124 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   124 	hero.name = GetHogName(hero.gear)
   125 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   125 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   126 	HogTurnLeft(hero.gear, true)
   126 	HogTurnLeft(hero.gear, true)
   127 	AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy")
   127 	-- PAotH
       
   128 	teamA.name = AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy")
   128 	director.gear = AddHog(director.name, 0, 100, "hair_yellow")
   129 	director.gear = AddHog(director.name, 0, 100, "hair_yellow")
   129 	AnimSetGearPosition(director.gear, director.x, director.y)
   130 	AnimSetGearPosition(director.gear, director.x, director.y)
   130 	doctor.gear = AddHog(doctor.name, 0, 100, "Glasses")
   131 	doctor.gear = AddHog(doctor.name, 0, 100, "Glasses")
   131 	AnimSetGearPosition(doctor.gear, doctor.x, doctor.y)
   132 	AnimSetGearPosition(doctor.gear, doctor.x, doctor.y)
   132 	-- Guards
   133 	-- Guards
   133 	AddTeam(teamB.name, teamB.color, "Statue", "Island", "Default", "cm_swordshield2")
   134 	teamB.name = AddTeam(teamB.name, teamB.color, "Statue", "Island", "Default", "cm_swordshield2")
   134 	guard1.gear = AddHog(guard1.name, 1, 100, "policecap")
   135 	guard1.gear = AddHog(guard1.name, 1, 100, "policecap")
   135 	AnimSetGearPosition(guard1.gear, guard1.x, guard1.y)
   136 	AnimSetGearPosition(guard1.gear, guard1.x, guard1.y)
   136 	guard2.gear = AddHog(guard2.name, 1, 100, "policecap")
   137 	guard2.gear = AddHog(guard2.name, 1, 100, "policecap")
   137 	AnimSetGearPosition(guard2.gear, guard2.x, guard2.y)
   138 	AnimSetGearPosition(guard2.gear, guard2.x, guard2.y)
   138 	-- Whether to start with an animation
   139 	-- Whether to start with an animation
   472 		SaveCampaignVar("Planet", "moon")
   473 		SaveCampaignVar("Planet", "moon")
   473 		SaveCampaignVar("UnlockedMissions", "3")
   474 		SaveCampaignVar("UnlockedMissions", "3")
   474 		SaveCampaignVar("Mission1", "2")
   475 		SaveCampaignVar("Mission1", "2")
   475 		SaveCampaignVar("Mission2", "13")
   476 		SaveCampaignVar("Mission2", "13")
   476 		SaveCampaignVar("Mission3", "1")
   477 		SaveCampaignVar("Mission3", "1")
   477 		sendStats(loc("Hog Solo arrived at the moon!"))
   478 		sendStats(string.format(loc("%s arrived at the moon!"), hero.name))
   478 	end
   479 	end
   479 end
   480 end
   480 
   481 
   481 function punishHeroForRopingToMoon(gear)
   482 function punishHeroForRopingToMoon(gear)
   482 	-- Initiate the secret PAotH anti-rope defense system (5 bazookas dropped from sky)
   483 	-- Initiate the secret PAotH anti-rope defense system (5 bazookas dropped from sky)
   505 			SaveCampaignVar("UnlockedMissions", "3")
   506 			SaveCampaignVar("UnlockedMissions", "3")
   506 			SaveCampaignVar("Mission1", "3")
   507 			SaveCampaignVar("Mission1", "3")
   507 			SaveCampaignVar("Mission2", "10")
   508 			SaveCampaignVar("Mission2", "10")
   508 			SaveCampaignVar("Mission3", "1")
   509 			SaveCampaignVar("Mission3", "1")
   509 		end
   510 		end
   510 		sendStats(loc("Hog Solo arrived at the Fruit Planet!"))
   511 		sendStats(string.format(loc("%s arrived at the Fruit Planet!"), hero.name))
   511 	end
   512 	end
   512 end
   513 end
   513 
   514 
   514 function desertPlanetLanding(gear)
   515 function desertPlanetLanding(gear)
   515 	if checkPointReached < 5 then
   516 	if checkPointReached < 5 then
   520 		SaveCampaignVar("UnlockedMissions", "4")
   521 		SaveCampaignVar("UnlockedMissions", "4")
   521 		SaveCampaignVar("Mission1", "4")
   522 		SaveCampaignVar("Mission1", "4")
   522 		SaveCampaignVar("Mission2", "7")
   523 		SaveCampaignVar("Mission2", "7")
   523 		SaveCampaignVar("Mission3", "12")
   524 		SaveCampaignVar("Mission3", "12")
   524 		SaveCampaignVar("Mission4", "1")
   525 		SaveCampaignVar("Mission4", "1")
   525 		sendStats(loc("Hog Solo arrived at the Desert Planet!"))
   526 		sendStats(string.format(loc("%s arrived at the Desert Planet!"), hero.name))
   526 	end
   527 	end
   527 end
   528 end
   528 
   529 
   529 function icePlanetLanding(gear)
   530 function icePlanetLanding(gear)
   530 	if checkPointReached < 5 then
   531 	if checkPointReached < 5 then
   534 		SaveCampaignVar("Planet", "icePlanet")
   535 		SaveCampaignVar("Planet", "icePlanet")
   535 		SaveCampaignVar("UnlockedMissions", "3")
   536 		SaveCampaignVar("UnlockedMissions", "3")
   536 		SaveCampaignVar("Mission1", "5")
   537 		SaveCampaignVar("Mission1", "5")
   537 		SaveCampaignVar("Mission2", "6")
   538 		SaveCampaignVar("Mission2", "6")
   538 		SaveCampaignVar("Mission3", "1")
   539 		SaveCampaignVar("Mission3", "1")
   539 		sendStats(loc("Hog Solo arrived at the Ice Planet!"))
   540 		sendStats(string.format(loc("%s arrived at the Ice Planet!"), hero.name))
   540 	end
   541 	end
   541 end
   542 end
   542 
   543 
   543 function deathPlanetLanding(gear)
   544 function deathPlanetLanding(gear)
   544 	if checkPointReached < 5 then
   545 	if checkPointReached < 5 then
   550 		SaveCampaignVar("Planet", "deathPlanet")
   551 		SaveCampaignVar("Planet", "deathPlanet")
   551 		SaveCampaignVar("UnlockedMissions", "3")
   552 		SaveCampaignVar("UnlockedMissions", "3")
   552 		SaveCampaignVar("Mission1", "9")
   553 		SaveCampaignVar("Mission1", "9")
   553 		SaveCampaignVar("Mission2", "11")
   554 		SaveCampaignVar("Mission2", "11")
   554 		SaveCampaignVar("Mission3", "1")
   555 		SaveCampaignVar("Mission3", "1")
   555 		sendStats(loc("Hog Solo arrived at the Planet of Death!"))
   556 		sendStats(string.format(loc("%s arrived at the Planet of Death!"), hero.name))
   556 	end
   557 	end
   557 end
   558 end
   558 
   559 
   559 function meteoriteLanding(gear)
   560 function meteoriteLanding(gear)
   560 	-- first two conditionals are not possible but I'll leave it there...
   561 	-- first two conditionals are not possible but I'll leave it there...
   566 		AnimCaption(hero.gear,loc("Welcome to the meteorite!"))
   567 		AnimCaption(hero.gear,loc("Welcome to the meteorite!"))
   567 		SaveCampaignVar("Planet", "meteorite")
   568 		SaveCampaignVar("Planet", "meteorite")
   568 		SaveCampaignVar("UnlockedMissions", "2")
   569 		SaveCampaignVar("UnlockedMissions", "2")
   569 		SaveCampaignVar("Mission1", "14")
   570 		SaveCampaignVar("Mission1", "14")
   570 		SaveCampaignVar("Mission2", "1")
   571 		SaveCampaignVar("Mission2", "1")
   571 		sendStats(loc("Hog Solo arrived at the meteorite!"))
   572 		sendStats(string.format(loc("%s arrived at the meteorite!"), hero.name))
   572 	end
   573 	end
   573 end
   574 end
   574 
   575 
   575 function noFuelAtLand(gear)
   576 function noFuelAtLand(gear)
   576 	AddAnim(dialog06)
   577 	AddAnim(dialog06)
   647 function AnimationSetup()
   648 function AnimationSetup()
   648 	-- DIALOG 01 - Start
   649 	-- DIALOG 01 - Start
   649 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   650 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   650 	table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}})
   651 	table.insert(dialog01, {func = AnimWait, args = {doctor.gear, 3000}})
   651 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near Secret Base 17 of PAotH in the rural Hogland ..."),  4000}})
   652 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near Secret Base 17 of PAotH in the rural Hogland ..."),  4000}})
   652 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("So Hog Solo, here we are ..."), SAY_SAY, 2000}})
   653 	table.insert(dialog01, {func = AnimSay, args = {director.gear, string.format(loc("So, %s, here we are ..."), hero.name), SAY_SAY, 2000}})
   653 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the east side there is Secret Base 17."), SAY_SAY, 4000}})
   654 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Behind these trees on the east side there is Secret Base 17."), SAY_SAY, 4000}})
   654 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}})
   655 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("You have to continue alone from now on."), SAY_SAY, 3000}})
   655 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}})
   656 	table.insert(dialog01, {func = AnimSay, args = {director.gear, loc("Be careful, the future of Hogera is in your hands!"), SAY_SAY, 7200}})
   656 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you."), SAY_SAY, 2600}})
   657 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("We'll use our communicators to contact you."), SAY_SAY, 2600}})
   657 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope."), SAY_SAY, 5000}})
   658 	table.insert(dialog01, {func = AnimSay, args = {doctor.gear, loc("In am also entrusting you with some rope."), SAY_SAY, 5000}})
   703 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   704 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
   704 	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}})
   705 	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}})
   705 	-- DIALOG 08 - Hero wins death01
   706 	-- DIALOG 08 - Hero wins death01
   706 	AddSkipFunction(dialog08, Skipanim, {dialog08})
   707 	AddSkipFunction(dialog08, Skipanim, {dialog08})
   707 	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite’s shadow ..."),  4000}})
   708 	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite’s shadow ..."),  4000}})
   708 	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}})
   709 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, string.format(loc("You did great, %s! However, we aren't out of danger yet!"), hero.name), SAY_SHOUT, 4500}})
   709 	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}})
   710 	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}})
   710 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts."), SAY_SHOUT, 3000}})
   711 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts."), SAY_SHOUT, 3000}})
   711 	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}})
   712 	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}})
   712 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   713 	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
   713 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
   714 	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})