share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua
changeset 12933 e65aa3c3d4e6
parent 12794 bca911f8e804
child 13141 8f2260eeb726
equal deleted inserted replaced
12932:e0da398805b6 12933:e65aa3c3d4e6
   416 function CheckOnShroom()
   416 function CheckOnShroom()
   417   return GetX(youngh) >= 2461 and StoppedGear(youngh)
   417   return GetX(youngh) >= 2461 and StoppedGear(youngh)
   418 end
   418 end
   419 
   419 
   420 function DoOnShroom()
   420 function DoOnShroom()
   421   ropeCrate1 = SpawnUtilityCrate(2751, 1194, amRope, 100)
   421   ropeCrate1 = SpawnSupplyCrate(2751, 1194, amRope, 100)
   422   SetGearMessage(CurrentHedgehog, 0)
   422   SetGearMessage(CurrentHedgehog, 0)
   423   AddAnim(onShroomAnim)
   423   AddAnim(onShroomAnim)
   424   AddEvent(CheckOnFlower, {}, DoOnFlower, {}, 0)
   424   AddEvent(CheckOnFlower, {}, DoOnFlower, {}, 0)
   425 end
   425 end
   426 
   426 
   428   return rope1Taken and StoppedGear(youngh)
   428   return rope1Taken and StoppedGear(youngh)
   429 end
   429 end
   430 
   430 
   431 function DoOnFlower()
   431 function DoOnFlower()
   432   AddAmmo(youngh, amRope, 100)
   432   AddAmmo(youngh, amRope, 100)
   433   paraCrate = SpawnUtilityCrate(3245, 1758, amParachute, 100)
   433   paraCrate = SpawnSupplyCrate(3245, 1758, amParachute, 100)
   434   SetGearMessage(CurrentHedgehog, 0)
   434   SetGearMessage(CurrentHedgehog, 0)
   435   AddAnim(onFlowerAnim)
   435   AddAnim(onFlowerAnim)
   436   AddEvent(CheckTookParaCrate, {}, DoTookParaCrate, {}, 0)
   436   AddEvent(CheckTookParaCrate, {}, DoTookParaCrate, {}, 0)
   437 end
   437 end
   438 
   438 
   460 end
   460 end
   461 
   461 
   462 function DoPastMoleHead()
   462 function DoPastMoleHead()
   463   -- Initiate parachute challenge
   463   -- Initiate parachute challenge
   464   RemoveEventFunc(CheckOnMoleHead)
   464   RemoveEventFunc(CheckOnMoleHead)
   465   ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope, 100)
   465   ropeCrate2 = SpawnSupplyCrate(2782, 1720, amRope, 100)
   466   rope2InProgress = true
   466   rope2InProgress = true
   467   AddAmmo(youngh, amRope, 0)
   467   AddAmmo(youngh, amRope, 0)
   468   SetGearMessage(CurrentHedgehog, 0)
   468   SetGearMessage(CurrentHedgehog, 0)
   469   -- Block the way to the hole to the right, since the player loses the rope for this section
   469   -- Block the way to the hole to the right, since the player loses the rope for this section
   470   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   470   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   473 end
   473 end
   474 
   474 
   475 function DoOnMoleHead()
   475 function DoOnMoleHead()
   476   -- Initiate parachute challenge
   476   -- Initiate parachute challenge
   477   RemoveEventFunc(CheckPastMoleHead)
   477   RemoveEventFunc(CheckPastMoleHead)
   478   ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope, 100)
   478   ropeCrate2 = SpawnSupplyCrate(2782, 1720, amRope, 100)
   479   rope2InProgress = true
   479   rope2InProgress = true
   480   AddAmmo(youngh, amRope, 0)
   480   AddAmmo(youngh, amRope, 0)
   481   SetGearMessage(CurrentHedgehog, 0)
   481   SetGearMessage(CurrentHedgehog, 0)
   482   -- Block the way to the hole to the right, since the player loses the rope for this section
   482   -- Block the way to the hole to the right, since the player loses the rope for this section
   483   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   483   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   491 
   491 
   492 function DoTookRope2()
   492 function DoTookRope2()
   493   AddAmmo(youngh, amRope, 100)
   493   AddAmmo(youngh, amRope, 100)
   494   SetGearMessage(CurrentHedgehog, 0)
   494   SetGearMessage(CurrentHedgehog, 0)
   495   AddAnim(tookRope2Anim)
   495   AddAnim(tookRope2Anim)
   496   punchCrate = SpawnAmmoCrate(2460, 1321, amFirePunch, 100)
   496   punchCrate = SpawnSupplyCrate(2460, 1321, amFirePunch, 100)
   497   AddEvent(CheckTookPunch, {}, DoTookPunch, {})
   497   AddEvent(CheckTookPunch, {}, DoTookPunch, {})
   498 end
   498 end
   499 
   499 
   500 function CheckTookPunch()
   500 function CheckTookPunch()
   501   return punchTaken and StoppedGear(youngh)
   501   return punchTaken and StoppedGear(youngh)
   522   AddAmmo(youngh, amFirePunch, 0)
   522   AddAmmo(youngh, amFirePunch, 0)
   523   SetGearMessage(CurrentHedgehog, 0)
   523   SetGearMessage(CurrentHedgehog, 0)
   524   AddAnim(challengeAnim)
   524   AddAnim(challengeAnim)
   525   targetsDestroyed = 0
   525   targetsDestroyed = 0
   526   AddFunction({func = SetChoice, args = {}})
   526   AddFunction({func = SetChoice, args = {}})
   527   ropeCrate3 = SpawnUtilityCrate(2000, 1200, amRope, 100)
   527   ropeCrate3 = SpawnSupplyCrate(2000, 1200, amRope, 100)
   528   AddEvent(CheckTookRope3, {}, AddAmmo, {youngh, amRope, 100}, 0)
   528   AddEvent(CheckTookRope3, {}, AddAmmo, {youngh, amRope, 100}, 0)
   529   AddEvent(CheckCratesColled, {}, DoCratesColled, {}, 0)
   529   AddEvent(CheckCratesColled, {}, DoCratesColled, {}, 0)
   530   AddEvent(CheckChallengeWon, {}, DoChallengeWon, {}, 0)
   530   AddEvent(CheckChallengeWon, {}, DoChallengeWon, {}, 0)
   531   AddEvent(CheckTimesUp, {}, DoTimesUp, {}, 1)
   531   AddEvent(CheckTimesUp, {}, DoTimesUp, {}, 1)
   532   -- Remove up the old mole blockade from the parachute challenge
   532   -- Remove up the old mole blockade from the parachute challenge
   553 function CheckChallengeWon()
   553 function CheckChallengeWon()
   554   return cratesCollected == crateNum[difficulty] and StoppedGear(youngh)
   554   return cratesCollected == crateNum[difficulty] and StoppedGear(youngh)
   555 end
   555 end
   556 
   556 
   557 function DoChallengeWon()
   557 function DoChallengeWon()
   558   desertCrate = SpawnAmmoCrate(1240, 1212, amDEagle, 100)
   558   desertCrate = SpawnSupplyCrate(1240, 1212, amDEagle, 100)
   559   SetGearMessage(CurrentHedgehog, 0)
   559   SetGearMessage(CurrentHedgehog, 0)
   560   AddAnim(challengeCompletedAnim)
   560   AddAnim(challengeCompletedAnim)
   561   AddEvent(CheckDesertColled, {}, DoDesertColled, {}, 0)
   561   AddEvent(CheckDesertColled, {}, DoDesertColled, {}, 0)
   562 end
   562 end
   563 
   563 
   631 end
   631 end
   632 
   632 
   633 function DoCloseToCannibal()
   633 function DoCloseToCannibal()
   634   SetGearMessage(CurrentHedgehog, 0)
   634   SetGearMessage(CurrentHedgehog, 0)
   635   AddAnim(closeCannim)
   635   AddAnim(closeCannim)
   636   AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][1], targetPosY[1][1], amWhip}})
   636   AddFunction({func = SpawnSupplyCrate, args = {targetPosX[1][1], targetPosY[1][1], amWhip}})
   637   AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][2], targetPosY[1][2], amBaseballBat}})
   637   AddFunction({func = SpawnSupplyCrate, args = {targetPosX[1][2], targetPosY[1][2], amBaseballBat}})
   638   AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][3], targetPosY[1][3], amHammer}})
   638   AddFunction({func = SpawnSupplyCrate, args = {targetPosX[1][3], targetPosY[1][3], amHammer}})
   639 end
   639 end
   640 
   640 
   641 function CheckCannibalKilled()
   641 function CheckCannibalKilled()
   642   return cannibalKilled and StoppedGear(youngh)
   642   return cannibalKilled and StoppedGear(youngh)
   643 end
   643 end