share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
changeset 12510 cc146b018d14
parent 12509 6dbdb6fab2f9
child 12511 15e9ef8be44f
equal deleted inserted replaced
12509:6dbdb6fab2f9 12510:cc146b018d14
   170 freshDead = nil
   170 freshDead = nil
   171 crates = {}
   171 crates = {}
   172 cratesNum = 0
   172 cratesNum = 0
   173 jetCrate = nil
   173 jetCrate = nil
   174 
   174 
       
   175 firstTurn = true
   175 cyborgsKilledBeforeCrates = false
   176 cyborgsKilledBeforeCrates = false
   176 cratesTaken = false
   177 cratesTaken = false
   177 doneCyborgsDead = false
   178 doneCyborgsDead = false
   178 -----------------------------Animations--------------------------------
   179 -----------------------------Animations--------------------------------
   179 function EmitDenseClouds(dir)
   180 function EmitDenseClouds(dir)
   602   for i = 1, #map do
   603   for i = 1, #map do
   603      ParseCommand('draw ' .. map[i])
   604      ParseCommand('draw ' .. map[i])
   604   end
   605   end
   605 
   606 
   606   AddHogs()
   607   AddHogs()
   607   AnimInit()
   608   AnimInit(true)
   608 end
   609 end
   609 
   610 
   610 function onGameStart()
   611 function onGameStart()
   611   GetVariables()
   612   GetVariables()
   612   SetupAmmo()
   613   SetupAmmo()
   613   SetupPlace()
   614   SetupPlace()
   614   AnimationSetup()
   615   AnimationSetup()
   615   SetupEvents()
   616   SetupEvents()
   616   AddAnim(startAnim)
       
   617   AddFunction({func = AfterStartAnim, args = {}})
       
   618   ShowMission(loc("Dragon's Lair"), loc("Y Chwiliad"), loc("Find your tribe!|Cross the lake!"), 1, 0)
   617   ShowMission(loc("Dragon's Lair"), loc("Y Chwiliad"), loc("Find your tribe!|Cross the lake!"), 1, 0)
   619 end
   618 end
   620 
   619 
   621 function onGameTick()
   620 function onGameTick()
   622   AnimUnWait()
   621   AnimUnWait()
   644   SetAmmo(amLowGravity, 0, 0, 0, 1)
   643   SetAmmo(amLowGravity, 0, 0, 0, 1)
   645   SetAmmo(amSkip, 9, 0, 0, 0)
   644   SetAmmo(amSkip, 9, 0, 0, 0)
   646 end
   645 end
   647 
   646 
   648 function onNewTurn()
   647 function onNewTurn()
   649   if AnimInProgress() then
   648   if firstTurn then
   650     TurnTimeLeft = -1
   649     AddAnim(startAnim)
   651     return
   650     AddFunction({func = AfterStartAnim, args = {}})
       
   651     firstTurn = false
   652   end
   652   end
   653   if GetHogTeamName(CurrentHedgehog) == loc("011101000") then
   653   if GetHogTeamName(CurrentHedgehog) == loc("011101000") then
   654     SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
   654     SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
   655     for i = 1, 4 do
   655     for i = 1, 4 do
   656       if gearDead[CurrentHedgehog] ~= true and gearDead[native] ~= true then
   656       if gearDead[CurrentHedgehog] ~= true and gearDead[native] ~= true then