22 local heroAtFinalStep = false |
21 local heroAtFinalStep = false |
23 local iceGunTaken = false |
22 local iceGunTaken = false |
24 local checkPointReached = 1 -- 1 is normal spawn |
23 local checkPointReached = 1 -- 1 is normal spawn |
25 -- dialogs |
24 -- dialogs |
26 local dialog01 = {} |
25 local dialog01 = {} |
|
26 local dialog02 = {} |
27 -- mission objectives |
27 -- mission objectives |
28 local goals = { |
28 local goals = { |
29 [dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500}, |
29 [dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500}, |
30 } |
30 } |
31 -- crates |
31 -- crates |
438 -- more custom stats |
438 -- more custom stats |
439 EndGame() |
439 EndGame() |
440 end |
440 end |
441 |
441 |
442 function heroWin(gear) |
442 function heroWin(gear) |
443 SendStat('siGameResult', loc("Congratulations, you got the part!")) |
443 TurnTimeLeft=0 |
444 -- more custom stats |
444 if GetX(hero.gear) < GetX(bandit1.gear) then |
445 EndGame() |
445 HogTurnLeft(bandit1.gear, true) |
|
446 else |
|
447 HogTurnLeft(bandit1.gear, false) |
|
448 end |
|
449 AddAnim(dialog02) |
446 end |
450 end |
447 |
451 |
448 -------------- ANIMATIONS ------------------ |
452 -------------- ANIMATIONS ------------------ |
449 |
453 |
450 function Skipanim(anim) |
454 function Skipanim(anim) |
451 if goals[anim] ~= nil then |
455 if goals[anim] ~= nil then |
452 ShowMission(unpack(goals[anim])) |
456 ShowMission(unpack(goals[anim])) |
453 end |
457 end |
|
458 if anim == dialog02 then |
|
459 actionsOnWin() |
|
460 end |
454 end |
461 end |
455 |
462 |
456 function AnimationSetup() |
463 function AnimationSetup() |
457 -- DIALOG 01 - Start, welcome to moon |
464 -- DIALOG 01 - Start, welcome to moon |
458 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
465 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
469 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
476 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
470 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Be careful, your gadgets won't work in the bandit area. You should get an ice gun"), SAY_SAY, 7000}}) |
477 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Be careful, your gadgets won't work in the bandit area. You should get an ice gun"), SAY_SAY, 7000}}) |
471 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is one below us!"), SAY_SAY, 4000}}) |
478 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is one below us!"), SAY_SAY, 4000}}) |
472 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
479 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
473 table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
480 table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}}) |
474 end |
481 -- DIALOG 02 - Hero got to Thant2 |
|
482 AddSkipFunction(dialog02, Skipanim, {dialog01}) |
|
483 table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3000}}) |
|
484 table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("Congratulations, now you can take Thanta's part..."), 5000}}) |
|
485 table.insert(dialog02, {func = AnimSay, args = {bandit1.gear, loc("Oh! Please pare me. You can take all my treasures!"), SAY_SAY, 3000}}) |
|
486 table.insert(dialog02, {func = AnimWait, args = {hero.gear, 5000}}) |
|
487 table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("I just want the strange device you found!"), SAY_SAY, 3000}}) |
|
488 table.insert(dialog02, {func = AnimWait, args = {bandit1.gear, 4000}}) |
|
489 table.insert(dialog02, {func = AnimSay, args = {bandit1.gear, loc("Here! Take it..."), SAY_SAY, 3000}}) |
|
490 table.insert(dialog02, {func = actionsOnWin, args = {}}) |
|
491 end |
|
492 |
|
493 -------------- Other Functions ------------------- |
|
494 |
|
495 function actionsOnWin() |
|
496 SendStat('siGameResult', loc("Congratulations, you got the part!")) |
|
497 SaveCampaignVar("IcePlanetPartAcquired", "true") |
|
498 -- more custom stats |
|
499 EndGame() |
|
500 end |