share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua
author belphegorr <szabibibi@gmail.com>
Tue, 10 Jul 2012 23:06:56 +0300
changeset 7251 cba4960b426f
parent 7249 79b399c04410
child 7253 86814ed9feab
permissions -rw-r--r--
Fixed a bug where certain ammo types were added to the wrong 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
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
    28
sdrmv = 0
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    29
denseDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
leaksDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
waterDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
buffaloDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
chiefDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
nativesDead = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
m2Choice = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
m2DenseDead = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
startAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
wave2Anim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
finalAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
--------------------------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
    43
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
    44
  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
    45
  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
    46
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
    47
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
function AfterStartAnim()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    49
  local goal = loc("Defeat the cannibals!|")
7247
9aba0c6458af Changed a ShowMission in Mission 4
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
    50
  local chiefgoal = loc("Try to protect the chief! You won't lose if he dies, but it is advised that he survives.")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
  TurnTimeLeft = TurnTime
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    52
  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
    53
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
function SkipStartAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
  SetGearPosition(water, 2467, 754)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
  if cratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
    SpawnCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
  if healthCratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
    SpawnHealthCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
  if cannibalHidden[1] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
    RestoreWave(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
  AnimSwitchHog(leaks)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
function SkipWave2Anim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
  if cratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
    SpawnCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
  if healthCratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
    SpawnHealthCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
  if cannibalHidden[5] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
    RestoreWave(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
  AnimSwitchHog(cannibals[5])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
function AfterWave2Anim()
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
    83
  TurnTimeLeft = 0
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    84
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    85
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
function AfterFinalAnim()
7251
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
    87
  if leaksDead == true then
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
    88
    SaveCampaignVar("M4LeaksDead", "1")
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
    89
  else
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
    90
    SaveCampaignVar("M4LeaksDead", "0")
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
    91
  end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
  if chiefDead == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
    SaveCampaignVar("M4ChiefDead", "1")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
    SaveCampaignVar("M4ChiefDead", "0")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
  end
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
    97
  if buffaloDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
    98
    SaveCampaignVar("M4BuffaloDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
    99
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   100
    SaveCampaignVar("M4BuffaloDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   101
  end
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   102
  if waterDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   103
    SaveCampaignVar("M4WaterDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   104
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   105
    SaveCampaignVar("M4WaterDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   106
  end
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   107
  if denseDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   108
    SaveCampaignVar("M4DenseDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   109
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   110
    SaveCampaignVar("M4DenseDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   111
  end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
  SaveCampaignVar("Progress", "4")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   113
  ParseCommand("teamgone " .. loc("011101001"))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
  TurnTimeLeft = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
-----------------------------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
   117
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
   118
  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
   119
  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
   120
  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
   121
    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
   122
  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
   123
  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
   124
  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
   125
    AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   126
    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
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
   127
    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
   128
  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
   129
  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
   130
end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
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
   132
function EmitDenseClouds(dir)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
  local dif
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   134
  if dir == "Left" then
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
    dif = 10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   136
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
    dif = -10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   139
  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
   140
  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
   141
  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
   142
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
  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
   144
  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
   145
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
  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
   147
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   148
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
function AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
  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
   151
  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
   152
  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
   153
  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
   154
  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
   155
  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
   156
  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
   157
  if denseDead == false then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   158
    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
   159
    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
   160
    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
   161
    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
   162
    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
   163
  else
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   164
    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
   165
    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
   166
    table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
    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
   168
    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
   169
  end
7225
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("Did anyone follow you?"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   171
  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
   172
  table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
  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
   174
  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
   175
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   176
  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 3000, 0}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
  table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   178
  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2655, 0}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
  table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
  table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   183
  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
   184
  table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   185
  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
   186
  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
   187
  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
   188
  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
   189
  table.insert(startAnim, {func = AnimCustomFunction, args = {chief, RestoreWave, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
  for i = 1, 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
    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
   192
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
  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
   194
  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
   195
  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
   196
  table.insert(startAnim, {func = AnimSwitchHog, args = {leaks}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  AddSkipFunction(startAnim, SkipStartAnim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  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
   200
  for i = 5, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
    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
   202
  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
   203
  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
   204
  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
   205
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   206
  table.insert(wave2Anim, {func = AnimSwitchHog, args = {cannibals[5]}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   209
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
   210
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
   211
  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
   212
  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
   213
    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
   214
  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
   215
  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
   216
                          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
   217
                          "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
   218
                          "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
   219
  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
   220
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
   221
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
function SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
  local found = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
  local hogs = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
  local i = 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  if nativesNum >= 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
    while found < 2 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
      if  nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
        found = found + 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
        hogs[found] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
      i = i + 1
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
    if chiefDead ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
      hogs[2] = chief
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
    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
   238
    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
   239
    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
   240
    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
   241
    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
   242
    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
   243
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
    for i = 1, 5 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
      if nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
        hogs[1] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
    end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   249
    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
   250
    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
   251
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
-----------------------------Misc--------------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
function RestoreWave(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
    RestoreHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
    cannibalHidden[i] = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
  end
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 GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
  if m2DenseDead == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
    denseDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  m2Choice = tonumber(GetCampaignVar("M2Choice"))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
function SetupPlace()
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   270
  if m2DenseDead == 1 then
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   271
    sdrmv = 1
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
    DeleteGear(dense)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
    HideHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
    cannibalHidden[i] = true
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
  HideHog(cyborg)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
function SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
function SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
  AddAmmo(cannibals[1], amGrenade, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
  AddAmmo(cannibals[1], amBazooka, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
  AddAmmo(cannibals[1], amShotgun, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
  AddAmmo(cannibals[1], amMine, 2)
7251
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   291
  AddAmmo(cannibals[5], amGrenade, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   292
  AddAmmo(cannibals[5], amBazooka, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   293
  AddAmmo(cannibals[5], amShotgun, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   294
  AddAmmo(cannibals[5], amMine, 2)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   295
  AddAmmo(cannibals[5], amMolotov, 2)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   296
  AddAmmo(cannibals[5], amFlamethrower, 3)
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
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
function AddHogs()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   300
	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
   301
	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
   302
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   303
  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
   304
  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
   305
  chief = AddHog(loc("Righteous Beard"), 0, 100, "IndianChief")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
  natives = {leaks, dense, water, buffalo, chief}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
  nativesNum = 5
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   309
  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
   310
  for i = 1, 4 do
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   311
    cannibals[i] = AddHog(HogNames[i], 2, 40, "Zombi")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   314
  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
   315
  for i = 5, 8 do
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   316
    cannibals[i] = AddHog(HogNames[i], 2, 55, "vampirichog")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   319
  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
   320
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
  SetGearPosition(leaks,   unpack(leaksPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
  SetGearPosition(dense,   unpack(densePos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
  SetGearPosition(water,   unpack(waterPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
  HogTurnLeft(water, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
  SetGearPosition(buffalo, unpack(buffaloPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
  HogTurnLeft(buffalo, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   328
  SetGearPosition(chief,   unpack(chiefPos))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
  HogTurnLeft(chief, true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
  SetGearPosition(cyborg, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   331
  for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
    SetGearPosition(cannibals[i], unpack(cannibalPos[i]))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
function CondNeedToTurn(hog1, hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   337
  xl, xd = GetX(hog1), GetX(hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
  if xl > xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
  elseif xl < xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   342
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   344
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   345
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   346
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
function SpawnHealthCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   348
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   351
  healthCratesSpawned[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
function SpawnCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
  if index == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
    SpawnAmmoCrate(1943, 408, amBazooka)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
    SpawnAmmoCrate(1981, 464, amGrenade)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
    SpawnAmmoCrate(1957, 459, amShotgun)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
    SpawnAmmoCrate(1902, 450, amDynamite)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
    SpawnUtilityCrate(1982, 405, amPickHammer)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
    SpawnUtilityCrate(2028, 455, amRope)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
    SpawnUtilityCrate(2025, 464, amTeleport)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
    SpawnUtilityCrate(1982, 405, amBlowTorch)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
    SpawnAmmoCrate(2171, 428, amMolotov)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
    SpawnAmmoCrate(2364, 346, amFlamethrower)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
    SpawnAmmoCrate(2521, 303, amBazooka)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
    SpawnAmmoCrate(2223, 967, amGrenade)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
    SpawnAmmoCrate(1437, 371, amShotgun)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
 end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
  cratesSpawned[index] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
-----------------------------Events------------------------------------
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
function CheckWaveDead(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
    if cannibalDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
      return false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
  return true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
function DoWaveDead(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
  if index == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   387
    AddAnim(wave2Anim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
    AddFunction({func = AfterWave2Anim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
  elseif index == 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
    SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
    AddAnim(finalAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
    AddFunction({func = AfterFinalAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
  end
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
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
-----------------------------Main Functions----------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
function onGameInit()
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   400
	Seed = 1
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
	GameFlags = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
	TurnTime = 60000 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
	CaseFreq = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
	MinesNum = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
	MinesTime = 3000
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
	Explosives = 2
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
	Delay = 10 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  Map = "Hogville"
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
	Theme = "Nature"
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
  SuddenDeathTurns = 3000
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  AddHogs()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  AnimInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
function onGameStart()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
  GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
  SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
  SetupPlace()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
  AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
  AddAnim(startAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
  AddFunction({func = AfterStartAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
function onGameTick()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
  AnimUnWait()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   428
  if ShowAnimation() == false then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
    return
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
  ExecuteAfterAnimations()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
  CheckEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
function onGearDelete(gear)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
  if gear == dense then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
    denseDead = 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[2] = true
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   440
    if sdrmv == 1 then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   441
      freshDead = nil
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   442
    else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   443
      freshDead = loc("Dense Cloud")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   444
    end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   445
  elseif gear == leaks then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
    leaksDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   447
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
    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
   449
    freshDead = loc("Leaks A Lot")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
  elseif gear == chief then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
    chiefDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
    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
   454
    freshDead = loc("Righteous Beard")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
  elseif gear == water then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
    waterDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
    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
   459
    freshDead = loc("Fiery Water")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
  elseif gear == buffalo then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
    buffaloDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
    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
   464
    freshDead = loc("Raging Buffalo")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   465
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
    for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
      if gear == cannibals[i] then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
        cannibalDead[i] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   471
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
function onGearAdd(gear)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
function onAmmoStoreInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
  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
   479
  SetAmmo(amSniperRifle, 4, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  SetAmmo(amFirePunch, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  SetAmmo(amWhip, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
  SetAmmo(amBaseballBat, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
  SetAmmo(amHammer, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
  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
   485
  SetAmmo(amSnowball, 8, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  SetAmmo(amGirder, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
  SetAmmo(amParachute, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
  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
   489
  SetAmmo(amSkip, 8, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
  SetAmmo(amRope, 5, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
  SetAmmo(amBlowTorch, 3, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
  SetAmmo(amPickHammer, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  SetAmmo(amLowGravity, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
  SetAmmo(amDynamite, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
  SetAmmo(amBazooka, 0, 0, 0, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  SetAmmo(amGrenade, 0, 0, 0, 5)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
  SetAmmo(amMine, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
  SetAmmo(amMolotov, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
  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
   500
  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
   501
  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
   502
  SetAmmo(amFlamethrower, 0, 0, 0, 3)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
function onNewTurn()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  if AnimInProgress() then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
    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
   508
    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
   509
  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
   510
  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
   511
    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
   512
    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
   513
    AddFunction({func = AfterHogDeadAnim, args = {}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
function onGearDamage(gear, damage)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
function onPrecise()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
  if GameTime > 2500 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
    SetAnimSkip(true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525