9 HedgewarsScriptLoad("/Scripts/Animate.lua") |
9 HedgewarsScriptLoad("/Scripts/Animate.lua") |
10 |
10 |
11 ----------------- VARIABLES -------------------- |
11 ----------------- VARIABLES -------------------- |
12 -- globals |
12 -- globals |
13 local campaignName = loc("A Space Adventure") |
13 local campaignName = loc("A Space Adventure") |
14 local missionName = loc("Desert planet, lost in sand!") |
14 local missionName = loc("Death planet") |
15 -- dialogs |
15 -- dialogs |
|
16 local dialog01 = {} |
16 -- missions objectives |
17 -- missions objectives |
|
18 local goals = { |
|
19 [dialog01] = {missionName, loc("The final part"), loc("Defeat Professor Hogevil!"), 1, 4500}, |
|
20 } |
17 -- crates |
21 -- crates |
18 local portalCrate = {x = 1520, y = 1950} |
22 local portalCrate = {x = 1520, y = 1950} |
19 local cakeCrate = {x = 325, y = 1500} |
23 local cakeCrate = {x = 325, y = 1500} |
20 -- hogs |
24 -- hogs |
21 local hero = {} |
25 local hero = {} |
120 AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y) |
124 AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y) |
121 HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft) |
125 HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft) |
122 end |
126 end |
123 |
127 |
124 AnimInit() |
128 AnimInit() |
125 --AnimationSetup() |
129 AnimationSetup() |
126 end |
130 end |
127 |
131 |
128 function onGameStart() |
132 function onGameStart() |
129 AnimWait(hero.gear, 3000) |
133 AnimWait(hero.gear, 3000) |
130 FollowGear(hero.gear) |
134 FollowGear(hero.gear) |
164 AddAmmo(professor.gear, amSwitch, 100) |
168 AddAmmo(professor.gear, amSwitch, 100) |
165 AddAmmo(professor.gear, amGrenade, 8) |
169 AddAmmo(professor.gear, amGrenade, 8) |
166 AddAmmo(professor.gear, amDEagle, 8) |
170 AddAmmo(professor.gear, amDEagle, 8) |
167 |
171 |
168 HideHog(professor.bot) |
172 HideHog(professor.bot) |
169 DeleteGear(professor.human) |
173 --DeleteGear(professor.human) |
170 --RestoreHog(professor.bot) |
174 --RestoreHog(professor.bot) |
|
175 AddAnim(dialog01) |
|
176 |
171 SendHealthStatsOff() |
177 SendHealthStatsOff() |
172 end |
178 end |
173 |
179 |
174 function onNewTurn() |
180 function onNewTurn() |
175 if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then |
181 if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then |
253 |
259 |
254 function Skipanim(anim) |
260 function Skipanim(anim) |
255 if goals[anim] ~= nil then |
261 if goals[anim] ~= nil then |
256 ShowMission(unpack(goals[anim])) |
262 ShowMission(unpack(goals[anim])) |
257 end |
263 end |
|
264 startBattle() |
258 end |
265 end |
259 |
266 |
260 function AnimationSetup() |
267 function AnimationSetup() |
261 -- TODO ADD DIALOGS |
268 -- DIALOG01, GAME START, INTRODUCTION |
262 |
269 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
263 end |
270 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
|
271 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Death Planet, where no other hog lives..."), 5000}}) |
|
272 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome HogSolo, surpised to see me?"), SAY_SAY, 4000}}) |
|
273 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("As you can see I have survived our last encounter and I had time to plot my master plan!"), SAY_SAY, 4000}}) |
|
274 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("I've thought that the best way to get the device is to let you collect most of the parts for me!"), SAY_SAY, 4000}}) |
|
275 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("So, now I got the last part and I have your friends captured..."), SAY_SAY, 4000}}) |
|
276 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("So, will you give me the other parts?"), SAY_SAY, 4000}}) |
|
277 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
|
278 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I will never hand you the parts!"), SAY_SAY, 4000}}) |
|
279 table.insert(dialog01, {func = AnimWait, args = {professor.human, 3000}}) |
|
280 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Then prepare for battle!"), SAY_SAY, 4000}}) |
|
281 table.insert(dialog01, {func = startBattle, args = {}}) |
|
282 end |
|
283 |
|
284 -------------- OTHER FUNCTIONS ----------------- |
|
285 |
|
286 function startBattle() |
|
287 DeleteGear(professor.human) |
|
288 RestoreHog(professor.bot) |
|
289 AnimSwitchHog(professor.gear) |
|
290 TurnTimeLeft = 0 |
|
291 end |