share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
author belphegorr <szabibibi@gmail.com>
Mon, 16 Jul 2012 20:56:55 +0300
changeset 7255 93cf6b3b89be
parent 7253 86814ed9feab
child 7259 b630df7ac843
permissions -rw-r--r--
Fixed a visual gear in Mission 5 Animate.lua: added an optional boolean parameter to AnimVisualGear - follow
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7253
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     1
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     2
loadfile(GetDataPath() .. "Scripts/Animate.lua")()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     3
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     4
-----------------------------Constants---------------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     5
choiceAccepted = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     6
choiceRefused = 2
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     7
choiceAttacked = 3
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     8
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     9
choiceEliminate = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    10
choiceSpare = 2
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    11
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    12
leaksNum = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    13
denseNum = 2
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    14
waterNum = 3
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    15
buffaloNum = 4
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    16
chiefNum = 5
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    17
princessNum = 6
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    18
wiseNum = 7
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    19
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    20
spyKillStage = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    21
platformStage = 2
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    22
wave3Stage = 3
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    23
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    24
tmpVar = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    25
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    26
nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    27
               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Heaven"),
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    28
               loc("Wise Oak"), loc("Eagle Eye"), loc("Flaming Worm")}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    29
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
              "tiara", "AkuAku", "None", "None"}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
nativePos = {{887, 329}, {1050, 288}, {1731, 707},
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
             {830, 342}, {1001, 290}, {773, 340},
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
             {953, 305}, {347, 648}, {314, 647}}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
nativeDir = {"Right", "Left", "Left", 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
             "Right", "Left", "Right", 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
             "Left", "Right", "Right"}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
cannibalNames = {loc("Brain Teaser"), loc("Bone Jackson"), loc("Gimme Bones"), 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
                 loc("Hedgibal Letter"), loc("Bloodpie"), loc("Scalp Muncher"),
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    43
                 loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
                 loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    45
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
               {3694, 1509}, {3746, 1525}, {3704, 1513},
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
               {3607, 1472}, {3612, 1487}, {3646, 1502}, 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
               {3694, 1509}, {3746, 1525}, {3704, 1513}}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
cannibalDir = {"Left", "Left", "Left",
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
               "Left", "Left", "Left",
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
               "Left", "Left", "Left",
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
               "Left", "Left", "Left"}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
