share/hedgewars/Data/Maps/ClimbHome/map.lua
changeset 10592 2da35f88db23
parent 10589 98ea597e5cd9
child 10593 7d41b0446706
equal deleted inserted replaced
10591:9a9f0cbb10b2 10592:2da35f88db23
    30 local jokeAwardDamage = nil
    30 local jokeAwardDamage = nil
    31 local recordBroken = false
    31 local recordBroken = false
    32 local ready = false
    32 local ready = false
    33 local showWaterStats = false -- uses the AI team to draw water height.
    33 local showWaterStats = false -- uses the AI team to draw water height.
    34 local dummyHog = nil
    34 local dummyHog = nil
       
    35 local dummySkip = 0
    35 
    36 
    36 function onGameInit()
    37 function onGameInit()
    37     -- Ensure people get same map for same theme
    38     -- Ensure people get same map for same theme
    38     TurnTime = 999999999
    39     TurnTime = 999999999
    39     CaseFreq = 0
    40     CaseFreq = 0
   107     SetWaterLine(32768)
   108     SetWaterLine(32768)
   108     YouWon = false
   109     YouWon = false
   109     YouLost = false
   110     YouLost = false
   110     tauntNoo = false
   111     tauntNoo = false
   111     recordBroken = false
   112     recordBroken = false
   112     if CurrentHedgehog ~= nil and CurrentHedgehog ~= dummyHog then
   113     if CurrentHedgehog ~= nil then
   113         SetGearPosition(CurrentHedgehog, 1951,32640)
   114         if CurrentHedgehog ~= dummyHog then
   114         if not HogsAreInvulnerable then SetEffect(CurrentHedgehog,heInvulnerable,0) end
   115             SetGearPosition(CurrentHedgehog, 1951,32640)
   115         AddVisualGear(19531,32640,vgtExplosion,0,false)
   116             if not HogsAreInvulnerable then SetEffect(CurrentHedgehog,heInvulnerable,0) end
   116         SetState(CurrentHedgehog,band(GetState(CurrentHedgehog),bnot(gstInvisible)))
   117             AddVisualGear(19531,32640,vgtExplosion,0,false)
   117         SetWeapon(amRope)
   118             SetState(CurrentHedgehog,band(GetState(CurrentHedgehog),bnot(gstInvisible)))
   118         ready = true
   119             SetWeapon(amRope)
       
   120             ready = true
       
   121         else
       
   122             dummySkip = GameTime+1
       
   123         end
   119     end
   124     end
   120     for f,i in pairs(Fire) do
   125     for f,i in pairs(Fire) do
   121         DeleteGear(f)
   126         DeleteGear(f)
   122     end
   127     end
   123     for s,i in pairs(Stars) do
   128     for s,i in pairs(Stars) do
   169 
   174 
   170 
   175 
   171 function onGameTick20()
   176 function onGameTick20()
   172     local x,y;
   177     local x,y;
   173     if math.random(20) == 1 then AddVisualGear(2012,56,vgtSmoke,0,false) end
   178     if math.random(20) == 1 then AddVisualGear(2012,56,vgtSmoke,0,false) end
   174     if CurrentHedgehog == dummyHog then
   179     if CurrentHedgehog == dummyHog and dummySkip ~= 0 and dummySkip < GameTime then
   175         ParseCommand("/skip")
   180         ParseCommand("/skip")
       
   181         dummySkip = 0
   176     end
   182     end
   177 
   183 
   178     --if BoomFire ~= nil then
   184     --if BoomFire ~= nil then
   179     --    for f,i in pairs(BoomFire) do
   185     --    for f,i in pairs(BoomFire) do
   180     --        if band(GetState(f),gstCollision~=0) then DeleteGear(f) end
   186     --        if band(GetState(f),gstCollision~=0) then DeleteGear(f) end