share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua
changeset 15018 cf5d6ee109c9
parent 15002 3ed1cbd31754
child 15019 51fbc0034c6f
equal deleted inserted replaced
15017:d610d1c9fd55 15018:cf5d6ee109c9
   165   [startDialogue] = {loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Long Jump] to jump forwards.") .. "| |" .. ctrlJump, 1, 4000},
   165   [startDialogue] = {loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Long Jump] to jump forwards.") .. "| |" .. ctrlJump, 1, 4000},
   166   [onShroomAnim] = {loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower.") .. "|" .. ctrlMissionPanel, 1, 7000},
   166   [onShroomAnim] = {loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower.") .. "|" .. ctrlMissionPanel, 1, 7000},
   167   [onFlowerAnim] = {loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.") .. "|" .. loc("Hint: Select the rope, [Up] or [Down] to aim, [Attack] to fire, directional keys to move.") .. "|" .. loc("Ropes can be fired again in the air!") .. "| |" .. ctrlAttack, 1, 7000},
   167   [onFlowerAnim] = {loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.") .. "|" .. loc("Hint: Select the rope, [Up] or [Down] to aim, [Attack] to fire, directional keys to move.") .. "|" .. loc("Ropes can be fired again in the air!") .. "| |" .. ctrlAttack, 1, 7000},
   168   [tookParaAnim] = {loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole."), 1, 4000},
   168   [tookParaAnim] = {loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole."), 1, 4000},
   169   [onMoleHeadAnim] = {loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute to get the next crate.") .. "|" .. loc("Hint: Just select the parachute, it opens automatically when you fall."), 1, 4000},
   169   [onMoleHeadAnim] = {loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute to get the next crate.") .. "|" .. loc("Hint: Just select the parachute, it opens automatically when you fall."), 1, 4000},
       
   170   [pastMoleHeadAnim] = {loc("First Blood"), loc("The Leap of Faith"), loc("Get that crate!"), 1, 4000},
   170   [tookRope2Anim] = {loc("First Blood"), loc("The Rising"), loc("Get that crate!"), 1, 4000},
   171   [tookRope2Anim] = {loc("First Blood"), loc("The Rising"), loc("Get that crate!"), 1, 4000},
   171   [tookPunchAnim] = {loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!") .. "|" .. loc("Hint: Select the Shoryuken and hit [Attack].|P.S.: You can use it mid-air.") .. "| |" .. ctrlAttack, 1, 5000},
   172   [tookPunchAnim] = {loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!") .. "|" .. loc("Hint: Select the Shoryuken and hit [Attack].|P.S.: You can use it mid-air.") .. "| |" .. ctrlAttack, 1, 5000},
   172   [challengeAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
   173   [challengeAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
   173   [challengeFailedAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
   174   [challengeFailedAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
   174   [challengeCompletedAnim] = {loc("First Blood"), loc("The Ultimate Weapon"), loc("Get that crate!"), 1, 5000},
   175   [challengeCompletedAnim] = {loc("First Blood"), loc("The Ultimate Weapon"), loc("Get that crate!"), 1, 5000},
   262   table.insert(onMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
   263   table.insert(onMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
   263 
   264 
   264   AddSkipFunction(pastMoleHeadAnim, Skipanim, {pastMoleHeadAnim})
   265   AddSkipFunction(pastMoleHeadAnim, Skipanim, {pastMoleHeadAnim})
   265   table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("I see you have already taken the leap of faith."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = pastMoleHeadAnim})
   266   table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("I see you have already taken the leap of faith."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = pastMoleHeadAnim})
   266   table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Get that crate!"), SAY_SAY, 4000}})
   267   table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Get that crate!"), SAY_SAY, 4000}})
       
   268   table.insert(pastMoleHeadAnim, {func = AnimShowMission, args = {youngh, unpack(goals[pastMoleHeadAnim])}})
   267   table.insert(pastMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
   269   table.insert(pastMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
   268 
   270 
   269   AddSkipFunction(tookRope2Anim, Skipanim, {tookRope2Anim})
   271   AddSkipFunction(tookRope2Anim, Skipanim, {tookRope2Anim})
   270   table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("Impressive...you are still dry as the corpse of a hawk after a week in the desert..."), SAY_SAY, 5000}, skipFunc = Skipanim, skipArgs = tookRope2Anim})
   272   table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("Impressive...you are still dry as the corpse of a hawk after a week in the desert..."), SAY_SAY, 5000}, skipFunc = Skipanim, skipArgs = tookRope2Anim})
   271   table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("You probably know what to do next..."), SAY_SAY, 4000}})
   273   table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("You probably know what to do next..."), SAY_SAY, 4000}})
   460 end
   462 end
   461 
   463 
   462 function DoTookParaCrate()
   464 function DoTookParaCrate()
   463   AddAmmo(youngh, amParachute, 100)
   465   AddAmmo(youngh, amParachute, 100)
   464   SetGearMessage(CurrentHedgehog, 0)
   466   SetGearMessage(CurrentHedgehog, 0)
   465   AddAnim(tookParaAnim)
   467   if CheckOnOrPastMoleHead() then
   466   AddEvent(CheckOnMoleHead, {}, DoOnMoleHead, {}, 0)
   468     DoOnOrPastMoleHead()
   467   AddEvent(CheckPastMoleHead, {}, DoPastMoleHead, {}, 0)
   469   else
       
   470     AddAnim(tookParaAnim)
       
   471     AddEvent(CheckOnOrPastMoleHead, {}, DoOnOrPastMoleHead, {}, 0)
       
   472   end
   468 end
   473 end
   469 
   474 
   470 function CheckOnMoleHead()
   475 function CheckOnMoleHead()
   471   x = GetX(youngh)
   476   local x = GetX(youngh)
   472   return x >= 3005 and x <= 3126 and StoppedGear(youngh)
   477   return x >= 3005 and x <= 3126 and StoppedGear(youngh)
   473 end
   478 end
   474 
   479 
   475 function CheckPastMoleHead()
   480 function CheckPastMoleHead()
   476   x = GetX(youngh)
   481   local x = GetX(youngh)
   477   y = GetY(youngh)
   482   local y = GetY(youngh)
   478   return x < 3005 and y > 1500 and StoppedGear(youngh)
   483   return x < 3005 and y > 1500 and StoppedGear(youngh)
   479 end
   484 end
   480 
   485 
   481 function DoPastMoleHead()
   486 function CheckOnOrPastMoleHead()
       
   487   return CheckOnMoleHead() or CheckPastMoleHead()
       
   488 end
       
   489 
       
   490 function DoOnOrPastMoleHead()
   482   -- Initiate parachute challenge
   491   -- Initiate parachute challenge
   483   RemoveEventFunc(CheckOnMoleHead)
       
   484   ropeCrate2 = SpawnSupplyCrate(2782, 1720, amRope, 100)
   492   ropeCrate2 = SpawnSupplyCrate(2782, 1720, amRope, 100)
   485   rope2InProgress = true
   493   rope2InProgress = true
   486   AddAmmo(youngh, amRope, 0)
   494   AddAmmo(youngh, amRope, 0)
   487   SetGearMessage(CurrentHedgehog, 0)
   495   SetGearMessage(CurrentHedgehog, 0)
   488   -- Block the way to the hole to the right, since the player loses the rope for this section
   496   -- Block the way to the hole to the right, since the player loses the rope for this section
   489   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   497   PlaceGirder(rope2GirderX, rope2GirderY, 6)
   490   AddAnim(pastMoleHeadAnim)
   498   if CheckPastMoleHead() then
   491   AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
   499     AddAnim(pastMoleHeadAnim)
   492 end
   500   else
   493 
   501     AddAnim(onMoleHeadAnim)
   494 function DoOnMoleHead()
   502   end
   495   -- Initiate parachute challenge
       
   496   RemoveEventFunc(CheckPastMoleHead)
       
   497   ropeCrate2 = SpawnSupplyCrate(2782, 1720, amRope, 100)
       
   498   rope2InProgress = true
       
   499   AddAmmo(youngh, amRope, 0)
       
   500   SetGearMessage(CurrentHedgehog, 0)
       
   501   -- Block the way to the hole to the right, since the player loses the rope for this section
       
   502   PlaceGirder(rope2GirderX, rope2GirderY, 6)
       
   503   AddAnim(onMoleHeadAnim)
       
   504   AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
   503   AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
   505 end
   504 end
   506 
   505 
   507 function CheckTookRope2()
   506 function CheckTookRope2()
   508   return rope2Taken and StoppedGear(youngh)
   507   return rope2Taken and StoppedGear(youngh)