110 AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y) |
110 AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y) |
111 HogTurnLeft(paoth1.gear, true) |
111 HogTurnLeft(paoth1.gear, true) |
112 paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses") |
112 paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses") |
113 AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y) |
113 AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y) |
114 HogTurnLeft(paoth2.gear, true) |
114 HogTurnLeft(paoth2.gear, true) |
115 -- Professor and Thugs |
115 -- Professor and Thugs |
116 AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
116 AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
117 professor.human = AddHog(professor.name, 0, 300, "tophats") |
117 professor.human = AddHog(professor.name, 0, 300, "tophats") |
118 AnimSetGearPosition(professor.human, hero.x + 70, hero.y) |
118 AnimSetGearPosition(professor.human, hero.x + 70, hero.y) |
119 HogTurnLeft(professor.human, true) |
119 HogTurnLeft(professor.human, true) |
120 AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
120 AddTeam(teamC.name, teamC.color, "Bone", "Island", "HillBilly", "cm_birdy") |
125 for i=1,table.getn(thugs) do |
125 for i=1,table.getn(thugs) do |
126 thugs[i].gear = AddHog(loc("thug").." #"..i, 1, thugs[i].health, "war_desertgrenadier1") |
126 thugs[i].gear = AddHog(loc("thug").." #"..i, 1, thugs[i].health, "war_desertgrenadier1") |
127 AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y) |
127 AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y) |
128 HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft) |
128 HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft) |
129 end |
129 end |
130 |
130 |
131 initCheckpoint("death01") |
131 initCheckpoint("death01") |
132 |
132 |
133 AnimInit() |
133 AnimInit() |
134 AnimationSetup() |
134 AnimationSetup() |
135 end |
135 end |
136 |
136 |
137 function onGameStart() |
137 function onGameStart() |
138 AnimWait(hero.gear, 3000) |
138 AnimWait(hero.gear, 3000) |
139 FollowGear(hero.gear) |
139 FollowGear(hero.gear) |
140 |
140 |
141 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
141 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
142 AddEvent(onEnemiesDeath, {hero.gear}, enemiesDeath, {hero.gear}, 0) |
142 AddEvent(onEnemiesDeath, {hero.gear}, enemiesDeath, {hero.gear}, 0) |
143 |
143 |
144 -- add crates |
144 -- add crates |
145 SpawnAmmoCrate(teleportCrate.x, teleportCrate.y, amTeleport) |
145 SpawnAmmoCrate(teleportCrate.x, teleportCrate.y, amTeleport) |
146 SpawnAmmoCrate(drillCrate.x, drillCrate.y, amTeleport) |
146 SpawnAmmoCrate(drillCrate.x, drillCrate.y, amTeleport) |
147 SpawnAmmoCrate(drillCrate.x, drillCrate.y, amDrill) |
147 SpawnAmmoCrate(drillCrate.x, drillCrate.y, amDrill) |
148 SpawnAmmoCrate(batCrate.x, batCrate.y, amBaseballBat) |
148 SpawnAmmoCrate(batCrate.x, batCrate.y, amBaseballBat) |
167 AddGear(2200, 1750, gtMine, 0, 0, 0, 0) |
167 AddGear(2200, 1750, gtMine, 0, 0, 0, 0) |
168 -- add girders |
168 -- add girders |
169 PlaceGirder(3770, 1370, 4) |
169 PlaceGirder(3770, 1370, 4) |
170 PlaceGirder(3700, 1460, 6) |
170 PlaceGirder(3700, 1460, 6) |
171 PlaceGirder(3840, 1460, 6) |
171 PlaceGirder(3840, 1460, 6) |
172 |
172 |
173 -- add ammo |
173 -- add ammo |
174 -- hero ammo |
174 -- hero ammo |
175 AddAmmo(hero.gear, amRope, 2) |
175 AddAmmo(hero.gear, amRope, 2) |
176 AddAmmo(hero.gear, amBazooka, 3) |
176 AddAmmo(hero.gear, amBazooka, 3) |
177 AddAmmo(hero.gear, amParachute, 1) |
177 AddAmmo(hero.gear, amParachute, 1) |
188 AddAmmo(professor.gear, amRope, 4) |
188 AddAmmo(professor.gear, amRope, 4) |
189 AddAmmo(professor.gear, amBazooka, 8) |
189 AddAmmo(professor.gear, amBazooka, 8) |
190 AddAmmo(professor.gear, amSwitch, 100) |
190 AddAmmo(professor.gear, amSwitch, 100) |
191 AddAmmo(professor.gear, amGrenade, 8) |
191 AddAmmo(professor.gear, amGrenade, 8) |
192 AddAmmo(professor.gear, amDEagle, 8) |
192 AddAmmo(professor.gear, amDEagle, 8) |
193 |
193 |
194 HideHog(professor.bot) |
194 HideHog(professor.bot) |
195 AddAnim(dialog01) |
195 AddAnim(dialog01) |
196 |
196 |
197 SendHealthStatsOff() |
197 SendHealthStatsOff() |
198 end |
198 end |
199 |
199 |
200 function onNewTurn() |
200 function onNewTurn() |
201 if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then |
201 if CurrentHedgehog == paoth1.gear or CurrentHedgehog == paoth2.gear then |
272 end |
272 end |
273 |
273 |
274 function enemiesDeath(gear) |
274 function enemiesDeath(gear) |
275 saveCompletedStatus(6) |
275 saveCompletedStatus(6) |
276 SendStat(siGameResult, loc("Congratulations, you won!")) |
276 SendStat(siGameResult, loc("Congratulations, you won!")) |
277 SendStat(siCustomAchievement, loc("You have successfuly eliminated Professor Hogevil")) |
277 SendStat(siCustomAchievement, loc("You have successfully eliminated Professor Hogevil")) |
278 SendStat(siCustomAchievement, loc("You have rescued H and Dr.Cornelius")) |
278 SendStat(siCustomAchievement, loc("You have rescued H and Dr.Cornelius")) |
279 SendStat(siCustomAchievement, loc("You have acquired the last part")) |
279 SendStat(siCustomAchievement, loc("You have acquired the last device part")) |
280 SendStat(siCustomAchievement, loc("Now go and play the menu mission to complete the campaign")) |
280 SendStat(siCustomAchievement, loc("Now go and play the menu mission to complete the campaign")) |
281 SendStat(siPlayerKills,'1',teamA.name) |
281 SendStat(siPlayerKills,'1',teamA.name) |
282 SendStat(siPlayerKills,'0',teamC.name) |
282 SendStat(siPlayerKills,'0',teamC.name) |
283 EndGame() |
283 EndGame() |
284 end |
284 end |
295 function AnimationSetup() |
295 function AnimationSetup() |
296 -- DIALOG01, GAME START, INTRODUCTION |
296 -- DIALOG01, GAME START, INTRODUCTION |
297 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
297 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
298 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
298 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
299 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the uninhabitable Death Planet..."), 5000}}) |
299 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the uninhabitable Death Planet..."), 5000}}) |
300 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome Hog Solo, surpised to see me?"), SAY_SAY, 4000}}) |
300 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome Hog Solo, surprised to see me?"), SAY_SAY, 4000}}) |
301 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}}) |
301 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}}) |
302 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}}) |
302 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}}) |
303 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}}) |
303 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}}) |
304 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Will you give me the other parts?"), SAY_SAY, 4000}}) |
304 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Will you give me the other parts?"), SAY_SAY, 4000}}) |
305 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
305 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
306 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I will never hand you the parts!"), SAY_SAY, 4000}}) |
306 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I will never hand you the parts!"), SAY_SAY, 4000}}) |
307 table.insert(dialog01, {func = AnimWait, args = {professor.human, 3000}}) |
307 table.insert(dialog01, {func = AnimWait, args = {professor.human, 3000}}) |
308 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Then prepare for battle!"), SAY_SAY, 4000}}) |
308 table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Then prepare for battle!"), SAY_SAY, 4000}}) |
309 table.insert(dialog01, {func = startBattle, args = {}}) |
309 table.insert(dialog01, {func = startBattle, args = {}}) |
310 end |
310 end |
311 |
311 |
312 -------------- OTHER FUNCTIONS ----------------- |
312 -------------- OTHER FUNCTIONS ----------------- |
313 |
313 |
314 function startBattle() |
314 function startBattle() |