share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua
changeset 7243 9ae9178c525e
parent 7241 7fda4d886c5e
child 7245 53f73f4ae203
equal deleted inserted replaced
7241:7fda4d886c5e 7243:9ae9178c525e
    77   end
    77   end
    78   AnimSwitchHog(cannibals[5])
    78   AnimSwitchHog(cannibals[5])
    79 end
    79 end
    80 
    80 
    81 function AfterWave2Anim()
    81 function AfterWave2Anim()
    82   SetGearMessage(CurrentHegdgehog, 0)
    82   TurnTimeLeft = 0
    83   SetState(CurrentHedgehog, 0)
       
    84   TurnTimeLeft = TurnTime
       
    85 end
    83 end
    86 
    84 
    87 function AfterFinalAnim()
    85 function AfterFinalAnim()
    88   if chiefDead == true then
    86   if chiefDead == true then
    89     SaveCampaignVar("M4ChiefDead", "1")
    87     SaveCampaignVar("M4ChiefDead", "1")
   102     i = i + 1
   100     i = i + 1
   103   end
   101   end
   104   gearr = natives[i]
   102   gearr = natives[i]
   105   if denseDead ~= true and band(GetState(dense), gstDrowning) == 0 then
   103   if denseDead ~= true and band(GetState(dense), gstDrowning) == 0 then
   106     AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
   104     AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
   107     AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"left"}}})
   105     AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
   108     AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
   106     AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
   109   end
   107   end
   110   AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
   108   AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
   111 end
   109 end
   112 
   110 
   113 function EmitDenseClouds(dir)
   111 function EmitDenseClouds(dir)
   114   local dif
   112   local dif
   115   if dir == "left" then
   113   if dir == "Left" then
   116     dif = 10
   114     dif = 10
   117   else
   115   else
   118     dif = -10
   116     dif = -10
   119   end
   117   end
   120   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
   118   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
   152   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("No, we made sure of that!"), SAY_SAY, 3500}})
   150   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("No, we made sure of that!"), SAY_SAY, 3500}})
   153   table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
   151   table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
   154   table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
   152   table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
   155   table.insert(startAnim, {func = AnimSay, args = {chief, loc("First aid kits?!"), SAY_SAY, 3000}})
   153   table.insert(startAnim, {func = AnimSay, args = {chief, loc("First aid kits?!"), SAY_SAY, 3000}})
   156   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
   154   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
   157   table.insert(startAnim, {func = AnimMove, args = {water, "left", 3000, 0}})
   155   table.insert(startAnim, {func = AnimMove, args = {water, "Left", 3000, 0}})
   158   table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
   156   table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
   159   table.insert(startAnim, {func = AnimMove, args = {water, "left", 2655, 0}})
   157   table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2655, 0}})
   160   table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
   158   table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
   161   table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
   159   table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
   162   table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
   160   table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
   163   table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
   161   table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
   164   table.insert(startAnim, {func = AnimMove, args = {water, "left", 2467, 754}})
   162   table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2467, 754}})
   165   table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
   163   table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
   166   table.insert(startAnim, {func = AnimTurn, args = {chief, "Right"}})
   164   table.insert(startAnim, {func = AnimTurn, args = {chief, "Right"}})
   167   table.insert(startAnim, {func = AnimSay, args = {chief, loc("..."), SAY_THINK, 1500}})
   165   table.insert(startAnim, {func = AnimSay, args = {chief, loc("..."), SAY_THINK, 1500}})
   168   table.insert(startAnim, {func = AnimSay, args = {chief, loc("Where have you been?"), SAY_SAY, 4000}})
   166   table.insert(startAnim, {func = AnimSay, args = {chief, loc("Where have you been?"), SAY_SAY, 4000}})
   169   table.insert(startAnim, {func = AnimSay, args = {water, loc("Just on a walk."), SAY_SAY, 3000}})
   167   table.insert(startAnim, {func = AnimSay, args = {water, loc("Just on a walk."), SAY_SAY, 3000}})
   183     table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
   181     table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
   184   end
   182   end
   185   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, Wave2Reaction, {}}, swh = false})
   183   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, Wave2Reaction, {}}, swh = false})
   186   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {2}}, swh = false})
   184   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {2}}, swh = false})
   187   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
   185   table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
       
   186   table.insert(wave2Anim, {func = AnimSwitchHog, args = {cannibals[5]}})
   188   AddSkipFunction(wave2Anim, SkipWave2Anim, {})
   187   AddSkipFunction(wave2Anim, SkipWave2Anim, {})
   189 end
   188 end
   190 
   189 
   191 function SetupHogDeadAnim(gear)
   190 function SetupHogDeadAnim(gear)
   192   hogDeadAnim = {}
   191   hogDeadAnim = {}
   375 
   374 
   376 
   375 
   377 -----------------------------Main Functions----------------------------
   376 -----------------------------Main Functions----------------------------
   378 
   377 
   379 function onGameInit()
   378 function onGameInit()
   380 	Seed = 0 
   379 	Seed = 1
   381 	GameFlags = 0
   380 	GameFlags = 0
   382 	TurnTime = 60000 
   381 	TurnTime = 60000 
   383 	CaseFreq = 0
   382 	CaseFreq = 0
   384 	MinesNum = 0
   383 	MinesNum = 0
   385 	MinesTime = 3000
   384 	MinesTime = 3000