share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
changeset 12379 eb11e1bc7547
parent 12378 b752003f04b1
child 12380 1eaef4b1b3c1
equal deleted inserted replaced
12378:b752003f04b1 12379:eb11e1bc7547
    70 endAnimAD = {}
    70 endAnimAD = {}
    71 endAnimAL = {}
    71 endAnimAL = {}
    72 endAnimRL = {}
    72 endAnimRL = {}
    73 
    73 
    74 endFailAnim = {}
    74 endFailAnim = {}
    75 endFailAnimAD = {}
       
    76 
    75 
    77 winAnim = {}
    76 winAnim = {}
    78 winAnimAD = {}
    77 winAnimAD = {}
    79 
    78 
    80 --/////////////////////////Animation Functions///////////////////////
    79 --/////////////////////////Animation Functions///////////////////////
    81 function AfterMidFailAnim()
    80 function AfterMidFailAnim()
    82   DismissTeam(loc("Natives"))
    81   DismissTeam(loc("Natives"))
    83   EndTurn(0)
    82   EndTurn(true)
    84 end
    83 end
    85 
    84 
    86 function AfterMidAnimAlone()
    85 function AfterMidAnimAlone()
    87   SetupCourse()
    86   SetupCourse()
    88   for i = 5, 8 do
    87   for i = 5, 8 do
   435 
   434 
   436   startAnim = startAnimAD
   435   startAnim = startAnimAD
   437   midAnim = midAnimAD
   436   midAnim = midAnimAD
   438   failAnim = failAnimAD
   437   failAnim = failAnimAD
   439   endAnim = endAnimAD
   438   endAnim = endAnimAD
   440   endFailAnim = endFailAnimAD
       
   441   winAnim = winAnimAD
   439   winAnim = winAnimAD
   442 end
   440 end
   443 
   441 
   444 function SetupAnimAcceptedLived()
   442 function SetupAnimAcceptedLived()
   445   table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
   443   table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
   801 function CheckLeaksDead()
   799 function CheckLeaksDead()
   802   return leaksDead
   800   return leaksDead
   803 end
   801 end
   804 
   802 
   805 function DoLeaksDead()
   803 function DoLeaksDead()
   806   EndTurn(true)
   804   if not princessDead then
   807   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   805     EndTurn(true)
   808   DismissTeam(loc("Natives"))
   806     AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
       
   807     DismissTeam(loc("Natives"))
       
   808   end
   809 end
   809 end
   810 
   810 
   811 function CheckDenseDead()
   811 function CheckDenseDead()
   812   return denseDead
   812   return denseDead
   813 end
   813 end
   814 
   814 
   815 function DoDenseDead()
   815 function DoDenseDead()
   816   EndTurn(true)
   816   if not princessDead then
   817   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   817     EndTurn(true)
   818   DismissTeam(loc("Natives"))
   818     AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
       
   819     DismissTeam(loc("Natives"))
       
   820   end
   819 end
   821 end
   820 
   822 
   821 function CheckTookBlowTorch()
   823 function CheckTookBlowTorch()
   822   return blowTaken
   824   return blowTaken
   823 end
   825 end
   894 function CheckLost()
   896 function CheckLost()
   895   return princessDead
   897   return princessDead
   896 end
   898 end
   897 
   899 
   898 function DoLost()
   900 function DoLost()
       
   901   if not cyborgDead then
       
   902     SwitchHog(cyborg)
       
   903   end
   899   AddAnim(endFailAnim)
   904   AddAnim(endFailAnim)
   900   AddFunction({func = DismissTeam, args = {loc('Natives')}})
   905   AddFunction({func = DismissTeam, args = {loc("Natives")}})
       
   906   AddFunction({func = EndTurn, args = {true}})
   901 end
   907 end
   902 
   908 
   903 function CheckWon()
   909 function CheckWon()
   904   return cyborgDead and not princessDead
   910   return cyborgDead and not princessDead
   905 end
   911 end