share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua
branchspacecampaign
changeset 9258 5c760ed50b3d
parent 8984 3c342826f299
child 9263 5069877daa09
equal deleted inserted replaced
9255:fd16cfa267aa 9258:5c760ed50b3d
    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")
    80   AnimSwitchHog(youngh)
    81   AnimSwitchHog(youngh)
    81   if goals[anim] ~= nil then
    82   if goals[anim] ~= nil then
    82     ShowMission(unpack(goals[anim]))
    83     ShowMission(unpack(goals[anim]))
    83   end
    84   end
    84   if anim == startDialogue then
    85   if anim == startDialogue then
   109 
   110 
   110   AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
   111   AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
   111   table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
   112   table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
   112   table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
   113   table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
   113   table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
   114   table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
   114   
   115   WriteLnToConsole("START DIALOG")
       
   116   WriteLnToConsole("END GAME START")
   115   AddSkipFunction(startDialogue, Skipanim, {startDialogue})
   117   AddSkipFunction(startDialogue, Skipanim, {startDialogue})
   116   table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
   118   --table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
       
   119   table.insert(startDialogue, {func = WriteLnToConsole, args = {"FIRST PRINT"}})
   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}})
   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}})
   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}})
   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}})
   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}})
   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}})
   120   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
   123   table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
   121   table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
   124   table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
   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}})
   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}})
   124   table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
   127   table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
   125   table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
   128   table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
   126   table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
   129   table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
   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}}) 
   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}}) 
   128 
   131 WriteLnToConsole("START DIALOG END")
   129   AddSkipFunction(onShroomAnim, SkipOnShroom, {onShroomAnim})
   132   AddSkipFunction(onShroomAnim, SkipOnShroom, {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})
   133   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("I can see you have been training diligently."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onShroomAnim})
   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}})
   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}})
   132   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
   135   table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
   133   table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
   136   table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
   633   AnimInit()
   636   AnimInit()
   634   AnimationSetup()
   637   AnimationSetup()
   635 end
   638 end
   636 
   639 
   637 function onGameStart()
   640 function onGameStart()
       
   641 
   638   progress = tonumber(GetCampaignVar("Progress"))
   642   progress = tonumber(GetCampaignVar("Progress"))
   639   TurnTimeLeft = -1
   643   TurnTimeLeft = -1
   640   FollowGear(youngh)
   644   FollowGear(youngh)
   641 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   645 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   642   SetState(cannibal, gstInvisible)
   646   SetState(cannibal, gstInvisible)
   703   SetAmmo(amBaseballBat, 0, 0, 0, 8)
   707   SetAmmo(amBaseballBat, 0, 0, 0, 8)
   704   SetAmmo(amHammer, 0, 0, 0, 8)
   708   SetAmmo(amHammer, 0, 0, 0, 8)
   705 end
   709 end
   706 
   710 
   707 function onNewTurn()
   711 function onNewTurn()
       
   712 WriteLnToConsole("NEW TURN")
   708   if CurrentHedgehog == cannibal and cannibalVisible == false then
   713   if CurrentHedgehog == cannibal and cannibalVisible == false then
   709     SetState(cannibal, gstInvisible)
   714     SetState(cannibal, gstInvisible)
   710   end
   715   end
   711   SwitchHog(youngh)
   716   SwitchHog(youngh)
   712   FollowGear(youngh)
   717   FollowGear(youngh)