17 local missionName = loc("The first stop") |
17 local missionName = loc("The first stop") |
18 local weaponsAcquired = false |
18 local weaponsAcquired = false |
19 local battleZoneReached = false |
19 local battleZoneReached = false |
20 local checkPointReached = 1 -- 1 is start of the game |
20 local checkPointReached = 1 -- 1 is start of the game |
21 local afterDialog02 = false |
21 local afterDialog02 = false |
|
22 local gameOver = false |
22 -- dialogs |
23 -- dialogs |
23 local dialog01 = {} |
24 local dialog01 = {} |
24 local dialog02 = {} |
25 local dialog02 = {} |
25 local dialog03 = {} |
26 local dialog03 = {} |
26 local dialog04 = {} |
27 local dialog04 = {} |
351 AnimSay(professor.gear,loc("Don't hit me, you fools!"), SAY_SHOUT, 2000) |
352 AnimSay(professor.gear,loc("Don't hit me, you fools!"), SAY_SHOUT, 2000) |
352 end |
353 end |
353 end |
354 end |
354 |
355 |
355 function professorDeath(gear) |
356 function professorDeath(gear) |
|
357 if gameOver then return end |
356 if GetHealth(minion1.gear) then |
358 if GetHealth(minion1.gear) then |
357 AnimSay(minion1.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000) |
359 AnimSay(minion1.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000) |
358 elseif GetHealth(minion2.gear) then |
360 elseif GetHealth(minion2.gear) then |
359 AnimSay(minion2.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000) |
361 AnimSay(minion2.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000) |
360 elseif GetHealth(minion3.gear) then |
362 elseif GetHealth(minion3.gear) then |
369 SendStat(siCustomAchievement, loc("You have eliminated Professor Hogevil.")) |
371 SendStat(siCustomAchievement, loc("You have eliminated Professor Hogevil.")) |
370 SendStat(siCustomAchievement, loc("You drove the minions away.")) |
372 SendStat(siCustomAchievement, loc("You drove the minions away.")) |
371 SendStat(siPlayerKills,'1',teamD.name) |
373 SendStat(siPlayerKills,'1',teamD.name) |
372 SendStat(siPlayerKills,'0',teamC.name) |
374 SendStat(siPlayerKills,'0',teamC.name) |
373 SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels |
375 SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels |
|
376 gameOver = true |
374 EndGame() |
377 EndGame() |
375 end |
378 end |
376 |
379 |
377 function minionsDeath(gear) |
380 function minionsDeath(gear) |
|
381 if gameOver then return end |
378 -- do staffs here |
382 -- do staffs here |
379 AnimSay(professor.gear, loc("I may lost this battle, but I haven't lost the war yet!"), SAY_SHOUT, 6000) |
383 AnimSay(professor.gear, loc("I may lost this battle, but I haven't lost the war yet!"), SAY_SHOUT, 6000) |
380 DismissTeam(teamC.name) |
384 DismissTeam(teamC.name) |
381 AnimCaption(hero.gear, loc("Congrats! You won!"), 6000) |
385 AnimCaption(hero.gear, loc("Congrats! You won!"), 6000) |
382 AnimWait(hero.gear,5000) |
386 AnimWait(hero.gear,5000) |
386 SendStat(siCustomAchievement, loc("You have eliminated the evil minions.")) |
390 SendStat(siCustomAchievement, loc("You have eliminated the evil minions.")) |
387 SendStat(siCustomAchievement, loc("You drove Professor Hogevil away.")) |
391 SendStat(siCustomAchievement, loc("You drove Professor Hogevil away.")) |
388 SendStat(siPlayerKills,'1',teamD.name) |
392 SendStat(siPlayerKills,'1',teamD.name) |
389 SendStat(siPlayerKills,'0',teamC.name) |
393 SendStat(siPlayerKills,'0',teamC.name) |
390 SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels |
394 SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels |
|
395 gameOver = true |
391 EndGame() |
396 EndGame() |
392 end |
397 end |
393 |
398 |
394 -------------- ANIMATIONS ------------------ |
399 -------------- ANIMATIONS ------------------ |
395 |
400 |