share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/queen.lua
changeset 12555 d51ea6ac1ca1
parent 12398 5d805b345343
child 12570 0fb15ad40595
equal deleted inserted replaced
12554:194b00c4ba07 12555:d51ea6ac1ca1
   465 function SkipAnim(anim)
   465 function SkipAnim(anim)
   466   if anim == startAnim then
   466   if anim == startAnim then
   467     SetGearPosition(enemy, unpack(enemyPos))
   467     SetGearPosition(enemy, unpack(enemyPos))
   468   end
   468   end
   469   if GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
   469   if GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
   470     TurnTimeLeft = 0
   470     EndTurn(true)
   471   end
   471   end
   472   AnimWait(enemy, 1)
   472   AnimWait(enemy, 1)
   473 end
   473 end
   474 
   474 
   475 function AfterFleeAnim()
   475 function AfterFleeAnim()
   487   SetHealth(SpawnHealthCrate(130, 455), 25)
   487   SetHealth(SpawnHealthCrate(130, 455), 25)
   488   SetHealth(SpawnHealthCrate(2087, 50), 25)
   488   SetHealth(SpawnHealthCrate(2087, 50), 25)
   489   SetHealth(SpawnHealthCrate(2143, 54), 25)
   489   SetHealth(SpawnHealthCrate(2143, 54), 25)
   490   SetHealth(SpawnHealthCrate(70, 1308), 25)
   490   SetHealth(SpawnHealthCrate(70, 1308), 25)
   491   ShowMission(loc("Long Live The Queen"), loc("Bullseye"), loc("Good job! Defeat the rest of the aliens!"), 1, 0)
   491   ShowMission(loc("Long Live The Queen"), loc("Bullseye"), loc("Good job! Defeat the rest of the aliens!"), 1, 0)
   492   TurnTimeLeft = 0
   492   EndTurn(true)
   493 end
   493 end
   494 -----------------------------Events------------------------------------
   494 -----------------------------Events------------------------------------
   495 function CheckTurnsOver()
   495 function CheckTurnsOver()
   496   return TotalRounds > 6
   496   return TotalRounds > 6
   497 end
   497 end
   511 function DoNativesDead()
   511 function DoNativesDead()
   512   RemoveEventFunc(CheckTurnsOver)
   512   RemoveEventFunc(CheckTurnsOver)
   513   RemoveEventFunc(CheckGearDead)
   513   RemoveEventFunc(CheckGearDead)
   514   RemoveEventFunc(CheckCyborgsDead)
   514   RemoveEventFunc(CheckCyborgsDead)
   515   AddCaption(loc("And so the cyborgs took over the island."))
   515   AddCaption(loc("And so the cyborgs took over the island."))
   516   TurnTimeLeft = 0
   516   EndTurn(true)
   517 end
   517 end
   518 
   518 
   519 function CheckCyborgsDead()
   519 function CheckCyborgsDead()
   520   return (cyborgsLeft == 0 and (gearDead[enemy] == true or enemyFled == "1"))
   520   return (cyborgsLeft == 0 and (gearDead[enemy] == true or enemyFled == "1"))
   521 end
   521 end
   523 function KillEnemy()
   523 function KillEnemy()
   524   if enemyFled == "1" then
   524   if enemyFled == "1" then
   525     DismissTeam(loc("Leaderbot"))
   525     DismissTeam(loc("Leaderbot"))
   526   end
   526   end
   527   DismissTeam(loc("011101001"))
   527   DismissTeam(loc("011101001"))
   528   TurnTimeLeft = 0
   528   EndTurn(true)
   529 end
   529 end
   530 
   530 
   531 function DoCyborgsDead()
   531 function DoCyborgsDead()
   532   SaveCampaignVariables()
   532   SaveCampaignVariables()
   533   RestoreHedge(cyborg)
   533   RestoreHedge(cyborg)
   810   if AnimInProgress() then
   810   if AnimInProgress() then
   811     TurnTimeLeft = -1
   811     TurnTimeLeft = -1
   812     return
   812     return
   813   end
   813   end
   814   if GetHogTeamName(CurrentHedgehog) == loc("011101001") then
   814   if GetHogTeamName(CurrentHedgehog) == loc("011101001") then
   815     TurnTimeLeft = 0
   815     EndTurn(true)
   816   end
   816   end
   817 end
   817 end
   818 
   818 
   819 function onPrecise()
   819 function onPrecise()
   820   if GameTime > 2500 and AnimInProgress() then
   820   if GameTime > 2500 and AnimInProgress() then