share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua
branchspacecampaign
changeset 9263 5069877daa09
parent 9258 5c760ed50b3d
equal deleted inserted replaced
9258:5c760ed50b3d 9263:5069877daa09
    75   [beforeKillAnim] = {loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000},
    75   [beforeKillAnim] = {loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000},
    76   [closeCannim] = {loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}
    76   [closeCannim] = {loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}
    77 }
    77 }
    78 -----------------------------Animations--------------------------------
    78 -----------------------------Animations--------------------------------
    79 function Skipanim(anim)
    79 function Skipanim(anim)
    80 WriteLnToConsole("SWITCH HOG")
       
    81   AnimSwitchHog(youngh)
    80   AnimSwitchHog(youngh)
    82   if goals[anim] ~= nil then
    81   if goals[anim] ~= nil then
    83     ShowMission(unpack(goals[anim]))
    82     ShowMission(unpack(goals[anim]))
    84   end
    83   end
    85   if anim == startDialogue then
    84   if anim == startDialogue then
   110 
   109 
   111   AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
   110   AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
   112   table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
   111   table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
   113   table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
   112   table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
   114   table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
   113   table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
   115   WriteLnToConsole("START DIALOG")
   114   
   116   WriteLnToConsole("END GAME START")
       
   117   AddSkipFunction(startDialogue, Skipanim, {startDialogue})
   115   AddSkipFunction(startDialogue, Skipanim, {startDialogue})
   118   --table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
   116   table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
   119   table.insert(startDialogue, {func = WriteLnToConsole, args = {"FIRST PRINT"}})
       
   120   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."),  5000}})
   117   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."),  5000}})
   121   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."), 5000}})
   118   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."), 5000}})
   122   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."), 5000}})
   119   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."), 5000}})
   123   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
   120   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
   124   table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
   121   table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
   126   table.insert(startDialogue, {func = AnimSay, args = {youngh, loc("This is it! It's time to make Fell From Heaven fall for me..."), SAY_THINK, 6000}})
   123   table.insert(startDialogue, {func = AnimSay, args = {youngh, loc("This is it! It's time to make Fell From Heaven fall for me..."), SAY_THINK, 6000}})
   127   table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
   124   table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
   128   table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
   125   table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
   129   table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
   126   table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
   130   table.insert(startDialogue, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000}}) 
   127   table.insert(startDialogue, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000}}) 
   131 WriteLnToConsole("START DIALOG END")
   128 
   132   AddSkipFunction(onShroomAnim, SkipOnShroom, {onShroomAnim})
   129   AddSkipFunction(onShroomAnim, SkipOnShroom, {onShroomAnim})
   133   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("I can see you have been training diligently."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onShroomAnim})
   130   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("I can see you have been training diligently."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onShroomAnim})
   134   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("The wind whispers that you are ready to become familiar with tools, now..."), SAY_SAY, 4000}})
   131   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("The wind whispers that you are ready to become familiar with tools, now..."), SAY_SAY, 4000}})
   135   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
   132   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
   136   table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
   133   table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
   636   AnimInit()
   633   AnimInit()
   637   AnimationSetup()
   634   AnimationSetup()
   638 end
   635 end
   639 
   636 
   640 function onGameStart()
   637 function onGameStart()
   641 
       
   642   progress = tonumber(GetCampaignVar("Progress"))
   638   progress = tonumber(GetCampaignVar("Progress"))
   643   TurnTimeLeft = -1
   639   TurnTimeLeft = -1
   644   FollowGear(youngh)
   640   FollowGear(youngh)
   645 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   641 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   646   SetState(cannibal, gstInvisible)
   642   SetState(cannibal, gstInvisible)
   707   SetAmmo(amBaseballBat, 0, 0, 0, 8)
   703   SetAmmo(amBaseballBat, 0, 0, 0, 8)
   708   SetAmmo(amHammer, 0, 0, 0, 8)
   704   SetAmmo(amHammer, 0, 0, 0, 8)
   709 end
   705 end
   710 
   706 
   711 function onNewTurn()
   707 function onNewTurn()
   712 WriteLnToConsole("NEW TURN")
       
   713   if CurrentHedgehog == cannibal and cannibalVisible == false then
   708   if CurrentHedgehog == cannibal and cannibalVisible == false then
   714     SetState(cannibal, gstInvisible)
   709     SetState(cannibal, gstInvisible)
   715   end
   710   end
   716   SwitchHog(youngh)
   711   SwitchHog(youngh)
   717   FollowGear(youngh)
   712   FollowGear(youngh)