share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua
branchspacecampaign
changeset 9263 5069877daa09
parent 9258 5c760ed50b3d
equal deleted inserted replaced
9258:5c760ed50b3d 9263:5069877daa09
  1039   SetAmmo(amDynamite, 0, 0, 0, 1)
  1039   SetAmmo(amDynamite, 0, 0, 0, 1)
  1040   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1040   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1041 end
  1041 end
  1042 
  1042 
  1043 function onNewTurn()
  1043 function onNewTurn()
  1044 WriteLnToConsole("ON NEW TURN")
       
  1045   if AnimInProgress() then
  1044   if AnimInProgress() then
  1046 WriteLnToConsole("ON NEW TURN 1")
       
  1047     TurnTimeLeft = -1
  1045     TurnTimeLeft = -1
  1048   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1046   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1049 WriteLnToConsole("ON NEW TURN 2")
       
  1050     AnimSwitchHog(leaks)
  1047     AnimSwitchHog(leaks)
  1051     SetGearMessage(leaks, 0)
  1048     SetGearMessage(leaks, 0)
  1052     TurnTimeLeft = -1
  1049     TurnTimeLeft = -1
  1053   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1050   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1054 WriteLnToConsole("ON NEW TURN 3")
       
  1055     for i = 1, 4 do
  1051     for i = 1, 4 do
  1056       if cannibalDead[i] ~= true then
  1052       if cannibalDead[i] ~= true then
  1057         if GetX(cannibals[i]) < GetX(leaks) then
  1053         if GetX(cannibals[i]) < GetX(leaks) then
  1058           HogTurnLeft(cannibals[i], false)
  1054           HogTurnLeft(cannibals[i], false)
  1059         else
  1055         else
  1062       end
  1058       end
  1063     end
  1059     end
  1064     SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
  1060     SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
  1065     TurnTimeLeft = 20000
  1061     TurnTimeLeft = 20000
  1066   else
  1062   else
  1067 WriteLnToConsole("ON NEW TURN 4")
       
  1068     SetInputMask(0xFFFFFFFF)
  1063     SetInputMask(0xFFFFFFFF)
  1069     TurnsLeft = TurnsLeft - 1
  1064     TurnsLeft = TurnsLeft - 1
  1070   end
  1065   end
  1071 end
  1066 end
  1072 
  1067