cyborgPos = {1369, 574}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
cyborgPos2 = {1308, 148}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
deployedPos = {2522, 1365}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
-----------------------------Variables---------------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
natives = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
nativeDead = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
nativeHidden = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
nativeRevived = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
nativesNum = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
cannibals = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
cannibalDead = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
cannibalHidden = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
speakerHog = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
spyHog = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
deployedHog = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
cyborgHidden = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
m2Choice = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
m2DenseDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
m4DenseDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
m4BuffaloDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
m4WaterDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
m4ChiefDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    83
m4LeaksDead = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    84
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    85
needRevival = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
gearr = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
startElimination = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
stage = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
choice = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
highJumped = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
TurnsLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
startNativesNum = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
startAnim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
afterChoiceAnim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
wave2Anim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
wave2DeadAnim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    98
wave3DeadAnim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    99
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   100
-----------------------------Animations--------------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   101
function Wave2Reaction()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
  local i = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
  local gearr = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   104
  while nativeDead[i] == true do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   105
    i = i + 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   106
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   107
  gearr = natives[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
  if nativeDead[denseNum] ~= true and band(GetState(natives[denseNum]), gstDrowning) == 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   109
    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   110
    AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   111
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
  if nativeDead[buffaloNum] ~= true and band(GetState(natives[buffaloNum]), gstDrowning) == 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
    AnimInsertStepNext({func = AnimSay, args = {natives[buffaloNum], loc("Let them have a taste of my fury!"), SAY_SHOUT, 6000}}) 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   117
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   118
function EmitDenseClouds(dir)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
  local dif
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
  if dir == "Left" then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
    dif = 10
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
    dif = -10
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
  AnimInsertStepNext({func = AnimWait, args = {natives[denseNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   130
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
  AnimInsertStepNext({func = AnimWait, args = {natives[denseNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   132
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   134
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
function SaySafe()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   136
  local i = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
  while gearr == nil do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
    if nativeDead[i] ~= true and nativeHidden[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   139
      gearr = natives[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   140
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
    i = i + 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
  AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "We are indeed.", SAY_SAY, 2500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
  AnimInsertStepNext({func = AnimSay, args = {gearr, "I think we are safe here.", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
function ReviveNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   148
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
    if nativeHidden[i] == true and nativeDead[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
      RestoreHog(natives[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   151
      nativeHidden[i] = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   152
      nativeRevived[i] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
      AnimInsertStepNext({func = AnimOutOfNowhere, args = {natives[i], unpack(nativePos[i])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   155
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
function WonderAlive()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  if nativeRevived[waterNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "I'm...alive? How? Why?", SAY_THINK, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
    AnimInsertStepNext({func = AnimWait, args = {natives[waterNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
    AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
    AnimInsertStepNext({func = AnimWait, args = {natives[waterNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
    AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  if nativeRevived[leaksNum] == true and nativeRevived[denseNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "But why would they help us?", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   168
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "It must be the aliens!", SAY_SAY, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   169
    AnimInsertStepNext({func = AnimSay, args = {natives[princessNum], "You just appeared out of thin air!", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "But...we died!", SAY_SAY, 2500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "This must be the caves!", SAY_SAY, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "Dude, where are we?", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   185
    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], natives[princessNum]}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
    if nativeDead[chiefNum] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   188
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
  elseif nativeRevived[leaksNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Why would they do this?", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "It must be the aliens' deed.", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   192
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "Do not laugh, inexperienced one, for he speaks the truth!", SAY_SAY, 10000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Yeah, sure! I died. Hillarious!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   194
    AnimInsertStepNext({func = AnimSay, args = {gearr, "You're...alive!? But we saw you die!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   195
    AnimInsertStepNext({func = AnimSay, args = {gearr, "???", SAY_SAY, 2000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   196
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Wow, what a dream!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
    if nativeDead[chiefNum] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   200
    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], natives[wiseNum]}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], gearr}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   202
  elseif nativeRevived[denseNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "Dude, that's so cool!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "It must be the aliens' deed.", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "But that's impossible!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "It was not a dream, unwise one!", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "Exactly, man! That was my dream.", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
    AnimInsertStepNext({func = AnimSay, args = {gearr, "You're...alive!? But we saw you die!", SAY_SAY,  6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   209
    AnimInsertStepNext({func = AnimSay, args = {gearr, "???", SAY_SAY, 2000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   210
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "Dude, wow! I just had the weirdest high!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   211
    if nativeDead[chiefNum] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   212
      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   214
    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[denseNum], CondNeedToTurn, {natives[denseNum], natives[wiseNum]}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[denseNum], CondNeedToTurn, {natives[denseNum], gearr}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   217
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   219
function ExplainAlive()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   220
  if needRevival == true and m4WaterDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   221
    RestoreCyborg()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
    SetGearPosition(cyborg, unpack(cyborgPos))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
    AnimInsertStepNext({func = AnimCustomFunction, args = {water, HideCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
    AnimInsertStepNext({func = AnimSwitchHog, args = {water}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
    AnimInsertStepNext({func = AnimSay, args = {cyborg, "The answer is...entertaintment. You'll see what I mean.", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
    AnimInsertStepNext({func = AnimSay, args = {cyborg, "You're probably wondering why I bought you back...", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
function SpyDebate()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
  if m2Choice == choiceAccepted then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
    spyHog = natives[denseNum]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   233
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "What shall we do with the traitor?", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
    AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[denseNum], 26}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
    AnimInsertStepNext({func = AnimVisualGear, args = {GetGearPosition(natives[denseNum]), vgtExplosion, 0, true}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "Here, let me help you!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
    if nativeDead[chiefNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
      AnimInsertStepNext({func = AnimSay, args = {natives[princessNum], "You killed my father, you monster!", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   239
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   240
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "Look, I had no choice!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   241
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "You have been giving us out to the enemy, haven't you!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   242
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "You're a pathetic liar!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   243
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Interesting! Last time you said you killed a cannibal!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], "I told you, I just found them.", SAY_SAY, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
    AnimInsertStepNext({func = AnimCustomFunction, args = {natives[denseNum], EmitDenseClouds, {"Left"}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Where did you get the weapons in the forest, Dense Cloud?", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Not now, Fiery Water!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
    spyHog = natives[waterNum]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   250
    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "What shall we do with the traitor?", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   251
    AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[waterNum], 26}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
    AnimInsertStepNext({func = AnimVisualGear, args = {nativePos[denseNum][1] + 50, nativePos[denseNum][2], vgtExplosion, 0, true}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
    AnimInsertStepNext({func = AnimSay, args = {natives[princessNum], "I can't believe what I'm hearing!", SAY_SAY, 5500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "You know what? I don't even regret anything!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
    AnimInsertStepNext({func = AnimSay, args = {natives[princessNum], "In fact, you are the only one that's been acting strangely.", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "Are you accusing me of something?", SAY_SAY, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Seems like every time you take a \"walk\", the enemy find us!", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "You know...taking a stroll.", SAY_SAY, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "Where have you been?!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
  if nativeRevived[waterNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "You won't believe what happened to me!", SAY_SAY, 5500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
  AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], "Hey, guys!", SAY_SAY, 2000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
  AnimInsertStepNext({func = AnimMove, args = {natives[waterNum], "Left", nativePos[denseNum][1] + 50, nativePos[denseNum][2]}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "back"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
  AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
  AnimInsertStepNext({func = AnimMove, args = {natives[waterNum], "Left", 1228, 412}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
  AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
  AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], "There must be a spy among us!", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  AnimInsertStepNext({func = AnimSay, args = {natives[princessNum], "We made sure noone followed us!", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
  AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], "What? Here? How did they find us?!", SAY_SAY, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
function AnimationSetup()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
  table.insert(startAnim, {func = AnimWait, args = {natives[leaksNum], 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], SaySafe, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
  if needRevival == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, ReviveNatives, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], WonderAlive, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, ExplainAlive, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], RestoreWave, {1}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[1], unpack(cannibalPos[1])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[2], unpack(cannibalPos[2])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[3], unpack(cannibalPos[3])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
  table.insert(startAnim, {func = AnimWait, args = {natives[leaksNum], 1000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], SpyDebate, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
  AddSkipFunction(startAnim, SkipStartAnim, {})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
function SetupWave2Anim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   296
  for i = 7, 1, -1 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
    if nativeDead[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
      speakerHog = natives[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   300
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[4], unpack(cannibalPos[4])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[5], unpack(cannibalPos[5])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[6], unpack(cannibalPos[6])}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
  table.insert(wave2Anim, {func = AnimSay, args = {speakerHog, "Look out! There's more of them!", SAY_SHOUT, 5000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
function SetupWave2DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
  for i = 7, 1, -1 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
    if nativeDead[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
      deployedHog = natives[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
  if nativeDead[wiseNum] ~= true and band(GetState(natives[wiseNum]), gstDrowning) == 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
    if nativesNum > 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
      table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "What a strange feeling!", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "I need to warn the others.", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "If only I had a way...", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   320
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "Oh, silly me! I forgot that I'm the shaman.", SAY_THINK, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TeleportNatives, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TurnNatives, {natives[wiseNum]}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], CondNeedToTurn, {natives[wiseNum], deployedHog}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "I sense another wave of cannibals heading our way!", SAY_SAY, 6500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "We need to prevent their arrival!", SAY_SAY, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "Go, quick!", SAY_SAY, 2500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], DeployHog, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   328
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
      table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
      table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   331
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
      table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, "I want to see how it handles this!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
      table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
      table.insert(wave2DeadAnim, {func = AnimDisappear, args = {cyborg, 0, 0}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, DeployHog, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   337
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
    else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
      table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "What a strange feeling!", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "I sense another wave of cannibals heading my way!", SAY_THINK, 6500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   342
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "I need to prevent their arrival!", SAY_THINK, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "If only I had a way...", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   344
      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], "Oh, silly me! I forgot that I'm the shaman.", SAY_THINK, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   345
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   346
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
    table.insert(wave2DeadAnim, {func = AnimWait, args = {cyborg, 1500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   348
    table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, RestoreCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
    table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TeleportNatives, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   351
    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TurnNatives, {cyborg}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   352
    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, "Oh, my! This is even more entertaining than I've expected!", SAY_SAY, 7500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   353
    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, "You might want to find a way to instantly kill arriving cannibals!", SAY_SAY, 8000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   354
    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, "I believe there's more of them.", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
    if nativesNum > 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
      table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
      table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
      table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, "I want to see how it handles this!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
    table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
    table.insert(wave2DeadAnim, {func = AnimDisappear, swh = false, args = {cyborg, 0, 0}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {deployedHog, DeployHog, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
    table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
  AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
function IsolateNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
  PlaceGirder(710, 299, 6)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
  PlaceGirder(690, 299, 6)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
  PlaceGirder(761, 209, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  PlaceGirder(921, 209, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
  PlaceGirder(1081, 209, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
  PlaceGirder(761, 189, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
  PlaceGirder(921, 189, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
  PlaceGirder(1081, 189, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
  PlaceGirder(761, 169, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
  PlaceGirder(921, 169, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
  PlaceGirder(1081, 169, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
  PlaceGirder(761, 149, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
  PlaceGirder(921, 149, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
  PlaceGirder(1081, 149, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
  PlaceGirder(761, 129, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   387
  PlaceGirder(921, 129, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
  PlaceGirder(1081, 129, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
  PlaceGirder(1120, 261, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
  PlaceGirder(1140, 261, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
  PlaceGirder(1160, 261, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
  AddAmmo(deployedHog, amDEagle, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
  AddAmmo(deployedHog, amFirePunch, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
function PutCGI()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
  AddVisualGear(710, 299, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
  AddVisualGear(690, 299, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
  AddVisualGear(761, 209, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
  AddVisualGear(921, 209, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  AddVisualGear(1081, 209, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
  AddVisualGear(761, 189, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  AddVisualGear(921, 189, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
  AddVisualGear(1081, 189, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  AddVisualGear(761, 169, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
  AddVisualGear(921, 169, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  AddVisualGear(1081, 169, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  AddVisualGear(761, 149, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
  AddVisualGear(921, 149, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
  AddVisualGear(1081, 149, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
  AddVisualGear(761, 129, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  AddVisualGear(921, 129, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  AddVisualGear(1081, 129, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
  AddVisualGear(1120, 261, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
  AddVisualGear(1140, 261, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
  AddVisualGear(1160, 261, vgtExplosion, 0, true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
function TeleportNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
  nativePos[waterNum] = {1100, 288}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
    if nativeDead[i] ~= true then 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
      AnimTeleportGear(natives[i], unpack(nativePos[i]))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   428
function TurnNatives(hog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
    if nativeDead[i] == false then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
      if GetX(natives[i]) < GetX(hog) then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
        AnimTurn(natives[i], "Right")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
      else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
        AnimTurn(natives[i], "Left")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
      end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   438
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   439
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   440
function DeployHog()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   441
  AnimSwitchHog(deployedHog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   442
  AnimTeleportGear(deployedHog, unpack(deployedPos))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   443
  if deployedHog ~= natives[wiseNum] then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   444
    AnimSay(deployedHog, "Why me?!", SAY_THINK, 2000)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   445
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   447
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
function SetupAfterChoiceAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   449
  for i = 7, 1, -1 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
    if nativeDead[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
      if natives[i] ~= spyHog then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
        speakerHog = natives[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
      end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   454
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
  if choice == choiceEliminate then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
    table.insert(afterChoiceAnim, {func = AnimWait, args = {speakerHog, 1500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "He won't be selling us out anymore!", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
    if nativeDead[princessNum] ~= true and m4ChiefDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
      table.insert(afterChoiceAnim, {func = AnimSay, args = {natives[princessNum], "That's for my father!", SAY_SAY, 3500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "Let's show those cannibals what we're made of!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   464
    table.insert(afterChoiceAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {speakerHog, spyHog}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   465
    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "We'll spare your life for now!", SAY_SAY, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
    table.insert(afterChoiceAnim, {func = AnimSay, args = {spyHog, "May the spirits aid you in all your quests!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "I just don't want to sink to your level.", SAY_SAY, 6000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "Let's show those cannibals what we're made of!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
  table.insert(afterChoiceAnim, {func = AnimSay, args = {natives[8], "Let us help, too!", SAY_SAY, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   471
  table.insert(afterChoiceAnim, {func = AnimTurn, args = {speakerHog, "Left", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
  table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, "No. You and the rest of the tribe are safer there!", SAY_SAY, 7000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
  AddSkipFunction(afterChoiceAnim, SkipAfterChoiceAnim, {})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
function SetupHogDeadAnim(gear)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
  hogDeadAnim = {}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
  if nativesNum == 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
    return
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  local hogDeadStrings = {loc("They killed " .. gear .."! You bastards!"), 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
                          loc(gear .. "! Why?!"), 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
                          loc("That was just mean!"), 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
                          loc("Oh no, not " .. gear .. "!"),
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
                          loc("Why " .. gear .. "? Why?"),
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
                          loc("What has " .. gear .. " ever done to you?!")}
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
  table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[7 - nativesNum], SAY_SHOUT, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   489
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
function AfterHogDeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
  freshDead = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
  TurnTimeLeft = TurnTime
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
--------------------------Anim skip functions--------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
function AfterAfterChoiceAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
  stage = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
  AddAmmo(speakerHog, amSwitch, 100)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
  SetGearMessage(speakerHog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
  SetState(speakerHog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
  TurnTimeLeft = -1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
  ShowMission("Backstab", "The food bites back", "Defeat the cannibals", 1, 4000)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
  SpawnCrates()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   508
function SkipAfterChoiceAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
  SetGearMessage(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
  AnimSwitchHog(speakerHog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   511
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   513
function AfterWave2Anim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  SetGearMessage(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
  SetState(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
  SpawnCrates()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  TurnTimeLeft = TurnTime
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
function SkipWave2DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
  TeleportNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
  DeployHog()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
  HideCyborg()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   527
function SpawnPlatformCrates()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   528
  SpawnAmmoCrate(2494, 1262, amMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
  SpawnAmmoCrate(2574, 1279, amSMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   530
  SpawnAmmoCrate(2575, 1267, amMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
  SpawnAmmoCrate(2617, 1259, amSMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   532
  SpawnUtilityCrate(2579, 1254, amMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   533
  SpawnUtilityCrate(2478, 1243, amMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
function AfterWave2DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  TurnsLeft = 13
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   538
  stage = platformStage
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   539
  SpawnPlatformCrates()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   540
  AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   541
  AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
  AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
  TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
  ShowMission("Backstab", "Drills", "You have 12 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)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
function DoTurnsOver()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
  stage = wave3Stage
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   549
  RestoreWave(3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   551
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   552
function SkipWave2Anim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   553
  AnimSwitchHog(speakerHog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   554
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   555
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   556
function SkipStartAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   557
  SetGearPosition(natives[waterNum], nativePos[denseNum][1] + 50, nativePos[denseNum][2])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   558
  RestoreWave(1)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   559
  ReviveNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   560
  SetGearMessage(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
  SetState(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
  if m2Choice == choiceAccepted then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   563
    spyHog = natives[denseNum]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   565
    spyHog = natives[waterNum]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   566
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   567
  SetHealth(spyHog, 26)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   568
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
function AfterStartAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   571
  AnimSwitchHog(natives[leaksNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
  TurnTimeLeft = -1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   573
  stage = spyKillStage
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
  AddEvent(CheckChoice, {}, DoChoice, {}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
  AddEvent(CheckKilledOther, {}, DoKilledOther, {}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
  AddEvent(CheckChoiceRefuse, {}, DoChoiceRefuse, {}, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   577
  ShowMission("Backstab", "Judas", "Kill the traitor...or spare his life!|Kill him or press [Precise]!", 1, 8000)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   578
  ----------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   579
  SetHealth(natives[leaksNum], 1)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
-----------------------------Events------------------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
function CheckTurnsOver()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   584
  return TurnsLeft == 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   585
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   586
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
function CheckDeployedDead()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   588
  return deployedDead
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   590
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   591
function DoDeployedDead()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   592
  ShowMission("Backstab", "Brutus", "You have failed to save the tribe!", 0, 6000)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
  ParseCommand("teamgone " .. loc("Natives"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   594
  ParseCommand("teamgone " .. loc("Tribe"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   595
  TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   596
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   597
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   598
function CheckChoice()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   599
  return choice ~= 0 and tmpVar == 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   600
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   601
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   602
function CheckDeaths()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   603
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
    if natives[i] ~= spyHog and band(GetState(natives[i]), gstAttacked) ~= 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
      return true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   608
  return false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
function DoChoice()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   612
  RemoveEventFunc(CheckChoiceRefuse)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   613
  SetupAfterChoiceAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
  AddAnim(afterChoiceAnim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   615
  AddFunction({func = AfterAfterChoiceAnim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   616
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   617
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   618
function CheckChoiceRefuse()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   619
  return highJumped == true and StoppedGear(CurrentHedgehog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   620
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   621
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   622
function DoChoiceRefuse()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   623
  choice = choiceSpare
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   624
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   625
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   626
function CheckKilledOther()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   627
  if stage ~= spyKillStage then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   628
    return false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   629
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   630
  return (nativesNum < startNativesNum and choice ~= choiceEliminate) or
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
          (nativesNum < startNativesNum - 1 and choice == choiceEliminate)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   633
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   634
function DoKilledOther()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   635
  ShowMission("Backstab", "Brutus", "You have killed an innocent hedgehog!", 0, 6000)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   636
  ParseCommand("teamgone " .. loc("Natives"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   637
  ParseCommand("teamgone " .. loc("Tribe"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
  TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   639
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   640
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   641
function CheckWaveDead(index)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   642
  for i = (index - 1) * 3 + 1, index * 3 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   643
    if cannibalDead[i] ~= true or CurrentHedgehog == cannibals[i] then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
      return false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   646
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   647
  return true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   648
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   649
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
function DoWaveDead(index)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   651
  TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   652
  if index == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   653
    RestoreWave(2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   654
    SetupWave2Anim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   655
    AddAnim(wave2Anim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
    AddFunction({func = AfterWave2Anim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   657
  elseif index == 2 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   658
    SetupWave2DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   659
    AddAnim(wave2DeadAnim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   660
    AddFunction({func = AfterWave2DeadAnim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
  elseif index == 3 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
    HideNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
    SetupWave3DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   664
    AddAnim(wave3DeadAnim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
    AddFunction({func = AfterWave3DeadAnim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   666
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
function HideNatives()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
  for i = 1, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   671
    if nativeDead[i] ~= true and natives[i] ~= deployedHog then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   672
      if nativeHidden[i] ~= true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   673
        HideHog(natives[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   674
        nativeHidden[i] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   675
      end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   676
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   678
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   679
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   680
function SetupWave3DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   681
  table.insert(wave3DeadAnim, {func = AnimTurn, args = {deployedHog, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   682
  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "That ought to show them!", SAY_SAY, 4000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   683
  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "Guys, do you think there's more of them?", SAY_SHOUT, 7000}})
7255
93cf6b3b89be Fixed a visual gear in Mission 5
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   684
  table.insert(wave3DeadAnim, {func = AnimVisualGear, args = {deployedHog, unpack(nativePos[wiseNum]), vgtFeather, 0, true, true}})
7253
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   685
  table.insert(wave3DeadAnim, {func = AnimWait, args = {deployedHog, 1000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   686
  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "Where are they?!", SAY_THINK, 3000}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   687
  table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, RestoreCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   688
  table.insert(wave3DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, 4040, 782}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   689
  table.insert(wave3DeadAnim, {func = AnimSay, args = {cyborg, "These primitive people are so funny!", SAY_THINK, 6500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   690
  table.insert(wave3DeadAnim, {func = AnimMove, args = {cyborg, "Right", 4060, 0}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   691
  table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, HideCyborg, {}}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   692
  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "I need to find the others!", SAY_THINK, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   693
  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, "I have to follow that alien.", SAY_THINK, 4500}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   694
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   695
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   696
function SkipWave3DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   697
  AnimSwitchHog(deployedHog)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   698
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   699
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   700
function AfterWave3DeadAnim()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   701
  if nativeDead[leaksNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   702
    SaveCampaignVar("M5LeaksDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   703
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   704
    SaveCampaignVar("M5LeaksDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   705
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   706
  if nativeDead[denseNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   707
    SaveCampaignVar("M5DenseDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   708
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   709
    SaveCampaignVar("M5DenseDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   710
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   711
  if nativeDead[waterNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   712
    SaveCampaignVar("M5WaterDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   713
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   714
    SaveCampaignVar("M5WaterDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   715
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   716
  if nativeDead[buffaloNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   717
    SaveCampaignVar("M5BuffaloDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   718
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   719
    SaveCampaignVar("M5BuffaloDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   720
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   721
  if nativeDead[princessNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   722
    SaveCampaignVar("M5PrincessDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   723
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   724
    SaveCampaignVar("M5PrincessDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   725
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   726
  if nativeDead[wiseNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   727
    SaveCampaignVar("M5WiseDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   728
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   729
    SaveCampaignVar("M5WiseDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   730
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   731
  if nativeDead[chiefNum] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   732
    SaveCampaignVar("M5ChiefDead", "1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   733
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   734
    SaveCampaignVar("M5ChiefDead", "0")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   735
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   736
  SaveCampaignVar("M5Choice", "" .. choice)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   737
  SaveCampaignVar("Progress", "5")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   738
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   739
  for i = 1, 7 do 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   740
    if natives[i] == deployedHog then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   741
      SaveCampaignVar("M5DeployedNum", "" .. i)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   742
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   743
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   744
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   745
  ParseCommand("teamgone " .. loc("Tribe"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   746
  ParseCommand("teamgone " .. loc("Assault Team"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   747
  ParseCommand("teamgone " .. loc("Reinforcements"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   748
  ParseCommand("teamgone " .. loc("011101001"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   749
  TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   750
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   751
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   752
-----------------------------Misc--------------------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   753
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   754
function SpawnCrates()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   755
  SpawnAmmoCrate(0, 0, amDrill)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   756
  SpawnAmmoCrate(0, 0, amGrenade)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   757
  SpawnAmmoCrate(0, 0, amBazooka)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   758
  SpawnAmmoCrate(0, 0, amDynamite)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   759
  SpawnAmmoCrate(0, 0, amGrenade)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   760
  SpawnAmmoCrate(0, 0, amMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   761
  SpawnAmmoCrate(0, 0, amShotgun)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   762
  SpawnAmmoCrate(0, 0, amFlamethrower)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   763
  SpawnAmmoCrate(0, 0, amMolotov)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   764
  SpawnAmmoCrate(0, 0, amSMine)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   765
  SpawnAmmoCrate(0, 0, amMortar)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   766
  SpawnUtilityCrate(0, 0, amRope)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   767
  SpawnUtilityCrate(0, 0, amRope)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   768
  SpawnUtilityCrate(0, 0, amParachute)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   769
  SpawnUtilityCrate(0, 0, amParachute)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   770
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   771
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   772
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   773
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   774
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   775
  SetHealth(SpawnHealthCrate(0, 0), 25)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   776
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   777
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   778
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   779
function RestoreWave(index)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   780
  for i = (index - 1) * 3 + 1, index * 3 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   781
    if cannibalHidden[i] == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   782
      RestoreHog(cannibals[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   783
      FollowGear(cannibals[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   784
      cannibalHidden[i] = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   785
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   786
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   787
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   788
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   789
function GetVariables()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   790
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   791
  m2Choice = tonumber(GetCampaignVar("M2Choice"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   792
  m4DenseDead = tonumber(GetCampaignVar("M4DenseDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   793
  m4LeaksDead = tonumber(GetCampaignVar("M4LeaksDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   794
  m4ChiefDead = tonumber(GetCampaignVar("M4ChiefDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   795
  m4WaterDead = tonumber(GetCampaignVar("M4WaterDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   796
  m4BuffaloDead = tonumber(GetCampaignVar("M4BuffaloDead"))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   797
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   798
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   799
function HideCyborg()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   800
  if cyborgHidden == false then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   801
    HideHog(cyborg)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   802
    cyborgHidden = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   803
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   804
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   805
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   806
function RestoreCyborg()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   807
  if cyborgHidden == true then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   808
    RestoreHog(cyborg)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   809
    cyborgHidden = false
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   810
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   811
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   812
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   813
function SetupPlace()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   814
  startElimination = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   815
  HideHog(cyborg)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   816
  cyborgHidden = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   817
  for i = 1, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   818
    HideHog(cannibals[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   819
    cannibalHidden[i] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   820
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   821
  if m4LeaksDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   822
    HideHog(natives[leaksNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   823
    nativeHidden[leaksNum] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   824
    needRevival = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   825
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   826
  if m4DenseDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   827
    if m2Choice ~= choiceAccepted then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   828
      DeleteGear(natives[denseNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   829
    else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   830
      HideHog(natives[denseNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   831
      nativeHidden[denseNum] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   832
      needRevival = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   833
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   834
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   835
  if m4WaterDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   836
    HideHog(natives[waterNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   837
    nativeHidden[waterNum] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   838
    needRevival = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   839
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   840
  if m4ChiefDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   841
    DeleteGear(natives[chiefNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   842
    SetGearPosition(natives[princessNum], unpack(nativePos[buffaloNum]))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   843
    nativePos[princessNum] = nativePos[buffaloNum]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   844
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   845
  if m4BuffaloDead == 1 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   846
    DeleteGear(natives[buffaloNum])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   847
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   848
  startElimination = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   849
  PlaceGirder(3568, 1461, 1)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   850
  PlaceGirder(440, 523, 5)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   851
  PlaceGirder(350, 441, 1)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   852
  PlaceGirder(405, 553, 5)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   853
  PlaceGirder(316, 468, 1)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   854
  PlaceGirder(1319, 168, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   855
  startNativesNum = nativesNum
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   856
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   857
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   858
function SetupEvents()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   859
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   860
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   861
function SetupAmmo()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   862
  AddAmmo(natives[princessNum], amSwitch, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   863
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   864
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   865
function AddHogs()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   866
	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   867
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   868
    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   869
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   870
  nativesNum = 7
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   871
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   872
  AddTeam(loc("Tribe"), 29438, "Bone", "Island", "HillBilly", "cm_birdy")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   873
  for i = 8, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   874
    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   875
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   876
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   877
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   878
  AddTeam(loc("Assault Team"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   879
  for i = 1, 6 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   880
    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   881
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   882
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   883
  AddTeam(loc("Reinforcements"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   884
  for i = 7, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   885
    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   886
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   887
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   888
  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   889
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   890
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   891
  for i = 1, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   892
    SetGearPosition(natives[i], unpack(nativePos[i]))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   893
    AnimTurn(natives[i], nativeDir[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   894
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   895
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   896
  SetGearPosition(cyborg, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   897
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   898
  for i = 1, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   899
    SetGearPosition(cannibals[i], unpack(cannibalPos[i]))
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   900
    AnimTurn(cannibals[i], cannibalDir[i])
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   901
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   902
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   903
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   904
function CondNeedToTurn(hog1, hog2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   905
  xl, xd = GetX(hog1), GetX(hog2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   906
  if xl > xd then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   907
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   908
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   909
  elseif xl < xd then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   910
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   911
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   912
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   913
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   914
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   915
-----------------------------Main Functions----------------------------
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   916
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   917
function onGameInit()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   918
	Seed = 2
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   919
	GameFlags = gfSolidLand
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   920
	TurnTime = 60000 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   921
	CaseFreq = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   922
	MinesNum = 6
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   923
	MinesTime = 3000
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   924
	Explosives = 6
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   925
	Delay = 10 
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   926
  Map = "Cave"
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   927
	Theme = "Nature"
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   928
  SuddenDeathTurns = 3000
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   929
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   930
  AddHogs()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   931
  AnimInit()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   932
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   933
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   934
function onGameStart()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   935
  GetVariables()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   936
  SetupAmmo()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   937
  SetupPlace()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   938
  AnimationSetup()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   939
  SetupEvents()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   940
  AddAnim(startAnim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   941
  AddFunction({func = AfterStartAnim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   942
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   943
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   944
function onGameTick()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   945
  AnimUnWait()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   946
  if ShowAnimation() == false then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   947
    return
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   948
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   949
  ExecuteAfterAnimations()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   950
  CheckEvents()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   951
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   952
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   953
function onGearDelete(gear)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   954
  for i = 1, 7 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   955
    if gear == natives[i] then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   956
      nativeDead[i] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   957
      nativesNum = nativesNum - 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   958
      if startElimination == 0 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   959
        freshDead = nativeNames[i]
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   960
      end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   961
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   962
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   963
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   964
  for i = 1, 9 do
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   965
    if gear == cannibals[i] then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   966
      cannibalDead[i] = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   967
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   968
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   969
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   970
  if gear == spyHog and stage == spyKillStage then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   971
    freshDead = nil
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   972
    choice = choiceEliminate
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   973
    tmpVar = 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   974
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   975
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   976
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   977
function onGearAdd(gear)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   978
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   979
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   980
function onAmmoStoreInit()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   981
  SetAmmo(amDEagle, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   982
  SetAmmo(amSniperRifle, 4, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   983
  SetAmmo(amFirePunch, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   984
  SetAmmo(amWhip, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   985
  SetAmmo(amBaseballBat, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   986
  SetAmmo(amHammer, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   987
  SetAmmo(amLandGun, 9, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   988
  SetAmmo(amSnowball, 8, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   989
  SetAmmo(amGirder, 4, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   990
  SetAmmo(amParachute, 4, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   991
  SetAmmo(amSwitch, 8, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   992
  SetAmmo(amSkip, 8, 0, 0, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   993
  SetAmmo(amRope, 5, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   994
  SetAmmo(amBlowTorch, 3, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   995
  SetAmmo(amPickHammer, 0, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   996
  SetAmmo(amLowGravity, 0, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   997
  SetAmmo(amDynamite, 0, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   998
  SetAmmo(amBazooka, 4, 0, 0, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   999
  SetAmmo(amGrenade, 4, 0, 0, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1000
  SetAmmo(amMine, 2, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1001
  SetAmmo(amSMine, 2, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1002
  SetAmmo(amMolotov, 2, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1003
  SetAmmo(amFlamethrower, 2, 0, 0, 3)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1004
  SetAmmo(amShotgun, 4, 0, 0, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1005
  SetAmmo(amTeleport, 0, 0, 0, 2)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1006
  SetAmmo(amDrill, 0, 0, 0, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1007
  SetAmmo(amMortar, 0, 0, 0, 4)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1008
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1009
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1010
j = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1011
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1012
function onNewTurn()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1013
  tmpVar = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1014
  if AnimInProgress() then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1015
    TurnTimeLeft = -1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1016
    return
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1017
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1018
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1019
  if GetHogTeamName(CurrentHedgehog) == loc("Tribe") then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1020
    TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1021
    return
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1022
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1023
  TurnsLeft = TurnsLeft - 1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1024
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1025
  if stage == spyKillStage then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1026
    if CurrentHedgehog == spyHog or GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1027
      TurnTimeLeft = 0
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1028
    else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1029
      SetGearMessage(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1030
      TurnTimeLeft = -1
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1031
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1032
  else
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1033
    if freshDead ~= nil and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1034
      SetupHogDeadAnim(freshDead)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1035
      AddAnim(hogDeadAnim)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1036
      AddFunction({func = AfterHogDeadAnim, args = {}})
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1037
    end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1038
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1039
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1040
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1041
function onGearDamage(gear, damage)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1042
end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1043
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1044
function onPrecise()
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1045
  if GameTime > 2500 then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1046
    SetAnimSkip(true)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1047
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1048
  if stage == spyKillStage then
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1049
    highJumped = true
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1050
  end
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1051
end