20 local RED = 0xff0000ff |
20 local RED = 0xff0000ff |
21 local GREEN = 0x38d61cff |
21 local GREEN = 0x38d61cff |
22 local challengeObjectives = loc("To win the game you have to pass into the rings in time").. |
22 local challengeObjectives = loc("To win the game you have to pass into the rings in time").. |
23 "|"..loc("You'll get extra time in case you need it when you pass a ring").."|".. |
23 "|"..loc("You'll get extra time in case you need it when you pass a ring").."|".. |
24 loc("Every 2 rings, the ring color will be green and you'll get an extra flying saucer").."|".. |
24 loc("Every 2 rings, the ring color will be green and you'll get an extra flying saucer").."|".. |
25 loc("Use space button twice to change flying saucer while floating in mid-air") |
25 loc("Use the attack key twice to change the flying saucer while floating in mid-air") |
26 -- dialogs |
26 -- dialogs |
27 local dialog01 = {} |
27 local dialog01 = {} |
28 -- mission objectives |
28 -- mission objectives |
29 local goals = { |
29 local goals = { |
30 [dialog01] = {missionName, loc("Getting ready"), challengeObjectives, 1, 4500}, |
30 [dialog01] = {missionName, loc("Getting ready"), challengeObjectives, 1, 4500}, |
97 end |
97 end |
98 |
98 |
99 function onGameStart() |
99 function onGameStart() |
100 AnimWait(hero.gear, 3000) |
100 AnimWait(hero.gear, 3000) |
101 FollowGear(hero.gear) |
101 FollowGear(hero.gear) |
102 ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0) |
102 ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0) |
103 |
103 |
104 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
104 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
105 |
105 |
106 AddAmmo(hero.gear, amJetpack, 3) |
106 AddAmmo(hero.gear, amJetpack, 3) |
107 |
107 |
136 -- GAME OVER, WIN! |
136 -- GAME OVER, WIN! |
137 totalTime = totalTime - TurnTimeLeft |
137 totalTime = totalTime - TurnTimeLeft |
138 totalTime = totalTime / 1000 |
138 totalTime = totalTime / 1000 |
139 local saucersLeft = GetAmmoCount(hero.gear, amJetpack) |
139 local saucersLeft = GetAmmoCount(hero.gear, amJetpack) |
140 local saucersUsed = totalSaucers - saucersLeft |
140 local saucersUsed = totalSaucers - saucersLeft |
141 SendStat(siGameResult, loc("Hoorah! You are a champion!")) |
141 SendStat(siGameResult, loc("Hooray! You are a champion!")) |
142 SendStat(siCustomAchievement, loc("You completed the mission in "..totalTime.." seconds")) |
142 SendStat(siCustomAchievement, string.format(loc("You completed the mission in %.3f seconds.", totalTime))) |
143 SendStat(siCustomAchievement, loc("You have used "..saucersUsed.." flying saucers")) |
143 SendStat(siCustomAchievement, string.format(loc("You have used %d flying saucers.", saucersUsed))) |
144 SendStat(siCustomAchievement, loc("You had "..saucersLeft.." more flying saucers left")) |
144 SendStat(siCustomAchievement, string.format(loc("You had %d additional flying saucers left"), saucersLeft)) |
145 SendStat(siPlayerKills,'1',teamA.name) |
145 SendStat(siPlayerKills,'1',teamA.name) |
146 EndGame() |
146 EndGame() |
147 end |
147 end |
148 end |
148 end |
149 end |
149 end |
186 |
186 |
187 function AnimationSetup() |
187 function AnimationSetup() |
188 -- DIALOG 01 - Start, some story telling |
188 -- DIALOG 01 - Start, some story telling |
189 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
189 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
190 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
190 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
191 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Ice Planet flying saucer stadium..."), 5000}}) |
191 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Ice Planet Flying Saucer Stadium ..."), 5000}}) |
192 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("This is the Olympic stadium of saucer flying..."), SAY_SAY, 4000}}) |
192 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("This is the Olympic stadium of saucer flying."), SAY_SAY, 4000}}) |
193 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("All the saucer pilots dream to come here one day in order to compete with the best!"), SAY_SAY, 5000}}) |
193 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("All the saucer pilots dream to come here one day in order to compete with the best!"), SAY_SAY, 5000}}) |
194 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now you have the chance to try and claim the place that you deserve among the best..."), SAY_SAY, 6000}}) |
194 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now you have the chance to try and claim the place that you deserve among the best."), SAY_SAY, 6000}}) |
195 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use the saucer and pass through the rings..."), 5000}}) |
195 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use the saucer and pass through the rings."), 5000}}) |
196 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Pause the game by pressing the pause key (default \"P\") for more details"), 5000}}) |
196 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Pause the game by pressing the pause key (default \"P\") for more details"), 5000}}) |
197 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("... can you do it?"), SAY_SAY, 2000}}) |
197 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Can you do it?"), SAY_SAY, 2000}}) |
198 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
198 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
199 table.insert(dialog01, {func = startFlying, args = {hero.gear}}) |
199 table.insert(dialog01, {func = startFlying, args = {hero.gear}}) |
200 end |
200 end |
201 |
201 |
202 ------------------ Other Functions ------------------- |
202 ------------------ Other Functions ------------------- |
258 return false |
258 return false |
259 end |
259 end |
260 |
260 |
261 function heroLost() |
261 function heroLost() |
262 SendStat(siGameResult, loc("Oh man! Learn how to fly!")) |
262 SendStat(siGameResult, loc("Oh man! Learn how to fly!")) |
263 SendStat(siCustomAchievement, loc("To win the game you have to pass into the rings in time")) |
263 SendStat(siCustomAchievement, loc("To win the game you have to pass into the rings in time.")) |
264 SendStat(siCustomAchievement, loc("You'll get extra time in case you need it when you pass a ring")) |
264 SendStat(siCustomAchievement, loc("You'll get extra time in case you need it when you pass a ring.")) |
265 SendStat(siCustomAchievement, loc("Every 2 rings you'll get extra flying saucers")) |
265 SendStat(siCustomAchievement, loc("Every 2 rings you'll get extra flying saucers.")) |
266 SendStat(siCustomAchievement, loc("Use space button twice to change flying saucer while being on air")) |
266 SendStat(siCustomAchievement, loc("Use the attack key twice to change the flying saucer while being in air.")) |
267 SendStat(siPlayerKills,'0',teamA.name) |
267 SendStat(siPlayerKills,'0',teamA.name) |
268 EndGame() |
268 EndGame() |
269 end |
269 end |