33 local hero = { |
33 local hero = { |
34 name = loc("Hog Solo"), |
34 name = loc("Hog Solo"), |
35 x = 1100, |
35 x = 1100, |
36 y = 560 |
36 y = 560 |
37 } |
37 } |
|
38 local heroTurns = 0 |
38 local enemiesOdd = { |
39 local enemiesOdd = { |
39 {name = loc("Hog 1"), x = 2000 , y = 175}, |
40 {name = loc("Hog 1"), x = 2000 , y = 175}, |
40 {name = loc("Hog III"), x = 1950 , y = 1110}, |
41 {name = loc("Hog III"), x = 1950 , y = 1110}, |
41 {name = loc("Hog 100"), x = 1270 , y = 1480}, |
42 {name = loc("Hog 100"), x = 1270 , y = 1480}, |
42 {name = loc("Hog Saturn"), x = 240 , y = 790}, |
43 {name = loc("Hog Saturn"), x = 240 , y = 790}, |
133 AddAmmo(enemiesEven[1].gear, amDEagle, 100) |
134 AddAmmo(enemiesEven[1].gear, amDEagle, 100) |
134 AddAmmo(enemiesEven[1].gear, amSniperRifle, 100) |
135 AddAmmo(enemiesEven[1].gear, amSniperRifle, 100) |
135 AddAmmo(enemiesEven[1].gear, amWatermelon, 1) |
136 AddAmmo(enemiesEven[1].gear, amWatermelon, 1) |
136 AddAmmo(enemiesEven[1].gear, amGrenade, 5) |
137 AddAmmo(enemiesEven[1].gear, amGrenade, 5) |
137 |
138 |
|
139 turnHogs() |
|
140 |
138 SendHealthStatsOff() |
141 SendHealthStatsOff() |
139 end |
142 end |
140 |
143 |
141 function onNewTurn() |
144 function onNewTurn() |
142 if CurrentHedgehog == hero.gear then |
145 if CurrentHedgehog == hero.gear then |
266 end |
269 end |
267 |
270 |
268 function heroWin(gear) |
271 function heroWin(gear) |
269 saveBonus(2, 1) |
272 saveBonus(2, 1) |
270 SendStat(siGameResult, loc("Congratulations, you won!")) |
273 SendStat(siGameResult, loc("Congratulations, you won!")) |
271 SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), TotalRounds)) |
274 SendStat(siCustomAchievement, string.format(loc("You completed the mission in %d rounds."), heroTurns)) |
272 local record = tonumber(GetCampaignVar("FastestPreciseShooting")) |
275 local record = tonumber(GetCampaignVar("FastestPreciseShooting")) |
273 if record ~= nil and TotalRounds >= record then |
276 if record ~= nil and heroTurns >= record then |
274 SendStat(siCustomAchievement, string.format(loc("Your fastest victory so far: %d rounds"), record)) |
277 SendStat(siCustomAchievement, string.format(loc("Your fastest victory so far: %d rounds"), record)) |
275 end |
278 end |
276 if record == nil or TotalRounds < record then |
279 if record == nil or heroTurns < record then |
277 SaveCampaignVar("FastestPreciseShooting", tostring(TotalRounds)) |
280 SaveCampaignVar("FastestPreciseShooting", tostring(heroTurns)) |
278 if record ~= nil then |
281 if record ~= nil then |
279 SendStat(siCustomAchievement, loc("This is a new personal best, congratulations!")) |
282 SendStat(siCustomAchievement, loc("This is a new personal best, congratulations!")) |
280 end |
283 end |
281 end |
284 end |
282 SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission.")) |
285 SendStat(siCustomAchievement, loc("You will gain some extra ammo from the crates the next time you play the \"Getting to the device\" mission.")) |