share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
changeset 7463 bd5c7b8db666
parent 7448 d0521a3a4358
child 7466 5cb1b21b3176
equal deleted inserted replaced
7460:d32d573aeb64 7463:bd5c7b8db666
    37 nativeDir = {"Right", "Left", "Left", 
    37 nativeDir = {"Right", "Left", "Left", 
    38              "Right", "Left", "Right", 
    38              "Right", "Left", "Right", 
    39              "Left", "Right", "Right"}
    39              "Left", "Right", "Right"}
    40 
    40 
    41 cannibalNames = {loc("Brain Teaser"), loc("Bone Jackson"), loc("Gimme Bones"), 
    41 cannibalNames = {loc("Brain Teaser"), loc("Bone Jackson"), loc("Gimme Bones"), 
    42                  loc("Hedgibal Letter"), loc("Bloodpie"), loc("Scalp Muncher"),
    42                  loc("Hedgibal Lecter"), loc("Bloodpie"), loc("Scalp Muncher"),
    43                  loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
    43                  loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
    44                  loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
    44                  loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
    45 
    45 
    46 cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
    46 cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
    47                {3507, 195},  {3612, 1487}, {840, 1757}, 
    47                {3507, 195},  {3612, 1487}, {840, 1757}, 
    67 cannibalHidden = {}
    67 cannibalHidden = {}
    68 
    68 
    69 speakerHog = nil
    69 speakerHog = nil
    70 spyHog = nil
    70 spyHog = nil
    71 deployedHog = nil
    71 deployedHog = nil
       
    72 deployedDead = false
    72 
    73 
    73 cyborgHidden = false
    74 cyborgHidden = false
    74 needToAct = 0
    75 needToAct = 0
    75 
    76 
    76 m2Choice = 0
    77 m2Choice = 0
   562 
   563 
   563 function AfterWave2DeadAnim()
   564 function AfterWave2DeadAnim()
   564   TurnsLeft = 7
   565   TurnsLeft = 7
   565   stage = platformStage
   566   stage = platformStage
   566   SpawnPlatformCrates()
   567   SpawnPlatformCrates()
       
   568   SetGearMessage(CurrentHedgehog, 0)
   567   AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
   569   AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
   568   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   570   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   569   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   571   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   570   TurnTimeLeft = 0
   572   TurnTimeLeft = 0
   571   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."), 1, 12000)
   573   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."), 1, 12000)
   615 
   617 
   616 function DoDeployedDead()
   618 function DoDeployedDead()
   617   ShowMission(loc("Backstab"), loc("Brutus"), loc("You have failed to save the tribe!"), 0, 6000)
   619   ShowMission(loc("Backstab"), loc("Brutus"), loc("You have failed to save the tribe!"), 0, 6000)
   618   ParseCommand("teamgone " .. loc("Natives"))
   620   ParseCommand("teamgone " .. loc("Natives"))
   619   ParseCommand("teamgone " .. loc("Tribe"))
   621   ParseCommand("teamgone " .. loc("Tribe"))
       
   622   ParseCommand("teamgone " .. loc("011101001"))
   620   TurnTimeLeft = 0
   623   TurnTimeLeft = 0
   621 end
   624 end
   622 
   625 
   623 function CheckChoice()
   626 function CheckChoice()
   624   return choice ~= 0 and tmpVar == 0
   627   return choice ~= 0 and tmpVar == 0
   677   TurnTimeLeft = 0
   680   TurnTimeLeft = 0
   678   needToAct = index
   681   needToAct = index
   679 end
   682 end
   680 
   683 
   681 function AddWave3DeadAnim()
   684 function AddWave3DeadAnim()
   682   HideNatives()
   685   AnimSwitchHog(deployedHog)
   683   SetupWave3DeadAnim()
   686   AnimWait(deployedHog, 1)
   684   AddAnim(wave3DeadAnim)
   687   AddFunction({func = HideNatives, args = {}})
   685   AddFunction({func = AfterWave3DeadAnim, args = {}})
   688   AddFunction({func = SetupWave3DeadAnim, args = {}})
       
   689   AddFunction({func = AddAnim, args = {wave3DeadAnim}})
       
   690   AddFunction({func = AddFunction, args = {{func = AfterWave3DeadAnim, args = {}}}})
   686 end
   691 end
   687 
   692 
   688 function HideNatives()
   693 function HideNatives()
   689   for i = 1, 9 do
   694   for i = 1, 9 do
   690     if nativeDead[i] ~= true and natives[i] ~= deployedHog then
   695     if nativeDead[i] ~= true and natives[i] ~= deployedHog then
   896   end
   901   end
   897 
   902 
   898 
   903 
   899   AddTeam(loc("Assault Team"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
   904   AddTeam(loc("Assault Team"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
   900   for i = 1, 6 do
   905   for i = 1, 6 do
   901 --    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
   906     cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
   902     cannibals[i] = AddHog(cannibalNames[i], 1, 5, "vampirichog")
       
   903   end
   907   end
   904 
   908 
   905   AddTeam(loc("Reinforcements"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
   909   AddTeam(loc("Reinforcements"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
   906   for i = 7, 9 do
   910   for i = 7, 9 do
   907 --    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
   911     cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
   908     cannibals[i] = AddHog(cannibalNames[i], 1, 5, "vampirichog")
       
   909   end
   912   end
   910 
   913 
   911   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
   914   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
   912   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   915   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   913 
   916 
   992 
   995 
   993   if gear == spyHog and stage == spyKillStage then
   996   if gear == spyHog and stage == spyKillStage then
   994     freshDead = nil
   997     freshDead = nil
   995     choice = choiceEliminate
   998     choice = choiceEliminate
   996     tmpVar = 1
   999     tmpVar = 1
       
  1000   end
       
  1001 
       
  1002   if gear == deployedHog then
       
  1003     deployedDead = true
   997   end
  1004   end
   998 end
  1005 end
   999 
  1006 
  1000 function onGearAdd(gear)
  1007 function onGearAdd(gear)
  1001 end
  1008 end