105 AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y) |
105 AnimSetGearPosition(enemiesOdd[i].gear, enemiesOdd[i].x, enemiesOdd[i].y) |
106 end |
106 end |
107 |
107 |
108 initCheckpoint("fruit03") |
108 initCheckpoint("fruit03") |
109 |
109 |
110 AnimInit(true) |
110 AnimInit() |
111 AnimationSetup() |
|
112 end |
111 end |
113 |
112 |
114 function onGameStart() |
113 function onGameStart() |
115 AnimWait(hero.gear, 3000) |
|
116 FollowGear(hero.gear) |
114 FollowGear(hero.gear) |
117 ShowMission(unpack(goals["init"])) |
115 ShowMission(unpack(goals["init"])) |
118 |
116 |
119 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
117 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
120 AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0) |
118 AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0) |
121 |
119 |
122 --hero ammo |
120 --hero ammo |
123 AddAmmo(hero.gear, amTeleport, 2) |
121 AddAmmo(hero.gear, amTeleport, 2) |
124 AddAmmo(hero.gear, amSniperRifle, 2) |
122 AddAmmo(hero.gear, amSniperRifle, 2) |
125 AddAmmo(hero.gear, amWatermelon, 2) |
123 AddAmmo(hero.gear, amWatermelon, 2) |
|
124 |
|
125 -- these 2 are needed in order hero has 10 sec more in the first turn |
|
126 AddAmmo(hero.gear, amSkip, 100) |
|
127 timeLeft = 0 |
|
128 |
126 --enemies ammo |
129 --enemies ammo |
127 AddAmmo(enemiesOdd[1].gear, amDEagle, 100) |
130 AddAmmo(enemiesOdd[1].gear, amDEagle, 100) |
128 AddAmmo(enemiesOdd[1].gear, amSniperRifle, 100) |
131 AddAmmo(enemiesOdd[1].gear, amSniperRifle, 100) |
129 AddAmmo(enemiesOdd[1].gear, amWatermelon, 1) |
132 AddAmmo(enemiesOdd[1].gear, amWatermelon, 1) |
130 AddAmmo(enemiesOdd[1].gear, amGrenade, 5) |
133 AddAmmo(enemiesOdd[1].gear, amGrenade, 5) |
132 AddAmmo(enemiesEven[1].gear, amSniperRifle, 100) |
135 AddAmmo(enemiesEven[1].gear, amSniperRifle, 100) |
133 AddAmmo(enemiesEven[1].gear, amWatermelon, 1) |
136 AddAmmo(enemiesEven[1].gear, amWatermelon, 1) |
134 AddAmmo(enemiesEven[1].gear, amGrenade, 5) |
137 AddAmmo(enemiesEven[1].gear, amGrenade, 5) |
135 |
138 |
136 SendHealthStatsOff() |
139 SendHealthStatsOff() |
137 AddAnim(dialog01) |
|
138 end |
140 end |
139 |
141 |
140 function onNewTurn() |
142 function onNewTurn() |
141 if CurrentHedgehog == hero.gear then |
143 if CurrentHedgehog == hero.gear then |
142 if firstTurn then |
144 if firstTurn then |
|
145 -- Unique game rule in this mission |
143 TurnTimeLeft = 25000 |
146 TurnTimeLeft = 25000 |
|
147 -- Generous ready time on first turn to give more time to read |
|
148 ReadyTimeLeft = 35000 |
144 battleStarted = true |
149 battleStarted = true |
|
150 firstTurn = false |
145 end |
151 end |
146 if lastWeaponUsed == amSkip then |
152 if lastWeaponUsed == amSkip then |
147 TurnTimeLeft = TurnTime + timeLeft |
153 TurnTimeLeft = TurnTime + timeLeft |
148 end |
154 end |
149 timeLeft = 0 |
155 timeLeft = 0 |
186 end |
192 end |
187 end |
193 end |
188 |
194 |
189 onHogAttack = hideMissionOnAction |
195 onHogAttack = hideMissionOnAction |
190 onAttack = hideMissionOnAction |
196 onAttack = hideMissionOnAction |
191 onLeft = hideMissionOnAction |
|
192 onRight = hideMissionOnAction |
|
193 onUp = hideMissionOnAction |
|
194 onDown = hideMissionOnAction |
|
195 onLJump = hideMissionOnAction |
|
196 onHJump = hideMissionOnAction |
|
197 onSlot = hideMissionOnAction |
197 onSlot = hideMissionOnAction |
198 onSetWeapon = hideMissionOnAction |
198 onSetWeapon = hideMissionOnAction |
199 onTimer = hideMissionOnAction |
|
200 |
|
201 function onPrecise() |
|
202 if GameTime > 3000 then |
|
203 SetAnimSkip(true) |
|
204 end |
|
205 end |
|
206 |
199 |
207 -------------- EVENTS ------------------ |
200 -------------- EVENTS ------------------ |
208 |
201 |
209 function onHeroDeath(gear) |
202 function onHeroDeath(gear) |
210 if not GetHealth(hero.gear) then |
203 if not GetHealth(hero.gear) then |
255 SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission.")) |
248 SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission.")) |
256 sendSimpleTeamRankings({teamA.name, teamB.name, teamC.name}) |
249 sendSimpleTeamRankings({teamA.name, teamB.name, teamC.name}) |
257 SaveCampaignVar("Mission10Won", "true") |
250 SaveCampaignVar("Mission10Won", "true") |
258 checkAllMissionsCompleted() |
251 checkAllMissionsCompleted() |
259 EndGame() |
252 EndGame() |
260 end |
|
261 |
|
262 -------------- ANIMATIONS ------------------ |
|
263 |
|
264 function Skipanim(anim) |
|
265 startBattle() |
|
266 end |
|
267 |
|
268 function AnimationSetup() |
|
269 -- DIALOG 01 - Start, game instructions |
|
270 AddSkipFunction(dialog01, Skipanim, {dialog01}) |
|
271 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}}) |
|
272 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Fruit Planet Hog Solo got lost ..."), 5000}}) |
|
273 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("... and got ambushed by the Red Strawberries"), 5000}}) |
|
274 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Use your available weapons in order to eliminate the enemies"), 5000}}) |
|
275 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You can only use the sniper rifle or the watermelon bomb"), 5000}}) |
|
276 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only 2 watermelon bombs during the game"), 5000}}) |
|
277 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra sniper rifle every time you kill an enemy hog with a limit of max 4 rifles"), 5000}}) |
|
278 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll get an extra teleport every time you kill an enemy hog with a limit of max 2 teleports"), 5000}}) |
|
279 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("The first turn will last 25 sec and every other turn 15 sec"), 5000}}) |
|
280 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("If you skip the game your time left will be added to your next turn"), 5000}}) |
|
281 table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Some parts of the land are indestructible"), 5000}}) |
|
282 table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}}) |
|
283 table.insert(dialog01, {func = startBattle, args = {hero.gear}}) |
|
284 end |
253 end |
285 |
254 |
286 ------------------ Other Functions ------------------- |
255 ------------------ Other Functions ------------------- |
287 |
256 |
288 function turnHogs() |
257 function turnHogs() |