18 local status |
18 local status |
19 local getReadyForRumble = false -- guards wake up |
19 local getReadyForRumble = false -- guards wake up |
20 local ropeDestroyed = false -- for detecting if player roped to the moon |
20 local ropeDestroyed = false -- for detecting if player roped to the moon |
21 local ropedToMoon = 0 |
21 local ropedToMoon = 0 |
22 local checkPointReached = 1 -- 1 is start of the game |
22 local checkPointReached = 1 -- 1 is start of the game |
23 local objectives = loc("Go to the moon by using the flying saucer and complete the main mission").."|".. |
|
24 loc("Come back to this mission and visit the other planets to collect the crates").."|".. |
|
25 loc("Visit the Death Planet after completing all the other planets' main missions").."|".. |
|
26 loc("Come back to this mission after collecting all the device parts") |
|
27 -- dialogs |
23 -- dialogs |
28 local dialog01 = {} |
24 local dialog01 = {} |
29 local dialog02 = {} |
25 local dialog02 = {} |
30 local dialog03 = {} |
26 local dialog03 = {} |
31 local dialog04 = {} |
27 local dialog04 = {} |
34 local dialog07 = {} |
30 local dialog07 = {} |
35 local dialog08 = {} |
31 local dialog08 = {} |
36 local dialog09 = {} |
32 local dialog09 = {} |
37 -- mission objectives |
33 -- mission objectives |
38 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.").. |
|
36 "|"..loc("Travel to all the neighbor planets and collect all the pieces"), 1, 0}, |
39 [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}, |
40 [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}, |
41 [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}, |
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}, |
|
42 ["open_side_missions"] = {missionName, loc("Conquering the galaxy"), |
|
43 loc("Use the flying saucer to fly the other planets.").."|".. |
|
44 loc("Complete the remaining side missions to complete this mission.").."|".. |
|
45 loc("One flower: Incomplete side missions").."|".. |
|
46 loc("Two flowers: All missions complete"), 1, 8000}, |
|
47 ["free"] = {missionName, loc("Spacetrip"), loc("Use the flying saucer to fly to the other planets."), 1, 5000} |
44 } |
48 } |
45 -- crates |
49 -- crates |
46 local saucerX = 3270 |
50 local saucerX = 3270 |
47 local saucerY = 1500 |
51 local saucerY = 1500 |
48 -- hogs |
52 -- hogs |
177 function onGameStart() |
181 function onGameStart() |
178 -- wait for the first turn to start |
182 -- wait for the first turn to start |
179 AnimWait(hero.gear, 3000) |
183 AnimWait(hero.gear, 3000) |
180 |
184 |
181 FollowGear(hero.gear) |
185 FollowGear(hero.gear) |
182 ShowMission(loc("Spacetrip"), loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.").. |
186 if GetCampaignVar("Won") == "true" then |
183 "|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0) |
187 if GetCampaignVar("Mission1Won") == "true" then |
|
188 ShowMission(unpack(goals["free"])) |
|
189 else |
|
190 ShowMission(unpack(goals["open_side_missions"])) |
|
191 end |
|
192 else |
|
193 ShowMission(unpack(goals["init"])) |
|
194 end |
184 |
195 |
185 -- do checkpoint stuff needed after game starts |
196 -- do checkpoint stuff needed after game starts |
186 if checkPointReached == 1 then |
197 if checkPointReached == 1 then |
187 AddAnim(dialog01) |
198 AddAnim(dialog01) |
188 AddAmmo(hero.gear, amRope, 1) |
199 AddAmmo(hero.gear, amRope, 1) |
745 |
756 |
746 function sendStatsOnRopedToMoon() |
757 function sendStatsOnRopedToMoon() |
747 if ropedToMoon ~= 2 then |
758 if ropedToMoon ~= 2 then |
748 ropedToMoon = 2 |
759 ropedToMoon = 2 |
749 SendStat(siGameResult, loc("You have violated PAotH regulations!")) |
760 SendStat(siGameResult, loc("You have violated PAotH regulations!")) |
750 SendStat(siCustomAchievement, loc("You have triggered the secret Do-Not-Rope-to-the-Moon Defense System!")) |
761 SendStat(siCustomAchievement, loc("You have triggered the secret Do-Not-Rope-to-the-Moon Defense System.")) |
751 SendStat(siCustomAchievement, loc("Collect the crate with the flying saucer!")) |
762 SendStat(siCustomAchievement, loc("Use the flying saucer from the crate to fly to the moon.")) |
752 SendStat(siCustomAchievement, loc("Fly to the moon.")) |
|
753 sendSimpleTeamRankings({teamC.name}) |
763 sendSimpleTeamRankings({teamC.name}) |
754 EndGame() |
764 EndGame() |
755 end |
765 end |
756 end |
766 end |