371 RemoveEventFunc(heroOnLaunchPadWithEnemies) |
384 RemoveEventFunc(heroOnLaunchPadWithEnemies) |
372 -- add stats |
385 -- add stats |
373 saveVariables() |
386 saveVariables() |
374 SendStat(siGameResult, string.format(loc("%s escaped successfully!"), hero.name)) |
387 SendStat(siGameResult, string.format(loc("%s escaped successfully!"), hero.name)) |
375 SendStat(siCustomAchievement, loc("You have reached the take-off area successfully!")) |
388 SendStat(siCustomAchievement, loc("You have reached the take-off area successfully!")) |
|
389 sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name}) |
|
390 EndGame() |
|
391 end |
|
392 |
|
393 function escapeWinByKill(gear) |
|
394 RemoveEventFunc(heroOnLaunchPadWithEnemies) |
|
395 -- add stats |
|
396 saveVariables() |
|
397 SendStat(siGameResult, string.format(loc("%s won!"), teamB.name)) |
376 sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name}) |
398 sendSimpleTeamRankings({teamA.name, teamD.name, teamB.name, teamC.name}) |
377 EndGame() |
399 EndGame() |
378 end |
400 end |
379 |
401 |
380 function heroSelect() |
402 function heroSelect() |
389 else |
411 else |
390 ShowMission(unpack(goals["flee"])) |
412 ShowMission(unpack(goals["flee"])) |
391 AddAmmo(green1.gear, amSwitch, 100) |
413 AddAmmo(green1.gear, amSwitch, 100) |
392 AddEvent(onHeroOnLaunchPadWithEnemies, {hero.gear}, heroOnLaunchPadWithEnemies, {hero.gear}, 0) |
414 AddEvent(onHeroOnLaunchPadWithEnemies, {hero.gear}, heroOnLaunchPadWithEnemies, {hero.gear}, 0) |
393 AddEvent(onEscapeWin, {hero.gear}, escapeWin, {hero.gear}, 0) |
415 AddEvent(onEscapeWin, {hero.gear}, escapeWin, {hero.gear}, 0) |
|
416 -- Alternative victory in the "flee" mission: ALL yellow hedgehogs killed |
|
417 AddEvent(onEscapeWinByKill, {hero.gear}, escapeWinByKill, {hero.gear}, 0) |
394 local greenTeam = { green2, green3, green4, green5 } |
418 local greenTeam = { green2, green3, green4, green5 } |
395 for i=1,4 do |
419 for i=1,4 do |
396 SetHogLevel(greenTeam[i].gear, 1) |
420 SetHogLevel(greenTeam[i].gear, 1) |
397 end |
421 end |
398 AddAnim(dialog03) |
422 AddAnim(dialog03) |