share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
changeset 10290 42efccba0711
parent 10289 c3a77ff02a23
child 12049 030464f34d47
equal deleted inserted replaced
10289:c3a77ff02a23 10290:42efccba0711
    78 winAnim = {}
    78 winAnim = {}
    79 winAnimAD = {}
    79 winAnimAD = {}
    80 
    80 
    81 --/////////////////////////Animation Functions///////////////////////
    81 --/////////////////////////Animation Functions///////////////////////
    82 function AfterMidFailAnim()
    82 function AfterMidFailAnim()
    83   ParseCommand("teamgone " .. loc("Natives"))
    83   DismissTeam(loc("Natives"))
    84   TurnTimeLeft = 0
    84   TurnTimeLeft = 0
    85 end
    85 end
    86 
    86 
    87 function AfterMidAnimAlone()
    87 function AfterMidAnimAlone()
    88   SetupCourse()
    88   SetupCourse()
   566   pastFlowerAnim = pastFlowerAnimRL
   566   pastFlowerAnim = pastFlowerAnimRL
   567   outPitAnim = outPitAnimRL
   567   outPitAnim = outPitAnimRL
   568 end
   568 end
   569 
   569 
   570 function KillPrincess()
   570 function KillPrincess()
   571   ParseCommand("teamgone " .. loc("Cannibal Sentry"))
   571   DismissTeam(loc("Cannibal Sentry"))
   572   TurnTimeLeft = 0
   572   TurnTimeLeft = 0
   573 end
   573 end
   574 --/////////////////////////////Misc Functions////////////////////////
   574 --/////////////////////////////Misc Functions////////////////////////
   575 
   575 
   576 function HideHedge(hedge)
   576 function HideHedge(hedge)
   802   return leaksDead
   802   return leaksDead
   803 end
   803 end
   804 
   804 
   805 function DoLeaksDead()
   805 function DoLeaksDead()
   806   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   806   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   807   ParseCommand("teamgone " .. loc("Natives"))
   807   DismissTeam(loc("Natives"))
   808 end
   808 end
   809 
   809 
   810 function CheckDenseDead()
   810 function CheckDenseDead()
   811   return denseDead
   811   return denseDead
   812 end
   812 end
   813 
   813 
   814 function DoDenseDead()
   814 function DoDenseDead()
   815   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   815   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   816   ParseCommand("teamgone " .. loc("Natives"))
   816   DismissTeam(loc("Natives"))
   817 end
   817 end
   818 
   818 
   819 function CheckTookBlowTorch()
   819 function CheckTookBlowTorch()
   820   return blowTaken
   820   return blowTaken
   821 end
   821 end
   893   return princessDead
   893   return princessDead
   894 end
   894 end
   895 
   895 
   896 function DoLost()
   896 function DoLost()
   897   AddAnim(endFailAnim)
   897   AddAnim(endFailAnim)
   898   AddFunction({func = ParseCommand, args = {'teamgone ' .. loc('Natives')}})
   898   AddFunction({func = DismissTeam, args = {loc('Natives')}})
   899 end
   899 end
   900 
   900 
   901 function CheckWon()
   901 function CheckWon()
   902   return cyborgDead and not princessDead
   902   return cyborgDead and not princessDead
   903 end
   903 end
   910   AddFunction({func = FinishWon, args = {}})
   910   AddFunction({func = FinishWon, args = {}})
   911 end
   911 end
   912 
   912 
   913 function FinishWon()
   913 function FinishWon()
   914   SwitchHog(leaks)
   914   SwitchHog(leaks)
   915   ParseCommand("teamgone " .. loc("Cannibal Sentry"))
   915   DismissTeam(loc("Cannibal Sentry"))
   916   ParseCommand("teamgone " .. loc("011101001"))
   916   DismissTeam(loc("011101001"))
   917   TurnTimeLeft = 0
   917   TurnTimeLeft = 0
   918 end
   918 end
   919 
   919 
   920 function CheckFailedCourse()
   920 function CheckFailedCourse()
   921   return TurnsLeft == 0
   921   return TurnsLeft == 0