share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
changeset 13740 2bb7141496a9
parent 13643 690cc84e9fd6
child 13750 110d6c1e817f
equal deleted inserted replaced
13739:b3b55b03d499 13740:2bb7141496a9
   195   AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
   195   AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
   196   AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
   196   AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
   197   AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
   197   AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
   198   SetGearMessage(leaks, 0)
   198   SetGearMessage(leaks, 0)
   199   TurnsLeft = 12
   199   TurnsLeft = 12
   200   TurnTimeLeft = TurnTime
   200   SetTurnTimeLeft(TurnTime)
   201   ShowMission(loc("The Journey Back"), loc("Collateral Damage"),
   201   ShowMission(loc("The Journey Back"), loc("Collateral Damage"),
   202     loc("Save the princess by collecting the crate in under 12 turns!") .. "|" ..
   202     loc("Save the princess by collecting the crate in under 12 turns!") .. "|" ..
   203     loc("Mines time: 3 seconds"), 0, 6000)
   203     loc("Mines time: 3 seconds"), 0, 6000)
   204   -----------------------///////////////------------
   204   -----------------------///////////////------------
   205 end
   205 end
   228 
   228 
   229 function AfterEndAnimAlone()
   229 function AfterEndAnimAlone()
   230   stage = endStage
   230   stage = endStage
   231   SwitchHog(leaks)
   231   SwitchHog(leaks)
   232   SetGearMessage(leaks, 0)
   232   SetGearMessage(leaks, 0)
   233   TurnTimeLeft = -1
   233   SetTurnTimeLeft(cMaxTurnTime)
   234   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   234   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   235   AddEvent(CheckLost, {}, DoLost, {}, 0)
   235   AddEvent(CheckLost, {}, DoLost, {}, 0)
   236   AddEvent(CheckWon, {}, DoWon, {}, 0)
   236   AddEvent(CheckWon, {}, DoWon, {}, 0)
   237   RemoveEventFunc(CheckFailedCourse)
   237   RemoveEventFunc(CheckFailedCourse)
   238 end
   238 end
   240 function AfterEndAnimDuo()
   240 function AfterEndAnimDuo()
   241   stage = endStage
   241   stage = endStage
   242   SwitchHog(leaks)
   242   SwitchHog(leaks)
   243   SetGearMessage(leaks, 0)
   243   SetGearMessage(leaks, 0)
   244   SetGearMessage(dense, 0)
   244   SetGearMessage(dense, 0)
   245   TurnTimeLeft = -1
   245   SetTurnTimeLeft(cMaxTurnTime)
   246   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   246   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   247   AddEvent(CheckLost, {}, DoLost, {}, 0)
   247   AddEvent(CheckLost, {}, DoLost, {}, 0)
   248   AddEvent(CheckWon, {}, DoWon, {}, 0)
   248   AddEvent(CheckWon, {}, DoWon, {}, 0)
   249 end
   249 end
   250 
   250 
   256   AddFunction({func = HideHedge, args = {cyborg}})
   256   AddFunction({func = HideHedge, args = {cyborg}})
   257 end
   257 end
   258 
   258 
   259 function AfterStartAnim()
   259 function AfterStartAnim()
   260   SetGearMessage(leaks, 0)
   260   SetGearMessage(leaks, 0)
   261   TurnTimeLeft = TurnTime
   261   SetTurnTimeLeft(TurnTime)
   262   local goal = loc("Get the crate on the other side of the island.")
   262   local goal = loc("Get the crate on the other side of the island.")
   263   local hint = loc("Hint: You might want to stay out of sight and take all the crates ...")
   263   local hint = loc("Hint: You might want to stay out of sight and take all the crates ...")
   264   local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!")
   264   local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!")
   265   local conds = loc("Leaks A Lot must survive!")
   265   local conds = loc("Leaks A Lot must survive!")
   266   if m2DenseDead == 0 then
   266   if m2DenseDead == 0 then
  1186   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1186   SetAmmo(amPickHammer, 0, 0, 0, 1)
  1187 end
  1187 end
  1188 
  1188 
  1189 function onNewTurn()
  1189 function onNewTurn()
  1190   if AnimInProgress() then
  1190   if AnimInProgress() then
  1191     TurnTimeLeft = -1
  1191     SetTurnTimeLeft(cMaxTurnTime)
  1192   elseif victory then
  1192   elseif victory then
  1193     EndTurn(true)
  1193     EndTurn(true)
  1194   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1194   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1195     AnimSwitchHog(leaks)
  1195     AnimSwitchHog(leaks)
  1196     SetGearMessage(leaks, 0)
  1196     SetGearMessage(leaks, 0)
  1197     TurnTimeLeft = -1
  1197     SetTurnTimeLeft(cMaxTurnTime)
  1198   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1198   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1199     TurnTimeLeft = 20000
  1199     SetTurnTimeLeft(20000)
  1200   else
  1200   else
  1201     TurnsLeft = TurnsLeft - 1
  1201     TurnsLeft = TurnsLeft - 1
  1202     if TurnsLeft >= 1 then
  1202     if TurnsLeft >= 1 then
  1203       AddCaption(string.format(loc("Turns left: %d"), TurnsLeft), capcolDefault, capgrpGameState)
  1203       AddCaption(string.format(loc("Turns left: %d"), TurnsLeft), capcolDefault, capgrpGameState)
  1204     end
  1204     end