81 end |
80 end |
82 |
81 |
83 function onGameStart() |
82 function onGameStart() |
84 AnimWait(hero.gear, 3000) |
83 AnimWait(hero.gear, 3000) |
85 FollowGear(hero.gear) |
84 FollowGear(hero.gear) |
86 ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0) |
|
87 |
85 |
88 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
86 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
89 |
87 |
90 AddAmmo(hero.gear, amRope, 1) |
88 AddAmmo(hero.gear, amRope, 1) |
91 |
89 |
92 SendHealthStatsOff() |
90 SendHealthStatsOff() |
93 hogTurn = runner.gear |
91 hogTurn = runner.gear |
94 AddAnim(dialog01) |
92 AddAnim(dialog01) |
|
93 end |
|
94 |
|
95 function onGearAdd(gear) |
|
96 if GetGearType(gear) == gtRope then |
|
97 HideMission() |
|
98 end |
95 end |
99 end |
96 |
100 |
97 function onNewTurn() |
101 function onNewTurn() |
98 if startChallenge and currentPosition < 5 then |
102 if startChallenge and currentPosition < 5 then |
99 if CurrentHedgehog ~= hero.gear then |
103 if CurrentHedgehog ~= hero.gear then |
148 -------------- ANIMATIONS ------------------ |
152 -------------- ANIMATIONS ------------------ |
149 |
153 |
150 function Skipanim(anim) |
154 function Skipanim(anim) |
151 if goals[anim] ~= nil then |
155 if goals[anim] ~= nil then |
152 ShowMission(unpack(goals[anim])) |
156 ShowMission(unpack(goals[anim])) |
153 end |
157 end |
154 if anim == dialog01 then |
158 if anim == dialog01 then |
155 moveRunner() |
159 moveRunner() |
156 elseif anim == dialog02 then |
160 elseif anim == dialog02 then |
157 win() |
161 win() |
158 end |
162 end |
159 end |
163 end |
160 |
164 |
161 function AnimationSetup() |
165 function AnimationSetup() |
162 -- DIALOG 01 - Start, game instructions |
166 -- DIALOG 01 - Start, game instructions |
163 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
167 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
165 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon ..."), 5000}}) |
169 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon ..."), 5000}}) |
166 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil, huh?"), SAY_SAY, 3000}}) |
170 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil, huh?"), SAY_SAY, 3000}}) |
167 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}}) |
171 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}}) |
168 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}}) |
172 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}}) |
169 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}}) |
173 table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}}) |
|
174 table.insert(dialog01, {func = ShowMission, args = goals[dialog01]}) |
170 table.insert(dialog01, {func = moveRunner, args = {}}) |
175 table.insert(dialog01, {func = moveRunner, args = {}}) |
171 -- DIALOG 02 - Hog Solo story |
176 -- DIALOG 02 - Hog Solo story |
172 AddSkipFunction(dialog02, Skipanim, {dialog02}) |
177 AddSkipFunction(dialog02, Skipanim, {dialog02}) |
173 table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}}) |
178 table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}}) |
174 table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}}) |
179 table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}}) |