share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua
changeset 7502 16c36f62247b
parent 7448 d0521a3a4358
child 7512 cc3f036121fe
equal deleted inserted replaced
7499:1d1d1874f67e 7502:16c36f62247b
    96   stage = ramonStage
    96   stage = ramonStage
    97   SwitchHog(cannibals[9])
    97   SwitchHog(cannibals[9])
    98   FollowGear(ramon)
    98   FollowGear(ramon)
    99   TurnTimeLeft = 0
    99   TurnTimeLeft = 0
   100   SetGearMessage(ramon, 0)
   100   SetGearMessage(ramon, 0)
   101   HideHog(cyborg)
       
   102   cyborgHidden = true
       
   103   SetGearMessage(leaks, 0)
   101   SetGearMessage(leaks, 0)
       
   102   AnimWait(ramon, 1)
       
   103   AddFunction({func = HideHog, args = {cyborg}})
   104 end
   104 end
   105 
   105 
   106 function SkipRefusedAnim()
   106 function SkipRefusedAnim()
   107   RefusedStart()
   107   RefusedStart()
   108   AnimSetGearPosition(dense, 2645, 1146)
   108   AnimSetGearPosition(dense, 2645, 1146)
   204 function AfterAcceptedAnim()
   204 function AfterAcceptedAnim()
   205   stage = acceptedReturnStage
   205   stage = acceptedReturnStage
   206   SpawnAmmoCrate(1370, 810, amGirder)
   206   SpawnAmmoCrate(1370, 810, amGirder)
   207   SpawnAmmoCrate(1300, 810, amParachute)
   207   SpawnAmmoCrate(1300, 810, amParachute)
   208   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
   208   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
   209   HideHog(cyborg)
       
   210   AddEvent(CheckTookWeapons, {}, DoTookWeapons, {}, 0)
   209   AddEvent(CheckTookWeapons, {}, DoTookWeapons, {}, 0)
   211   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   210   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   212   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   211   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   213   AddEvent(CheckRestartReturnAccepted, {}, RestartReturnAccepted, {}, 1)
   212   AddEvent(CheckRestartReturnAccepted, {}, RestartReturnAccepted, {}, 1)
   214   RemoveEventFunc(CheckDenseDead)
   213   RemoveEventFunc(CheckDenseDead)
       
   214   SwitchHog(dense)
       
   215   AnimWait(dense, 1)
       
   216   AddFunction({func = HideHog, args = {cyborg}})
   215 end
   217 end
   216 
   218 
   217 function SkipAcceptedAnim()
   219 function SkipAcceptedAnim()
   218   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   220   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   219   SetState(cyborg, gstInvisible)
   221   SetState(cyborg, gstInvisible)
   221   SetInputMask(0xFFFFFFFF)
   223   SetInputMask(0xFFFFFFFF)
   222 end
   224 end
   223 
   225 
   224 function AfterAttackedAnim()
   226 function AfterAttackedAnim()
   225   stage = aloneStage
   227   stage = aloneStage
   226   HideHog(cyborg)
       
   227   ShowMission(loc("The Shadow Falls"), loc("The Individualist"), loc("Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
   228   ShowMission(loc("The Shadow Falls"), loc("The Individualist"), loc("Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
   228   AddAmmo(cannibals[6], amGrenade, 5)
   229   AddAmmo(cannibals[6], amGrenade, 5)
   229   AddAmmo(cannibals[6], amFirePunch, 0)
   230   AddAmmo(cannibals[6], amFirePunch, 0)
   230   AddAmmo(cannibals[6], amBaseballBat, 0)
   231   AddAmmo(cannibals[6], amBaseballBat, 0)
   231   SetGearMessage(leaks, 0)
   232   SetGearMessage(leaks, 0)
   232   TurnTimeLeft = TurnTime
   233   TurnTimeLeft = TurnTime
   233   AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadAttacked, {}, 0)
   234   AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadAttacked, {}, 0)
       
   235   SwitchHog(leaks)
       
   236   AnimWait(dense, 1)
       
   237   AddFunction({func = HideHog, args = {cyborg}})
   234 end
   238 end
   235 
   239 
   236 function SkipAttackedAnim()
   240 function SkipAttackedAnim()
   237   if denseDead == false then
   241   if denseDead == false then
   238     DeleteGear(dense)
   242     DeleteGear(dense)
   912     cyborgAttacked = true
   916     cyborgAttacked = true
   913   end
   917   end
   914 end
   918 end
   915 
   919 
   916 function onPrecise()
   920 function onPrecise()
   917   if GameTime > 2500 then
   921   if GameTime > 2500 and AnimInProgress() then
   918     SetAnimSkip(true)
   922     SetAnimSkip(true)
       
   923     return
   919   end
   924   end
   920   if stage == acceptedReturnStage then
   925   if stage == acceptedReturnStage then
   921     retryReturn = true
   926     retryReturn = true
   922   end
   927 --  else
   923 end
   928 --    for i = 1, 9 do
   924 
   929 --      DeleteGear(cannibals[i])
       
   930 --    end
       
   931   end
       
   932 end
       
   933