19 -- So I have 2 hogs, one in bot level and one in hog level that I hide them |
19 -- So I have 2 hogs, one in bot level and one in hog level that I hide them |
20 -- or restore them regarding the case |
20 -- or restore them regarding the case |
21 |
21 |
22 HedgewarsScriptLoad("/Scripts/Locale.lua") |
22 HedgewarsScriptLoad("/Scripts/Locale.lua") |
23 HedgewarsScriptLoad("/Scripts/Animate.lua") |
23 HedgewarsScriptLoad("/Scripts/Animate.lua") |
|
24 HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua") |
24 |
25 |
25 ----------------- VARIABLES -------------------- |
26 ----------------- VARIABLES -------------------- |
26 -- globals |
27 -- globals |
27 local missionName = loc("Bad timing") |
28 local missionName = loc("Bad timing") |
28 local chooseToBattle = false |
29 local chooseToBattle = false |
324 gameLost() |
325 gameLost() |
325 end |
326 end |
326 |
327 |
327 function battleWin(gear) |
328 function battleWin(gear) |
328 -- add stats |
329 -- add stats |
|
330 saveVariables() |
329 SendStat('siGameResult', loc("Green Bananas won!")) --1 |
331 SendStat('siGameResult', loc("Green Bananas won!")) --1 |
330 SendStat('siCustomAchievement', loc("You have eliminated all the visible enemy hogs!")) --11 |
332 SendStat('siCustomAchievement', loc("You have eliminated all the visible enemy hogs!")) --11 |
331 SendStat('siPlayerKills','1',teamA.name) |
333 SendStat('siPlayerKills','1',teamA.name) |
332 SendStat('siPlayerKills','1',teamB.name) |
334 SendStat('siPlayerKills','1',teamB.name) |
333 SendStat('siPlayerKills','0',teamC.name) |
335 SendStat('siPlayerKills','0',teamC.name) |
334 EndGame() |
336 EndGame() |
335 end |
337 end |
336 |
338 |
337 function escapeWin(gear) |
339 function escapeWin(gear) |
338 -- add stats |
340 -- add stats |
|
341 saveVariables() |
339 SendStat('siGameResult', loc("Hog Solo escaped successfully!")) --1 |
342 SendStat('siGameResult', loc("Hog Solo escaped successfully!")) --1 |
340 SendStat('siCustomAchievement', loc("You have reached the flying area successfully!")) --11 |
343 SendStat('siCustomAchievement', loc("You have reached the flying area successfully!")) --11 |
341 SendStat('siPlayerKills','1',teamA.name) |
344 SendStat('siPlayerKills','1',teamA.name) |
342 SendStat('siPlayerKills','0',teamB.name) |
345 SendStat('siPlayerKills','0',teamB.name) |
343 SendStat('siPlayerKills','0',teamC.name) |
346 SendStat('siPlayerKills','0',teamC.name) |
470 and not GetHealth(yellowArmy[4].gear) then |
473 and not GetHealth(yellowArmy[4].gear) then |
471 SetGearPosition(yellowArmy[6].gear, yellow1.x, yellow1.y) |
474 SetGearPosition(yellowArmy[6].gear, yellow1.x, yellow1.y) |
472 end |
475 end |
473 end |
476 end |
474 end |
477 end |
|
478 |
|
479 function saveVariables() |
|
480 saveCompletedStatus(2) |
|
481 SaveCampaignVar("UnlockedMissions", "3") |
|
482 SaveCampaignVar("Mission1", "3") |
|
483 SaveCampaignVar("Mission2", "8") |
|
484 SaveCampaignVar("Mission3", "1") |
|
485 end |