share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
changeset 14465 d084fc76c566
parent 14422 6c21bd8547dd
child 14506 f37910a73c19
equal deleted inserted replaced
14464:6b1fe6d0a26b 14465:d084fc76c566
   133 m2SpikyDead = 0
   133 m2SpikyDead = 0
   134 
   134 
   135 TurnsLeft = 0
   135 TurnsLeft = 0
   136 stage = 0
   136 stage = 0
   137 
   137 
       
   138 startAnimStarted = false
   138 blowTaken = false
   139 blowTaken = false
   139 fireTaken = false
   140 fireTaken = false
   140 gravityTaken = false
   141 gravityTaken = false
   141 sniperTaken = false
   142 sniperTaken = false
   142 leaksDead = false
   143 leaksDead = false
   780     else
   781     else
   781       SetupAnimAttacked()
   782       SetupAnimAttacked()
   782     end
   783     end
   783     SetupPlaceAlone()
   784     SetupPlaceAlone()
   784     SetupEventsAlone()
   785     SetupEventsAlone()
   785     AddAnim(startAnim)
       
   786     AddFunction({func = AfterStartAnim, args = {}})
       
   787   else
   786   else
   788     if m2Choice == choiceAccepted then
   787     if m2Choice == choiceAccepted then
   789       SetupAnimAcceptedLived()
   788       SetupAnimAcceptedLived()
   790     else
   789     else
   791       SetupAnimRefusedLived()
   790       SetupAnimRefusedLived()
   792     end
   791     end
   793     SetupPlaceDuo()
   792     SetupPlaceDuo()
   794     SetupEventsDuo()
   793     SetupEventsDuo()
   795     AddAnim(startAnim)
       
   796     AddFunction({func = AfterStartAnim, args = {}})
       
   797   end
   794   end
   798   HideHedge(cyborg)
   795   HideHedge(cyborg)
   799   HideHedge(princess)
   796   HideHedge(princess)
   800   for i = 5, 8 do
   797   for i = 5, 8 do
   801     HideHedge(cannibals[i])
   798     HideHedge(cannibals[i])
  1085 
  1082 
  1086     -- Disable Sudden Death
  1083     -- Disable Sudden Death
  1087     HealthDecrease = 0
  1084     HealthDecrease = 0
  1088     WaterRise = 0
  1085     WaterRise = 0
  1089 
  1086 
       
  1087   AnimInit(true)
       
  1088 
  1090   AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
  1089   AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
  1091   leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
  1090   leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
  1092   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
  1091   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
  1093 
  1092 
  1094   AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
  1093   AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
  1113 
  1112 
  1114   AnimSetGearPosition(dense, 0, 0)
  1113   AnimSetGearPosition(dense, 0, 0)
  1115   AnimSetGearPosition(leaks, 0, 0)
  1114   AnimSetGearPosition(leaks, 0, 0)
  1116   AnimSetGearPosition(cyborg, 0, 0)
  1115   AnimSetGearPosition(cyborg, 0, 0)
  1117   AnimSetGearPosition(princess, 0, 0)
  1116   AnimSetGearPosition(princess, 0, 0)
  1118   
       
  1119   AnimInit()
       
  1120 end
  1117 end
  1121 
  1118 
  1122 function onGameStart()
  1119 function onGameStart()
  1123   StartMission()
  1120   StartMission()
  1124 end
  1121 end
  1184   SetAmmo(amDynamite, 0, 0, 0, 1)
  1181   SetAmmo(amDynamite, 0, 0, 0, 1)
  1185   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1182   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1186 end
  1183 end
  1187 
  1184 
  1188 function onNewTurn()
  1185 function onNewTurn()
       
  1186   if not startAnimStarted then
       
  1187       AddAnim(startAnim)
       
  1188       AddFunction({func = AfterStartAnim, args = {}})
       
  1189       startAnimStarted = true
       
  1190   end
  1189   if AnimInProgress() then
  1191   if AnimInProgress() then
  1190     SetTurnTimeLeft(MAX_TURN_TIME)
  1192     SetTurnTimeLeft(MAX_TURN_TIME)
  1191   elseif victory then
  1193   elseif victory then
  1192     EndTurn(true)
  1194     EndTurn(true)
  1193   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1195   elseif stage == endStage and CurrentHedgehog ~= leaks then