share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua
author belphegorr <szabibibi@gmail.com>
Fri, 06 Jul 2012 14:45:55 +0300
changeset 7241 7fda4d886c5e
parent 7225 e3f2280d9000
child 7243 9ae9178c525e
permissions -rw-r--r--
Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
     1
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     2
loadfile(GetDataPath() .. "Scripts/Animate.lua")()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     3
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     4
-----------------------------Constants---------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     5
choiceAccept = 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     6
choiceRefuse = 2
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     7
choiceAttack = 3
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     8
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     9
leaksPos = {2067, 509}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    10
densePos = {1882, 503}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    11
waterPos = {3100, 930}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    12
buffaloPos = {2609, 494}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    13
chiefPos = {2538, 617}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    14
cannibalPos = {{2219, 1339}, {2322, 1357}, {805, 784}, {3876, 1048},
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    15
              {1101, 916}, {2854, 1408}, {1974, 486}, {1103, 961}}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    16
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    17
HogNames = {loc("Olive"), loc("Brain Stu"), loc("Brainila"), loc("Salivaslurper"),
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    18
            loc("Spleenlover"), loc("Tighlicker"), loc("NomNom"), loc("Mindy")}
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    19
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    20
natives = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    21
-----------------------------Variables---------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    22
cannibals = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    23
cannibalDead = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    24
cannibalHidden = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    25
cratesSpawned = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    26
healthCratesSpawned = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    27
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    28
denseDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    29
leaksDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
waterDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
buffaloDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
chiefDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
nativesDead = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
m2Choice = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
m2DenseDead = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
startAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
wave2Anim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
finalAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
--------------------------Anim skip functions--------------------------
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    42
function AfterHogDeadAnim()
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    43
  freshDead = nil
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    44
  TurnTimeLeft = TurnTime
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    45
end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    46
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
function AfterStartAnim()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    48
  local goal = loc("Defeat the cannibals!|")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    49
  local chiefgoal = loc("Try to protect the chief! Unlike your other hogs, he won't return on future missions if he dies.")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
  TurnTimeLeft = TurnTime
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    51
  ShowMission(loc("United We Stand"), loc("Invasion"), goal .. chiefgoal, 1, 6000)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
function SkipStartAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
  SetGearPosition(water, 2467, 754)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
  if cratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
    SpawnCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
  if healthCratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
    SpawnHealthCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
  if cannibalHidden[1] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
    RestoreWave(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
  AnimSwitchHog(leaks)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
function SkipWave2Anim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
  if cratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
    SpawnCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
  if healthCratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
    SpawnHealthCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
  if cannibalHidden[5] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
    RestoreWave(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
  AnimSwitchHog(cannibals[5])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
function AfterWave2Anim()
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    82
  SetGearMessage(CurrentHegdgehog, 0)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    83
  SetState(CurrentHedgehog, 0)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    84
  TurnTimeLeft = TurnTime
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    85
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
function AfterFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
  if chiefDead == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
    SaveCampaignVar("M4ChiefDead", "1")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
    SaveCampaignVar("M4ChiefDead", "0")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
  SaveCampaignVar("Progress", "4")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    94
  ParseCommand("teamgone " .. loc("011101001"))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
  TurnTimeLeft = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
-----------------------------Animations--------------------------------
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    98
function Wave2Reaction()
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    99
  local i = 1
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   100
  local gearr = nil
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   101
  while nativesDead[i] == true do
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   102
    i = i + 1
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   103
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   104
  gearr = natives[i]
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   105
  if denseDead ~= true and band(GetState(dense), gstDrowning) == 0 then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   106
    AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   107
    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"left"}}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   108
    AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   109
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   110
  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   111
end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   113
function EmitDenseClouds(dir)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
  local dif
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
  if dir == "left" then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
    dif = 10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   117
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   118
    dif = -10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   130
function AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
  table.insert(startAnim, {func = AnimWait, args = {leaks, 4000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   132
  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Back in the village, after telling the villagers about the threat..."), 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   133
  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Their buildings were very primitive back then, even for an uncivilised island."), 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   134
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Young one, you are telling us that they can instantly change location without a shaman?"), SAY_SAY, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   135
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("That is, indeed, very weird..."), SAY_SAY, 3500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   136
  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("If they try coming here, they can have a taste of my delicious knuckles!"), SAY_SHOUT, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   137
  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("Haha!"), SAY_SHOUT, 2000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
  if denseDead == false then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   139
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("I'm not sure about that!"), SAY_SAY, 3400}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   140
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   141
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Luckily, I've managed to snatch some of them."), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
    table.insert(startAnim, {func = AnimCustomFunction, args = {dense, SpawnCrates, {1}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   143
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Oops...I dropped them."), SAY_SAY, 3000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
  else
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   145
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'm not sure about that!"), SAY_SAY, 3400}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   146
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
    table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   148
    table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   149
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They keep appearing like this. It's weird!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
  end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   151
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Did anyone follow you?"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   152
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("No, we made sure of that!"), SAY_SAY, 3500}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
  table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
  table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   155
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("First aid kits?!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   156
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
  table.insert(startAnim, {func = AnimMove, args = {water, "left", 3000, 0}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
  table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  table.insert(startAnim, {func = AnimMove, args = {water, "left", 2655, 0}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
  table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
  table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
  table.insert(startAnim, {func = AnimMove, args = {water, "left", 2467, 754}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   165
  table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  table.insert(startAnim, {func = AnimTurn, args = {chief, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   167
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("..."), SAY_THINK, 1500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   168
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Where have you been?"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   169
  table.insert(startAnim, {func = AnimSay, args = {water, loc("Just on a walk."), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   170
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("You have chosen the perfect moment to leave."), SAY_SAY, 6000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
  table.insert(startAnim, {func = AnimCustomFunction, args = {chief, RestoreWave, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
  for i = 1, 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
    table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
  table.insert(startAnim, {func = AnimWait, args = {chief, 1500}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   176
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("HOW DO THEY KNOW WHERE WE ARE???"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   177
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("We have to protect the village!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
  table.insert(startAnim, {func = AnimSwitchHog, args = {leaks}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
  AddSkipFunction(startAnim, SkipStartAnim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, RestoreWave, {2}}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
  for i = 5, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
    table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
  end
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   185
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, Wave2Reaction, {}}, swh = false})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {2}}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   188
  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   191
function SetupHogDeadAnim(gear)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   192
  hogDeadAnim = {}
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   193
  if nativesNum == 0 then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   194
    return
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   195
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   196
  local hogDeadStrings = {"They killed " .. gear .."! You bastards!", 
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   197
                          gear .. "! Why?!", 
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   198
                          "That was just mean!", 
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   199
                          "Oh no, not " .. gear .. "!"}
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   200
  table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[nativesNum], SAY_SHOUT, 4000}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   201
end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   202
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
function SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
  local found = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
  local hogs = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
  local i = 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
  if nativesNum >= 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
    while found < 2 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   209
      if  nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   210
        found = found + 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   211
        hogs[found] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   212
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
      i = i + 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   214
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
    if chiefDead ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
      hogs[2] = chief
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   217
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
    table.insert(finalAnim, {func = AnimCustomFunction, args = {hogs[1], CondNeedToTurn, {hogs[1], hogs[2]}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   219
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We can't hold them up much longer!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   220
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We need to move!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   221
    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("But where can we go?"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   222
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("To the caves..."), SAY_SAY, 2500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   223
    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("Good idea, they'll never find us there!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
    for i = 1, 5 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
      if nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
        hogs[1] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
    end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   230
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("I need to move the tribe!"), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   231
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("The caves are well hidden, they won't find us there!"), SAY_THINK, 7000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   233
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
-----------------------------Misc--------------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
function RestoreWave(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
    RestoreHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
    cannibalHidden[i] = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   239
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   240
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   241
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   242
function GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   243
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
  if m2DenseDead == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
    denseDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
  m2Choice = tonumber(GetCampaignVar("M2Choice"))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   250
function SetupPlace()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   251
  if m2DenseDead == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
    DeleteGear(dense)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
  for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
    HideHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
    cannibalHidden[i] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
  HideHog(cyborg)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
function SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
function SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
  AddAmmo(cannibals[1], amGrenade, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
  AddAmmo(cannibals[1], amBazooka, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
  AddAmmo(cannibals[1], amShotgun, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
  AddAmmo(cannibals[1], amMine, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
  AddAmmo(cannibals[2], amGrenade, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
  AddAmmo(cannibals[2], amBazooka, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
  AddAmmo(cannibals[2], amShotgun, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  AddAmmo(cannibals[2], amMine, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
  AddAmmo(cannibals[2], amMolotov, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
  AddAmmo(cannibals[2], amFlamethrower, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
function AddHogs()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   280
	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   281
	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   282
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   283
  water = AddHog(loc("Fiery Water"), 0, 100, "pirate_jack")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   284
  buffalo = AddHog(loc("Raging Buffalo"), 0, 100, "zoo_Bunny")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   285
  chief = AddHog(loc("Righteous Beard"), 0, 100, "IndianChief")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
  natives = {leaks, dense, water, buffalo, chief}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
  nativesNum = 5
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   289
  AddTeam(loc("Light Cannfantry"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
  for i = 1, 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
    cannibals[i] = AddHog(HogNames[i], 3, 70, "Zombi")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   294
  AddTeam(loc("Heavy Cannfantry"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
  for i = 5, 8 do
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   296
    cannibals[i] = AddHog(HogNames[i], 2, 70, "vampirichog")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   299
  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   300
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
  SetGearPosition(leaks,   unpack(leaksPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
  SetGearPosition(dense,   unpack(densePos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
  SetGearPosition(water,   unpack(waterPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
  HogTurnLeft(water, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
  SetGearPosition(buffalo, unpack(buffaloPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
  HogTurnLeft(buffalo, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
  SetGearPosition(chief,   unpack(chiefPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
  HogTurnLeft(chief, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
  SetGearPosition(cyborg, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
  for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
    SetGearPosition(cannibals[i], unpack(cannibalPos[i]))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
function CondNeedToTurn(hog1, hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
  xl, xd = GetX(hog1), GetX(hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
  if xl > xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   320
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
  elseif xl < xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
function SpawnHealthCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   328
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   331
  healthCratesSpawned[index] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
function SpawnCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
  if index == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
    SpawnAmmoCrate(1943, 408, amBazooka)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   337
    SpawnAmmoCrate(1981, 464, amGrenade)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
    SpawnAmmoCrate(1957, 459, amShotgun)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
    SpawnAmmoCrate(1902, 450, amDynamite)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
    SpawnUtilityCrate(1982, 405, amPickHammer)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
    SpawnUtilityCrate(2028, 455, amRope)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   342
    SpawnUtilityCrate(2025, 464, amTeleport)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   344
    SpawnUtilityCrate(1982, 405, amBlowTorch)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   345
    SpawnAmmoCrate(2171, 428, amMolotov)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   346
    SpawnAmmoCrate(2364, 346, amFlamethrower)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
    SpawnAmmoCrate(2521, 303, amBazooka)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   348
    SpawnAmmoCrate(2223, 967, amGrenade)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
    SpawnAmmoCrate(1437, 371, amShotgun)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
 end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   351
  cratesSpawned[index] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   352
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   353
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   354
-----------------------------Events------------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
function CheckWaveDead(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
    if cannibalDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
      return false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
  return true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
function DoWaveDead(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
  if index == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
    AddAnim(wave2Anim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
    AddFunction({func = AfterWave2Anim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
  elseif index == 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
    SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
    AddAnim(finalAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
    AddFunction({func = AfterFinalAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
-----------------------------Main Functions----------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
function onGameInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
	Seed = 0 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
	GameFlags = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
	TurnTime = 60000 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
	CaseFreq = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
	MinesNum = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
	MinesTime = 3000
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
	Explosives = 2
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   387
	Delay = 10 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
  Map = "Hogville"
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
	Theme = "Nature"
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
  SuddenDeathTurns = 3000
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
  AddHogs()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
  AnimInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
function onGameStart()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
  GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
  SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
  SetupPlace()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
  AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
  AddAnim(startAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  AddFunction({func = AfterStartAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
function onGameTick()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  AnimUnWait()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  if ShowAnimation() == false then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
    return
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
  ExecuteAfterAnimations()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  CheckEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
function onGearDelete(gear)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
  if gear == dense then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
    denseDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
    nativesDead[2] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   420
    freshDead = loc("Dense Cloud")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  elseif gear == leaks then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
    leaksDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
    nativesDead[1] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   425
    freshDead = loc("Leaks A Lot")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
  elseif gear == chief then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
    chiefDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   428
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
    nativesDead[5] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   430
    freshDead = loc("Righteous Beard")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
  elseif gear == water then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
    waterDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
    nativesDead[3] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   435
    freshDead = loc("Fiery Water")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
  elseif gear == buffalo then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
    buffaloDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   438
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   439
    nativesDead[4] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   440
    freshDead = loc("Raging Buffalo")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   441
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   442
    for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   443
      if gear == cannibals[i] then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   444
        cannibalDead[i] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   445
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   447
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   449
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
function onGearAdd(gear)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
function onAmmoStoreInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   454
  SetAmmo(amDEagle, 9, 0, 0, 0)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   455
  SetAmmo(amSniperRifle, 4, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
  SetAmmo(amFirePunch, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
  SetAmmo(amWhip, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
  SetAmmo(amBaseballBat, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
  SetAmmo(amHammer, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
  SetAmmo(amLandGun, 9, 0, 0, 0)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   461
  SetAmmo(amSnowball, 8, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
  SetAmmo(amGirder, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
  SetAmmo(amParachute, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   464
  SetAmmo(amSwitch, 8, 0, 0, 2)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   465
  SetAmmo(amSkip, 8, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
  SetAmmo(amRope, 5, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
  SetAmmo(amBlowTorch, 3, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
  SetAmmo(amPickHammer, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
  SetAmmo(amLowGravity, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
  SetAmmo(amDynamite, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   471
  SetAmmo(amBazooka, 0, 0, 0, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
  SetAmmo(amGrenade, 0, 0, 0, 5)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
  SetAmmo(amMine, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
  SetAmmo(amMolotov, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
  SetAmmo(amFlamethrower, 0, 0, 0, 3)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   476
  SetAmmo(amShotgun, 0, 0, 0, 3)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   477
  SetAmmo(amTeleport, 0, 0, 0, 2)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   478
  SetAmmo(amFlamethrower, 0, 0, 0, 3)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
function onNewTurn()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
  if AnimInProgress() then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
    TurnTimeLeft = -1
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   484
    return
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   485
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   486
  if freshDead ~= nil and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   487
    SetupHogDeadAnim(freshDead)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   488
    AddAnim(hogDeadAnim)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   489
    AddFunction({func = AfterHogDeadAnim, args = {}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
function onGearDamage(gear, damage)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
function onPrecise()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
  if GameTime > 2500 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
    SetAnimSkip(true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501