share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
changeset 15055 3e79818e21b1
parent 15054 c59bdec25012
child 15056 c88201afcc7c
equal deleted inserted replaced
15054:c59bdec25012 15055:3e79818e21b1
    30 - 7 turns till arrival of 3rd wave
    30 - 7 turns till arrival of 3rd wave
    31 - Arrival points are marked with circles
    31 - Arrival points are marked with circles
    32 - One hero is deployed near the circles
    32 - One hero is deployed near the circles
    33 - Player now only controls the hero, switch hog is removed
    33 - Player now only controls the hero, switch hog is removed
    34 - TBS
    34 - TBS
    35 - 3rd wave appears
    35 - 3rd wave appears at end of 7th turn
    36 - TBS
    36 - TBS
    37 - 3rd wave dead
    37 - 3rd wave dead
    38 - Final cut scene
    38 - Final cut scene
    39 > Victory
    39 > Victory
    40 
    40 
   647 
   647 
   648 function AfterWave2DeadAnim()
   648 function AfterWave2DeadAnim()
   649   stage = platformStage
   649   stage = platformStage
   650   SpawnPlatformCrates()
   650   SpawnPlatformCrates()
   651   SetGearMessage(CurrentHedgehog, 0)
   651   SetGearMessage(CurrentHedgehog, 0)
   652   AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
       
   653   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   652   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   654   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   653   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   655   HideCyborg()
   654   HideCyborg()
   656   EndTurn(true)
   655   EndTurn(true)
   657   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: You might want to use some mines ..."), 1, 12000)
   656   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: You might want to use some mines ..."), 1, 12000)
   693     loc("Kill him or skip your turn."),
   692     loc("Kill him or skip your turn."),
   694     1, 8000)
   693     1, 8000)
   695 end
   694 end
   696 
   695 
   697 -----------------------------Events------------------------------------
   696 -----------------------------Events------------------------------------
   698 function CheckTurnsOver()
       
   699   return wave3TurnsLeft == 0
       
   700 end
       
   701 
       
   702 function CheckDeployedDead()
   697 function CheckDeployedDead()
   703   return deployedDead
   698   return deployedDead
   704 end
   699 end
   705 
   700 
   706 function DoDeployedDead()
   701 function DoDeployedDead()
  1177   end
  1172   end
  1178 
  1173 
  1179   if stage == platformStage then
  1174   if stage == platformStage then
  1180     if wave3TurnsLeft == nil then
  1175     if wave3TurnsLeft == nil then
  1181       wave3TurnsLeft = 7
  1176       wave3TurnsLeft = 7
  1182     else
       
  1183       wave3TurnsLeft = wave3TurnsLeft - 1
       
  1184     end
  1177     end
  1185     if wave3TurnsLeft > 0 then
  1178     if wave3TurnsLeft > 0 then
  1186       AddCaption(string.format(loc("Turns until arrival: %d"), wave3TurnsLeft))
  1179       AddCaption(string.format(loc("Turns until arrival: %d"), wave3TurnsLeft))
  1187     end
  1180     end
  1188   end
  1181   end
  1228     end
  1221     end
  1229     needToAct = 0
  1222     needToAct = 0
  1230   end
  1223   end
  1231 end
  1224 end
  1232 
  1225 
       
  1226 function onEndTurn()
       
  1227   if stage == platformStage then
       
  1228     wave3TurnsLeft = wave3TurnsLeft - 1
       
  1229     if wave3TurnsLeft == 0 then
       
  1230       DoTurnsOver()
       
  1231     end
       
  1232   end
       
  1233 end
       
  1234 
  1233 function onPrecise()
  1235 function onPrecise()
  1234   if GameTime > 2500 and AnimInProgress() then
  1236   if GameTime > 2500 and AnimInProgress() then
  1235     SetAnimSkip(true)
  1237     SetAnimSkip(true)
  1236     return
  1238     return
  1237   end
  1239   end