share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua
changeset 13141 8f2260eeb726
parent 12933 e65aa3c3d4e6
child 13354 f9a15dcd857c
equal deleted inserted replaced
13140:e330feceb662 13141:8f2260eeb726
   610 function DoTargetsKilled()
   610 function DoTargetsKilled()
   611   targetsDestroyed = 0
   611   targetsDestroyed = 0
   612   targsWave = targsWave + 1
   612   targsWave = targsWave + 1
   613   if targsWave > 3 then
   613   if targsWave > 3 then
   614     RemoveEventFunc(CheckTargetsKilled)
   614     RemoveEventFunc(CheckTargetsKilled)
   615     SetState(cannibal, gstVisible)
   615     RestoreHog(cannibal)
   616     cannibalVisible = true
   616     cannibalVisible = true
   617     SetGearMessage(CurrentHedgehog, 0)
   617     SetGearMessage(CurrentHedgehog, 0)
   618     AddAnim(beforeKillAnim)
   618     AddAnim(beforeKillAnim)
   619     AddEvent(CheckCloseToCannibal, {}, DoCloseToCannibal, {}, 0)
   619     AddEvent(CheckCloseToCannibal, {}, DoCloseToCannibal, {}, 0)
   620     AddEvent(CheckCannibalKilled, {}, DoCannibalKilled, {}, 0)
   620     AddEvent(CheckCannibalKilled, {}, DoCannibalKilled, {}, 0)
   752 function onGameStart()
   752 function onGameStart()
   753   progress = tonumber(GetCampaignVar("Progress"))
   753   progress = tonumber(GetCampaignVar("Progress"))
   754   TurnTimeLeft = -1
   754   TurnTimeLeft = -1
   755   FollowGear(youngh)
   755   FollowGear(youngh)
   756 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   756 	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
   757   SetState(cannibal, gstInvisible)
   757   HideHog(cannibal)
   758 
   758 
   759   AddAnim(startDialogue)
   759   AddAnim(startDialogue)
   760   princessFace = "Right"
   760   princessFace = "Right"
   761   AddEvent(CheckNeedToTurn, {princess}, DoNeedToTurn, {princess}, 1)
   761   AddEvent(CheckNeedToTurn, {princess}, DoNeedToTurn, {princess}, 1)
   762   AddEvent(CheckNeedToTurn, {elderh}, DoNeedToTurn, {elderh}, 1)
   762   AddEvent(CheckNeedToTurn, {elderh}, DoNeedToTurn, {elderh}, 1)
   840   SetAmmo(amHammer, 0, 0, 0, 8)
   840   SetAmmo(amHammer, 0, 0, 0, 8)
   841 end
   841 end
   842 
   842 
   843 function onNewTurn()
   843 function onNewTurn()
   844   if CurrentHedgehog == cannibal and cannibalVisible == false then
   844   if CurrentHedgehog == cannibal and cannibalVisible == false then
   845     SetState(cannibal, gstInvisible)
   845     RestoreHog(cannibal)
   846   end
   846   end
   847   SwitchHog(youngh)
   847   SwitchHog(youngh)
   848   FollowGear(youngh)
   848   FollowGear(youngh)
   849   TurnTimeLeft = -1
   849   TurnTimeLeft = -1
   850 end
   850 end
   860     elderDamaged = true
   860     elderDamaged = true
   861     tTime = TurnTimeLeft
   861     tTime = TurnTimeLeft
   862   elseif gear == cannibal then
   862   elseif gear == cannibal then
   863     cannibalVisible = true
   863     cannibalVisible = true
   864     cannibalDamaged = true
   864     cannibalDamaged = true
   865     SetState(cannibal, 0)
       
   866   end
   865   end
   867 end
   866 end
   868 
   867 
   869 function onPrecise()
   868 function onPrecise()
   870   if GameTime > 2000 then
   869   if GameTime > 2000 then