111 -- Smugglers |
111 -- Smugglers |
112 AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
112 AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy") |
113 smuggler1.gear = AddHog(smuggler1.name, 1, 100, "hair_orange") |
113 smuggler1.gear = AddHog(smuggler1.name, 1, 100, "hair_orange") |
114 AnimSetGearPosition(smuggler1.gear, smuggler1.x, smuggler1.y) |
114 AnimSetGearPosition(smuggler1.gear, smuggler1.x, smuggler1.y) |
115 smuggler2.gear = AddHog(smuggler2.name, 1, 100, "lambda") |
115 smuggler2.gear = AddHog(smuggler2.name, 1, 100, "lambda") |
116 AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y) |
116 AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y) |
117 smuggler3.gear = AddHog(smuggler3.name, 1, 100, "beefeater") |
117 smuggler3.gear = AddHog(smuggler3.name, 1, 100, "beefeater") |
118 AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y) |
118 AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y) |
119 |
119 |
120 if checkPointReached == 1 then |
120 if checkPointReached == 1 then |
121 -- Start of the game |
121 -- Start of the game |
122 elseif checkPointReached == 2 then |
122 elseif checkPointReached == 2 then |
123 AnimSetGearPosition(hero.gear, 1050, 615) |
123 AnimSetGearPosition(hero.gear, 1050, 615) |
124 HogTurnLeft(hero.gear, true) |
124 HogTurnLeft(hero.gear, true) |
128 elseif checkPointReached == 4 then |
128 elseif checkPointReached == 4 then |
129 AnimSetGearPosition(hero.gear, 1160, 1180) |
129 AnimSetGearPosition(hero.gear, 1160, 1180) |
130 elseif checkPointReached == 5 then |
130 elseif checkPointReached == 5 then |
131 AnimSetGearPosition(hero.gear, girderX+40, girderY-30) |
131 AnimSetGearPosition(hero.gear, girderX+40, girderY-30) |
132 end |
132 end |
133 |
133 |
134 AnimInit() |
134 AnimInit() |
135 AnimationSetup() |
135 AnimationSetup() |
136 end |
136 end |
137 |
137 |
138 function onGameStart() |
138 function onGameStart() |
139 AnimWait(hero.gear, 3000) |
139 AnimWait(hero.gear, 3000) |
140 FollowGear(hero.gear) |
140 FollowGear(hero.gear) |
141 |
141 |
142 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
142 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
143 AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1) |
143 AddEvent(onHeroAtFirstBattle, {hero.gear}, heroAtFirstBattle, {hero.gear}, 1) |
144 AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1) |
144 AddEvent(onHeroFleeFirstBattle, {hero.gear}, heroFleeFirstBattle, {hero.gear}, 1) |
145 AddEvent(onHeroAtCheckpoint4, {hero.gear}, heroAtCheckpoint4, {hero.gear}, 0) |
145 AddEvent(onHeroAtCheckpoint4, {hero.gear}, heroAtCheckpoint4, {hero.gear}, 0) |
146 AddEvent(onHeroAtThirdBattle, {hero.gear}, heroAtThirdBattle, {hero.gear}, 0) |
146 AddEvent(onHeroAtThirdBattle, {hero.gear}, heroAtThirdBattle, {hero.gear}, 0) |
147 AddEvent(onCheckForWin1, {hero.gear}, checkForWin1, {hero.gear}, 0) |
147 AddEvent(onCheckForWin1, {hero.gear}, checkForWin1, {hero.gear}, 0) |
148 AddEvent(onCheckForWin2, {hero.gear}, checkForWin2, {hero.gear}, 0) |
148 AddEvent(onCheckForWin2, {hero.gear}, checkForWin2, {hero.gear}, 0) |
149 |
149 |
150 -- smugglers ammo |
150 -- smugglers ammo |
151 AddAmmo(smuggler1.gear, amBazooka, 2) |
151 AddAmmo(smuggler1.gear, amBazooka, 2) |
152 AddAmmo(smuggler1.gear, amGrenade, 2) |
152 AddAmmo(smuggler1.gear, amGrenade, 2) |
153 AddAmmo(smuggler1.gear, amDEagle, 2) |
153 AddAmmo(smuggler1.gear, amDEagle, 2) |
154 AddAmmo(smuggler3.gear, amRope, 2) |
154 AddAmmo(smuggler3.gear, amRope, 2) |
155 |
155 |
156 -- spawn crates |
156 -- spawn crates |
157 SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch) |
157 SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch) |
158 SpawnAmmoCrate(btorch3X, btorch3Y, amBlowTorch) |
158 SpawnAmmoCrate(btorch3X, btorch3Y, amBlowTorch) |
159 SpawnAmmoCrate(rope1X, rope1Y, amRope) |
159 SpawnAmmoCrate(rope1X, rope1Y, amRope) |
160 SpawnAmmoCrate(rope2X, rope2Y, amRope) |
160 SpawnAmmoCrate(rope2X, rope2Y, amRope) |
161 SpawnAmmoCrate(rope3X, rope3Y, amRope) |
161 SpawnAmmoCrate(rope3X, rope3Y, amRope) |
162 SpawnAmmoCrate(portalX, portalY, amPortalGun) |
162 SpawnAmmoCrate(portalX, portalY, amPortalGun) |
163 SpawnAmmoCrate(girderX, girderY, amGirder) |
163 SpawnAmmoCrate(girderX, girderY, amGirder) |
164 |
164 |
165 SpawnHealthCrate(3300, 970) |
165 SpawnHealthCrate(3300, 970) |
166 |
166 |
167 -- adding mines - BOOM! |
167 -- adding mines - BOOM! |
168 AddGear(1280, 460, gtMine, 0, 0, 0, 0) |
168 AddGear(1280, 460, gtMine, 0, 0, 0, 0) |
169 AddGear(270, 460, gtMine, 0, 0, 0, 0) |
169 AddGear(270, 460, gtMine, 0, 0, 0, 0) |
170 AddGear(3460, 60, gtMine, 0, 0, 0, 0) |
170 AddGear(3460, 60, gtMine, 0, 0, 0, 0) |
171 AddGear(3500, 240, gtMine, 0, 0, 0, 0) |
171 AddGear(3500, 240, gtMine, 0, 0, 0, 0) |
172 AddGear(3410, 670, gtMine, 0, 0, 0, 0) |
172 AddGear(3410, 670, gtMine, 0, 0, 0, 0) |
173 AddGear(3450, 720, gtMine, 0, 0, 0, 0) |
173 AddGear(3450, 720, gtMine, 0, 0, 0, 0) |
174 |
174 |
175 local x = 800 |
175 local x = 800 |
176 while x < 1630 do |
176 while x < 1630 do |
177 AddGear(x, 900, gtMine, 0, 0, 0, 0) |
177 AddGear(x, 900, gtMine, 0, 0, 0, 0) |
178 x = x + math.random(8,20) |
178 x = x + math.random(8,20) |
179 end |
179 end |
204 AddAmmo(hero.gear, amBazooka, 3) |
204 AddAmmo(hero.gear, amBazooka, 3) |
205 AddAmmo(hero.gear, amParachute, 1) |
205 AddAmmo(hero.gear, amParachute, 1) |
206 AddAmmo(hero.gear, amGrenade, 6) |
206 AddAmmo(hero.gear, amGrenade, 6) |
207 AddAmmo(hero.gear, amDEagle, 4) |
207 AddAmmo(hero.gear, amDEagle, 4) |
208 AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1))) |
208 AddAmmo(hero.gear, amRCPlane, tonumber(getBonus(1))) |
209 |
209 |
210 AddAnim(dialog01) |
210 AddAnim(dialog01) |
211 elseif checkPointReached == 2 or checkPointReached == 3 then |
211 elseif checkPointReached == 2 or checkPointReached == 3 then |
212 ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
212 ShowMission(campaignName, missionName, loc("The device part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
213 loadHeroAmmo() |
213 loadHeroAmmo() |
214 |
214 |
215 secondBattle() |
215 secondBattle() |
216 elseif checkPointReached == 4 or checkPointReached == 5 then |
216 elseif checkPointReached == 4 or checkPointReached == 5 then |
217 ShowMission(campaignName, missionName, loc("The part is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
217 ShowMission(campaignName, missionName, loc("The part device is hidden in one of the crates! Go and get it!"), -amSkip, 0) |
218 loadHeroAmmo() |
218 loadHeroAmmo() |
219 end |
219 end |
220 |
220 |
221 SendHealthStatsOff() |
221 SendHealthStatsOff() |
222 end |
222 end |
223 |
223 |
224 function onNewTurn() |
224 function onNewTurn() |
225 if CurrentHedgehog ~= hero.gear and not heroIsInBattle then |
225 if CurrentHedgehog ~= hero.gear and not heroIsInBattle then |
428 function AnimationSetup() |
428 function AnimationSetup() |
429 -- DIALOG 01 - Start, getting info about the device |
429 -- DIALOG 01 - Start, getting info about the device |
430 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
430 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
431 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
431 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
432 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Planet of Sand, you have to double check your moves..."), 5000}}) |
432 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Planet of Sand, you have to double check your moves..."), 5000}}) |
433 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}}) |
433 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finally you are here..."), SAY_SAY, 2000}}) |
434 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}}) |
434 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}}) |
435 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me in such a short notice!"), SAY_SAY, 3000}}) |
435 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me on such a short notice!"), SAY_SAY, 3000}}) |
436 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
436 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}}) |
437 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for H!"), SAY_SAY, 4000}}) |
437 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for H!"), SAY_SAY, 4000}}) |
438 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}}) |
438 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}}) |
439 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heared the local tribes saying that many years ago some PAotH scientists were dumping their waste here"), SAY_SAY, 5000}}) |
439 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heard that the local tribes say that many years ago some PAotH scientists were dumping their waste here"), SAY_SAY, 5000}}) |
440 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("H confimed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}}) |
440 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("H confirmed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}}) |
441 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}}) |
441 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}}) |
442 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable items they can find"), SAY_SAY, 5000}}) |
442 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable items they can find"), SAY_SAY, 5000}}) |
443 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to rob you!"), SAY_SAY, 4000}}) |
443 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to rob you!"), SAY_SAY, 4000}}) |
444 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}}) |
444 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}}) |
445 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}}) |
445 table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}}) |
446 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}}) |
446 table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}}) |
447 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}}) |
447 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}}) |
448 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}}) |
448 table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}}) |
449 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
449 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
450 table.insert(dialog01, {func = startMission, args = {hero.gear}}) |
450 table.insert(dialog01, {func = startMission, args = {hero.gear}}) |
451 end |
451 end |
452 |
452 |
453 --------------- OTHER FUNCTIONS ------------------ |
453 --------------- OTHER FUNCTIONS ------------------ |
454 |
454 |
455 function startMission() |
455 function startMission() |
459 |
459 |
460 function secondBattle() |
460 function secondBattle() |
461 -- second battle |
461 -- second battle |
462 heroIsInBattle = true |
462 heroIsInBattle = true |
463 ongoingBattle = 2 |
463 ongoingBattle = 2 |
464 AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice..."), SAY_THINK, 5000) |
464 AnimSay(smuggler2.gear, loc("This is seems like a wealthy hedgehog, nice..."), SAY_THINK, 5000) |
465 AnimSwitchHog(smuggler2.gear) |
465 AnimSwitchHog(smuggler2.gear) |
466 TurnTimeLeft = 0 |
466 TurnTimeLeft = 0 |
467 end |
467 end |
468 |
468 |
469 function saveCheckPointLocal(cpoint) |
469 function saveCheckPointLocal(cpoint) |
470 -- save checkpoint |
470 -- save checkpoint |
471 saveCheckpoint(cpoint) |
471 saveCheckpoint(cpoint) |
472 SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
472 SaveCampaignVar("HeroHealth", GetHealth(hero.gear)) |
473 -- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal - rcplane |
473 -- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal - rcplane |
474 SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade).. |
474 SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade).. |
475 GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle).. |
475 GetAmmoCount(hero.gear, amRope)..GetAmmoCount(hero.gear, amParachute)..GetAmmoCount(hero.gear, amDEagle).. |
476 GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction).. |
476 GetAmmoCount(hero.gear, amBlowTorch)..GetAmmoCount(hero.gear, amConstruction).. |