share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 14660 aa4f99b96c6d
parent 14500 dbf704b00762
child 14877 421eed52a8e1
equal deleted inserted replaced
14659:46ac6fbde6f6 14660:aa4f99b96c6d
    78 acceptedReturnStage = 10
    78 acceptedReturnStage = 10
    79 refusedReturnStage = 11
    79 refusedReturnStage = 11
    80 attackedReturnStage = 12
    80 attackedReturnStage = 12
    81 loseStage = 13
    81 loseStage = 13
    82 
    82 
       
    83 wave1EnemyTurn = false
       
    84 
    83 ourTeam = 0
    85 ourTeam = 0
    84 weakTeam = 1
    86 weakTeam = 1
    85 strongTeam = 2
    87 strongTeam = 2
    86 cyborgTeam = 3
    88 cyborgTeam = 3
    87 
    89 
   220   AddAmmo(dense, amSkip, 100)
   222   AddAmmo(dense, amSkip, 100)
   221   AddEvent(CheckWeaklingsKilled, {}, DoWeaklingsKilled, {}, 0)
   223   AddEvent(CheckWeaklingsKilled, {}, DoWeaklingsKilled, {}, 0)
   222   SetHealth(SpawnHealthCrate(2757, 1030), 50)
   224   SetHealth(SpawnHealthCrate(2757, 1030), 50)
   223   SetHealth(SpawnHealthCrate(2899, 1009), 50)
   225   SetHealth(SpawnHealthCrate(2899, 1009), 50)
   224   stage = wave1Stage
   226   stage = wave1Stage
   225   SwitchHog(dense)
       
   226   SetGearMessage(dense, 0)
   227   SetGearMessage(dense, 0)
   227   SetGearMessage(leaks, 0)
   228   SetGearMessage(leaks, 0)
   228   SetTurnTimeLeft(TurnTime)
   229   EndTurn(true)
   229   ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover...").."|"..loc("Both your hedgehogs must survive."), 1, 6000)
   230   ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover...").."|"..loc("Both your hedgehogs must survive."), 1, 6000)
   230 end
   231 end
   231 
   232 
   232 function SkipWeaklingsAnim()
   233 function SkipWeaklingsAnim()
   233   if stage == loseStage then
   234   if stage == loseStage then
   350   SpawnSupplyCrate(3551, 994, amGrenade)
   351   SpawnSupplyCrate(3551, 994, amGrenade)
   351   SpawnSupplyCrate(3392, 1101, amShotgun)
   352   SpawnSupplyCrate(3392, 1101, amShotgun)
   352   SpawnSupplyCrate(3192, 1101, amShotgun)
   353   SpawnSupplyCrate(3192, 1101, amShotgun)
   353   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   354   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   354   SetState(cyborg, gstInvisible)
   355   SetState(cyborg, gstInvisible)
   355   AnimSwitchHog(leaks)
       
   356 end
   356 end
   357 
   357 
   358   
   358   
   359 -----------------------------Animations--------------------------------
   359 -----------------------------Animations--------------------------------
   360 
   360 
  1105 end
  1105 end
  1106 
  1106 
  1107 function onNewTurn()
  1107 function onNewTurn()
  1108   if AnimInProgress() then
  1108   if AnimInProgress() then
  1109     SetTurnTimeLeft(MAX_TURN_TIME)
  1109     SetTurnTimeLeft(MAX_TURN_TIME)
       
  1110   elseif stage == wave1Stage then
       
  1111     if GetHogClan(CurrentHedgehog) == GetTeamClan(weaklingsTeamName) and (not wave1EnemyTurn) then
       
  1112       EndTurn(true)
       
  1113       wave1EnemyTurn = true
       
  1114     end
  1110   elseif stage == cyborgStage then
  1115   elseif stage == cyborgStage then
  1111     if CurrentHedgehog ~= dense then
  1116     if CurrentHedgehog ~= dense then
  1112       EndTurn(true)
  1117       EndTurn(true)
  1113     else
  1118     else
  1114       SetTurnTimeLeft(MAX_TURN_TIME)
  1119       SetTurnTimeLeft(MAX_TURN_TIME)