share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
changeset 12548 933aee9786c3
parent 12511 15e9ef8be44f
child 12555 d51ea6ac1ca1
equal deleted inserted replaced
12547:9337c55f34ef 12548:933aee9786c3
   412   SetGearMessage(CurrentHedgehog, 0)
   412   SetGearMessage(CurrentHedgehog, 0)
   413   AddAnim(killAnim)
   413   AddAnim(killAnim)
   414   AddFunction({func = AfterKillAnim, args = {}})
   414   AddFunction({func = AfterKillAnim, args = {}})
   415 end
   415 end
   416 
   416 
       
   417 function CheckPutCrates(gear)
       
   418   if gear and GetHealth(gear) then
       
   419     return StoppedGear(gear)
       
   420   else
       
   421     return false
       
   422   end
       
   423 end
       
   424 
   417 function PutCrates(index)
   425 function PutCrates(index)
   418   if index <= 7 then
   426   if index <= 7 then
   419     cratesNum = cratesNum + 1
   427     cratesNum = cratesNum + 1
   420     SpawnCrateByID(cratesNum)
   428     SpawnCrateByID(cratesNum)
   421     AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0)
   429     AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0)
   422     FollowGear(native)
   430     FollowGear(native)
   423   else
   431   else
   424     AddEvent(StoppedGear, {native}, DoCratesTaken, {}, 0)
   432     AddEvent(CheckPutCrates, {native}, DoCratesTaken, {}, 0)
   425   end
   433   end
   426   if index == 4 then
   434   if index == 4 then
   427     AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0)
   435     AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0)
   428   end
   436   end
   429 end
   437 end