share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/enemy.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 21 Dec 2018 01:04:24 +0100
changeset 14485 f37910a73c19
parent 14401 6c21bd8547dd
child 14486 f8c2b995c009
permissions -rw-r--r--
Refactor ACF missions, store team names in variables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12794
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     1
--[[
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     2
A Classic Fairytale: The enemy of my enemy
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     3
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     4
= SUMMARY =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     5
Simple deathmatch on the Islands map.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     6
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     7
= GOAL =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     8
Wipe out the Hedge-cogs and Leader teams
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
     9
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    10
= FLOW CHART =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    11
- Cut scene: startAnim
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
    12
- Player starts with 3-4 natives and 4 cannibals
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
    13
- Player plays with 4 natives if m5DeployedNum ~= leaksNum and m8DeployedLeader == 0
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
    14
- Enemy starts with 5 cyborgs
12794
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    15
- TBS
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    16
- Goal completed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    17
- Cut scene: finalAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    18
> Victory
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    19
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    20
]]
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12364
diff changeset
    21
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7530
diff changeset
    22
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7530
diff changeset
    23
HedgewarsScriptLoad("/Scripts/Animate.lua")
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    24
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    25
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    26
--------------------------------------------Constants------------------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    27
choiceAccepted = 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    28
choiceRefused = 2
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    29
choiceAttacked = 3
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
choiceEliminate = 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
choiceSpare = 2
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
leaksNum = 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
denseNum = 2
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
waterNum = 3
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
buffaloNum = 4
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
chiefNum = 5
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
girlNum = 6
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
wiseNum = 7
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
ramonNum = 8
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
spikyNum = 9
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    43
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
denseScene = 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    45
princessScene = 2
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
waterScene = 3
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
cyborgScene = 4
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
              }
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
              "tiara", "AkuAku", "rasta", "hair_yellow"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
nativePos = {{1259, 120}, {2378, 796}, {424, 1299}, {3322, 260}, {1022, 1550}}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
nativeDir = {"Right", "Left", "Right", "Left", "Right"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
cannibalNames = {loc("Honest Lee"), loc("Vegan Jack"), loc("Sirius Lee"),
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
                 loc("Brutal Lily")}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
cannibalPos = {{162, 266}, {2159, 1517}, {3311, 1621}, {1180, 1560}}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
cannibalDir = {"Right", "Left", "Left", "Right"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
cannibalsNum = 4
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
playersDir = {"Right", "Left", "Right", "Left", "Right", "Right", "Left", "Left", "Right"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
playersAntiDir = {"Left", "Right", "Left", "Right", "Left", "Left", "Right", "Right", "Left"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
cyborgNames = {loc("Smith 0.97"), loc("Smith 0.98"), loc("Smith 0.99a"),
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
               loc("Smith 0.99b"), loc("Smith 0.99f"), loc("Smith 1.0")}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
cyborgPos = {{2162, 20}, {2458, 564}, {542, 1133}, {3334, 1427}}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
cyborgDir = "Right"
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
cyborgsNum = 6
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
cyborgsPos = {{1490, 330}, {1737, 1005}, {2972, 922}, {1341, 1571},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
              {751, 543}, {3889, 907}}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
cyborgsDir = {"Right", "Right", "Left", "Right", "Right", "Left"}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
leaderPos = {3474, 151}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
leaderDir = "Left"
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    81
cyborgTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    82
nativesTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    83
cannibalsTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    84
hedgecogsTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    85
leaderTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
    86
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
-----------------------------Variables---------------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
natives = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
origNatives = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
cyborgs = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
cyborg = nil
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
cannibals = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
players = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
leader = nil
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    98
gearDead = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    99
hedgeHidden = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   100
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   101
startAnim = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
finalAnim = {}
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
-----------------------------Animations--------------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   104
function CondNeedToTurn(hog1, hog2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   105
  xl, xd = GetX(hog1), GetX(hog2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   106
  if xl > xd then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   107
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   109
  elseif xl < xd then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   110
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   111
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
function CondNeedToTurn2(hog1, hog2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
  xl, xd = GetX(hog1), GetX(hog2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   117
  if xl > xd then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   118
    AnimTurn(hog1, "Left")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
    AnimTurn(hog2, "Right")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
  elseif xl < xd then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
    AnimTurn(hog2, "Left")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
    AnimTurn(hog1, "Right")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
function EmitDenseClouds(dir)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
  local dif
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
  if dir == "Left" then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
    dif = 10
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   130
  else
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
    dif = -10
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   132
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
  if dir == nil then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   134
    dx, dy = GetGearVelocity(dense)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
    if dx < 0 then 
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   136
      dif = 10
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
    else 
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
      dif = -10
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   139
    end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   140
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   148
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   151
function RestoreNatives(cgi)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   152
  for i = 1, playersNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
    RestoreHedge(players[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
    AnimOutOfNowhere(players[i], GetGearPosition(players[i]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   155
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
function AnimationSetup()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  SetupCyborgStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
  SetupPeopleStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
  SetupEnemyStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
  AddSkipFunction(startAnim, SkipStartAnim, {})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
function SetupCyborgStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 3000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   168
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   169
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[2])}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[3])}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 1800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[4])}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Everything looks OK..."), SAY_THINK, 2500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("This will be fun!"), SAY_THINK, 2500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   185
  table.insert(startAnim, {func = AnimJump, args = {cyborg, "high"}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
  table.insert(startAnim, {func = AnimCustomFunction, args = {cyborg, RestoreNatives, {true}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("HAHA!"), SAY_SHOUT, 2000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   188
  table.insert(startAnim, {func = AnimSwitchHog, args = {players[1]}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
  table.insert(startAnim, {func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
  table.insert(startAnim, {func = HideHedge, swh = false, args = {cyborg}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   192
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
function SetupPeopleStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   194
  for i = 1, playersNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   195
    table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersAntiDir[i]}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   196
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  table.insert(startAnim, {func = AnimWait, args = {players[1], 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
  for i = 1, playersNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
    table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersDir[i]}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   200
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
  table.insert(startAnim, {func = AnimWait, args = {players[1], 800}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   202
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("What is this place?"), SAY_SHOUT, 2500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
  if m5LeaksDead == 1 then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
    table.insert(startAnim, {func = AnimSay, args = {players[1], loc("And how am I alive?!"), SAY_SAY, 3000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
  end
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   206
  local playerTalker
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   207
  -- There are 3 or 4 natives in this mission. The last one takes part in the dialog
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   208
  if nativesNum >= 4 then
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   209
     playerTalker = players[4]
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   210
  else
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   211
     playerTalker = players[3]
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   212
  end
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], players[2]}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   214
  table.insert(startAnim, {func = AnimSay, args = {players[2], loc("It must be the cyborgs again!"), SAY_SAY, 4000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
  table.insert(startAnim, {func = AnimSay, args = {players[3], loc("Looks like the whole world is falling apart!"), SAY_SAY, 6000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Look out! We're surrounded by cannibals!"), SAY_SHOUT, 6000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   217
  table.insert(startAnim, {func = AnimCustomFunction, args = {playerTalker, CondNeedToTurn, {playerTalker, cannibals[1]}}})
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   218
  table.insert(startAnim, {func = AnimCustomFunction, args = {playerTalker, CondNeedToTurn, {players[1], cannibals[1]}}})
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   219
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Cannibals?! You're the cannibals!"), SAY_SHOUT, 4000}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   220
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("WHAT?! You're the ones attacking us!"), SAY_SHOUT, 5000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   221
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("You have kidnapped our whole tribe!"), SAY_SHOUT, 4000}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("You've been assaulting us, we have been just defending ourselves!"), SAY_SHOUT, 8000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("I can't believe this!"), SAY_SHOUT, 3000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Have we ever attacked you first?"), SAY_SHOUT, 5000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   225
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Yes!"), SAY_SHOUT, 2000}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("When?"), SAY_SHOUT, 2000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   227
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Uhmm...ok no."), SAY_SHOUT, 2000}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("But you're cannibals. It's what you do."), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Again with the 'cannibals' thing!"), SAY_SHOUT, 4000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Where do you get that?!"), SAY_SHOUT, 3000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   231
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Everyone knows this."), SAY_SHOUT, 2500}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("I didn't until about a month ago."), SAY_SHOUT, 4000}})
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   233
  table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Hmmm...actually...I didn't either."), SAY_SHOUT, 4000}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("About a month ago, a cyborg came and told us that you're the cannibals!"), SAY_SHOUT, 8000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("A cy-what?"), SAY_SHOUT, 2000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Cyborg. It's what the aliens call themselves."), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They told us to wear these clothes. They said that this is the newest trend."), SAY_SHOUT, 8000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("They've been manipulating us all this time!"), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   239
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They must be trying to weaken us!"), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   240
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have to unite and defeat those cylergs!"), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   241
  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("We can't let them take over our little island!"), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   242
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   243
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
function RestoreCyborgs(cgi)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
  if cyborgsRestored == true then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
    return
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
  for i = 1, cyborgsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
    RestoreHedge(cyborgs[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   250
    if cgi == true then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   251
      AnimOutOfNowhere(cyborgs[i], unpack(cyborgsPos[i]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
    end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
  RestoreHedge(leader)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
  AnimOutOfNowhere(leader, unpack(leaderPos))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
  cyborgsRestored = true
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
function SetupEnemyStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
  local gear
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
  table.insert(startAnim, {func = AnimCustomFunction, args = {cannibals[1], RestoreCyborgs, {true}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
  if m8EnemyFled == 1 then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
    gear = leader
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
  else
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
    gear = cyborgs[2]
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  end
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   267
  local turnPlayer
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   268
  if nativesNum >= 4 then
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   269
    turnPlayer = players[4]
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   270
  else
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   271
    turnPlayer = players[3]
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   272
  end
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   273
  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {turnPlayer, gear}}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], gear}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("You have finally figured it out!"), SAY_SHOUT, 4500}})
7527
35d154745d7a All missions: switched blood needers with meatbags in dialogues
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   276
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("You meatbags are pretty slow, you know!"), SAY_SHOUT, 5500}})
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("Why do you want to take over our island?"), SAY_SHOUT, 5500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("Do you have any idea how valuable grass is?"), SAY_SHOUT, 5500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("This island is the only place left on Earth with grass on it!"), SAY_SHOUT, 7000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("It's worth more than wood!"), SAY_SHOUT, 4000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("That makes it almost invaluable!"), SAY_SHOUT, 4500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have nowhere else to live!"), SAY_SHOUT, 4500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
  table.insert(startAnim, {func = AnimSay, args = {gear, loc("That's not our problem!"), SAY_SHOUT, 4500}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We'll give you a problem then!"), SAY_SHOUT, 5000}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
  table.insert(startAnim, {func = AnimSwitchHog, args = {gear}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
function SetupFinalAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
  finalAnim = {
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
    {func = AnimGearWait, args = {cyborg, 1000}},
7530
0ba32e5412ce Final checkpoint w/ campaign.
nemo
parents: 7527
diff changeset
   291
    {func = AnimSay, args = {cyborg, loc("Nicely done, meatbags!"), SAY_SAY, 3000}},
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
    {func = AnimSay, args = {cyborg, loc("You have won the game by proving true cooperative skills!"), SAY_SAY, 7000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
    {func = AnimSay, args = {cyborg, loc("You have proven yourselves worthy!"), SAY_SAY, 4000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
    {func = AnimSay, args = {players[1], loc("Game? Was this a game to you?!"), SAY_SAY, 4000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
    {func = AnimSay, args = {cyborg, loc("Well, yes. This was a cyborg television show."), SAY_SAY, 5500}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   296
    {func = AnimSay, args = {cyborg, loc("It is called 'Hogs of Steel'."), SAY_SAY, 4000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
    {func = AnimSay, args = {players[1], loc("Are you saying that many of us have died for your entertainment?"), SAY_SAY, 8000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
    {func = AnimSay, args = {players[1], loc("Our tribe, our beautiful island!"), SAY_SAY, 4000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
    {func = AnimSay, args = {players[1], loc("All gone...everything!"), SAY_SAY, 3000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   300
    {func = AnimSay, args = {cyborg, loc("But the ones alive are stronger in their heart!"), SAY_SAY, 6000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
    {func = AnimSay, args = {cyborg, loc("Just kidding, none of you have died!"), SAY_SAY, 5000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
    {func = AnimSay, args = {cyborg, loc("I mean, none of you ceased to live."), SAY_SAY, 5000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
    {func = AnimSay, args = {cyborg, loc("You'll see what I mean!"), SAY_SAY, 4000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
    {func = AnimSay, args = {cyborg, loc("They are all waiting back in the village, haha."), SAY_SAY, 7000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
    {func = AnimSay, args = {players[1], loc("You are playing with our lives here!"), SAY_SAY, 6000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
    {func = AnimSay, args = {players[1], loc("Do you think you're some kind of god?"), SAY_SAY, 6000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
    {func = AnimSay, args = {cyborg, loc("Interesting idea, haha!"), SAY_SAY, 2000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
    {func = AnimSwitchHog, args = {players[1]}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
    {func = AnimWait, args = {players[1], 1}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
    {func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
    {func = HideHedge, swh = false, args = {cyborg}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
    {func = AnimSay, args = {players[1], loc("What a douche!"), SAY_SAY, 2000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
  }
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
--------------------------Anim skip functions--------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
function SkipStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
  RestoreNatives()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
  RestoreCyborgs()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
  SetGearMessage(CurrentHedgehog, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   320
  AnimSwitchHog(cyborgs[1])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
  AnimWait(cyborg, 1)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
  AddFunction({func = HideHedge, args = {cyborg}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
function AfterStartAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
  ShowMission(loc("The Enemy Of My Enemy"), loc("The Union"), loc("Defeat the cyborgs!"), 1, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
  PutWeaponCrates()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   328
  PutHealthCrates()
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   329
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   331
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
function PutHealthCrates()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
  for i = 1, 10 do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
    SpawnHealthCrate(0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   337
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
function PutWeaponCrates()
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   339
  SpawnSupplyCrate(2399, 622, amNapalm, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   340
  SpawnSupplyCrate(2199, -18, amBee, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   341
  SpawnSupplyCrate(2088, 430, amBee, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   342
  SpawnSupplyCrate(237, 20, amMortar, 4)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   343
  SpawnSupplyCrate(312, 1107, amMolotov, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   344
  SpawnSupplyCrate(531, 1123, amWatermelon, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   345
  SpawnSupplyCrate(1253, 1444, amFlamethrower, 5)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   346
  SpawnSupplyCrate(994, 1364, amBaseballBat, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   347
  SpawnSupplyCrate(1104, 1553, amMine, 6)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   348
  SpawnSupplyCrate(2277, 803, amDynamite, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   349
  SpawnSupplyCrate(1106, 184, amRCPlane, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   350
  SpawnSupplyCrate(1333, 28, amSMine, 4)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   351
  SpawnSupplyCrate(90, 279, amAirAttack, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   352
  SpawnSupplyCrate(288, 269, amBee, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   353
  SpawnSupplyCrate(818, 1633, amBaseballBat, 2)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   354
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
-----------------------------Events------------------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
function CheckNativesDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
  return nativesLeft == 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
function CheckCannibalsDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
  return cannibalsLeft == 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
function CheckPlayersDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
  return playersLeft == 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
function CheckCyborgsDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
  return (cyborgsLeft == 0 and (leader == nil or gearDead[leader] == true))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
function DoNativesDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
  nativesDeadFresh = true
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   374
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
function DoCannibalsDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
  cannibalsDeadFresh = true
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   379
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
function DoPlayersDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
  RemoveEventFunc(CheckNativesDead)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
  RemoveEventFunc(CheckCannibalsDead)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
  RemoveEventFunc(CheckCyborgsDead)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
  playersDeadFresh = true
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   387
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
function DoCyborgsDead()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
--  RemoveEventFunc(CheckNativesDead)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
--  RemoveEventFunc(CheckCannibalsDead)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
  cyborgsDeadFresh= true
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   394
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
function CheckGearsDead(gearList)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
  for i = 1, # gearList do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
    if gearDead[gearList[i]] ~= true then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
      return false
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
    end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  return true
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
function CheckGearDead(gear)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  return gearDead[gear]
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
function FailedMission()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
  RestoreHedge(cyborg)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  AnimOutOfNowhere(cyborg, unpack(cyborgPos[1]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  if CheckCyborgsDead() then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
    AnimSay(cyborg, loc("Hmmm...it's a draw. How unfortunate!"), SAY_THINK, 6000)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
  elseif leader ~= nil then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
    CondNeedToTurn2(cyborg, leader)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
    AddAnim({{func = AnimSay, args = {leader, loc("Yay, we won!"), SAY_SAY, 2000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
             {func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
  else
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
    CondNeedToTurn2(cyborg, cyborgs[1])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
    AddAnim({{func = AnimSay, args = {cyborgs[1], loc("Yay, we won!"), SAY_SAY, 2000}},
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
             {func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
  AddFunction({func = LoseMission, args = {}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
function LoseMission()
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   428
  DismissTeam(nativesTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   429
  DismissTeam(cannibalsTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   430
  DismissTeam(cyborgTeamName)
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   431
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
function WonMission()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
  RestoreHedge(cyborg)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
  CondNeedToTurn2(cyborg, players[1])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
  SetupFinalAnim()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   438
  AddAnim(finalAnim)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   439
  AddFunction({func = WinMission, args = {}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   440
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   441
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   442
function WinMission()
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   443
  if progress and progress<9 then
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   444
    SaveCampaignVar("Progress", "9")
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   445
  end
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   446
  DismissTeam(cyborgTeamName)
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   447
  EndTurn(true)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   449
-----------------------------Misc--------------------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
function HideHedge(hedge)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
  if hedgeHidden[hedge] ~= true then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
    HideHog(hedge)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
    hedgeHidden[hedge] = true
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   454
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
function RestoreHedge(hedge)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
  if hedgeHidden[hedge] == true then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
    RestoreHog(hedge)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
    hedgeHidden[hedge] = false
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   464
function GetVariables()
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   465
  progress = tonumber(GetCampaignVar("Progress"))
13145
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   466
  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) or leaksNum
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   467
  m2Choice = tonumber(GetCampaignVar("M2Choice")) or choiceRefused
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   468
  m5Choice = tonumber(GetCampaignVar("M5Choice")) or choiceEliminate
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
  m4DenseDead = tonumber(GetCampaignVar("M4DenseDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   471
  m5DenseDead = tonumber(GetCampaignVar("M5DenseDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
  m4LeaksDead = tonumber(GetCampaignVar("M4LeaksDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
  m5LeaksDead = tonumber(GetCampaignVar("M5LeaksDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
  m4ChiefDead = tonumber(GetCampaignVar("M4ChiefDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
  m5ChiefDead = tonumber(GetCampaignVar("M5ChiefDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
  m4WaterDead = tonumber(GetCampaignVar("M4WaterDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
  m5WaterDead = tonumber(GetCampaignVar("M5WaterDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
  m4BuffaloDead = tonumber(GetCampaignVar("M4BuffaloDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
  m5BuffaloDead = tonumber(GetCampaignVar("M5BuffaloDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  m5WiseDead = tonumber(GetCampaignVar("M5WiseDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  m5GirlDead = tonumber(GetCampaignVar("M5GirlDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
  m8DeployedDead = tonumber(GetCampaignVar("M8DeployedDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
  m8PrincessDead = tonumber(GetCampaignVar("M8PrincessDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
  m8RamonDead = tonumber(GetCampaignVar("M8RamonDead"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
  m8SpikyDead = tonumber(GetCampaignVar("M8SpikyDead"))
13145
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   486
  m8DeployedLeader = tonumber(GetCampaignVar("M8DeployedLeader")) or 0
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   487
  m8PrincessLeader = tonumber(GetCampaignVar("M8PrincessLeader")) or 1
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
  m8EnemyFled = tonumber(GetCampaignVar("M8EnemyFled"))
13145
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13144
diff changeset
   489
  m8Scene = tonumber(GetCampaignVar("M8Scene")) or princessScene
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
function SetupPlace()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  for i = 1, playersNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
    HideHedge(players[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  for i = 1, cyborgsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
    HideHedge(cyborgs[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
  if leader ~= nil then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
    HideHedge(leader)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
function SetupEvents()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
  AddNewEvent(CheckPlayersDead, {}, DoPlayersDead, {}, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  AddNewEvent(CheckNativesDead, {}, DoNativesDead, {}, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
  AddNewEvent(CheckCannibalsDead, {}, DoCannibalsDead, {}, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   508
  AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   511
function SetupAmmo()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
  AddAmmo(cyborgs[1], amClusterBomb, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   513
  AddAmmo(cyborgs[1], amMortar, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
  AddAmmo(cyborgs[1], amDynamite, 2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  AddAmmo(cyborgs[1], amAirAttack, 2)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
  AddAmmo(cyborgs[1], amTeleport, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  if leader ~= nil then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
    AddAmmo(leader, amClusterBomb, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
    AddAmmo(leader, amMortar, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
    AddAmmo(leader, amDynamite, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
    AddAmmo(leader, amAirAttack, 3)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
    AddAmmo(leader, amTeleport, 100)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   527
function AddHogs()
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   528
  cyborgTeamName = AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   530
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   531
  nativesTeamName = AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
13144
9a0b1288315e ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents: 13139
diff changeset
   532
  -- There are 3-4 natives in this mission
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   533
  natives[1] = AddHog(nativeNames[leaksNum], 0, 100, nativeHats[leaksNum])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
  if m5DeployedNum ~= leaksNum and m8DeployedLeader == 0 then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
    natives[2] = AddHog(nativeNames[m5DeployedNum], 0, 100, nativeHats[m5DeployedNum])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  table.insert(natives, AddHog(nativeNames[ramonNum], 0, 100, nativeHats[ramonNum]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   538
  table.insert(natives, AddHog(nativeNames[spikyNum], 0, 100, nativeHats[spikyNum]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   539
  if m8PrincessLeader == 0 then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   540
    table.insert(natives, AddHog(loc("Fell From Heaven"), 0, 100, "tiara"))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   541
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
  nativesNum = #natives
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
  nativesLeft = nativesNum
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
  cannibalsLeft = cannibalsNum
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
  for i = 1, nativesNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
    table.insert(players, natives[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   549
  cannibalsTeamName = AddTeam(loc("Cannibals"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550
  for i = 1, cannibalsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   551
    cannibals[i] = AddHog(cannibalNames[i], 0, 100, "Zombi")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   552
    table.insert(players, cannibals[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   553
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   554
  playersNum = #players
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   555
  playersLeft = playersNum
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   556
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   557
  hedgecogsTeamName = AddTeam(loc("Hedge-cogs"), -9, "ring", "UFO", "Robot", "cm_cyborg")
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   558
  for i = 1, cyborgsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   559
    cyborgs[i] = AddHog(cyborgNames[i], 2, 80, "cyborg2")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   560
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
  if m8EnemyFled == 1 then
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   563
    leaderTeamName = AddTeam(loc("Leader"), -9, "ring", "UFO", "Robot", "cm_cyborg")
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
    if m8Scene == denseScene then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   565
      leader = AddHog(loc("Dense Cloud"), 2, 200, nativeHats[denseNum])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   566
    elseif m8Scene == waterScene then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   567
      leader = AddHog(loc("Fiery Water"), 2, 200, nativeHats[waterNum])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   568
    elseif m8Scene == princessScene then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
      leader = AddHog(loc("Fell From Heaven"), 2, 200, "tiara")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
    else
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   571
      leader = AddHog(loc("Nancy Screw"), 2, 200, "cyborg2")
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
    end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   573
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
  cyborgsLeft = cyborgsNum
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   577
  for i = 1, nativesNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   578
    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   579
    AnimTurn(natives[i], nativeDir[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
  for i = 1, cannibalsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
    AnimTurn(cannibals[i], cannibalDir[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   584
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   585
  for i = 1, cyborgsNum do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   586
    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
    AnimTurn(cyborgs[i], cyborgsDir[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   588
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
  AnimSetGearPosition(cyborg, unpack(cyborgPos[1]))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   590
  AnimTurn(cyborg, cyborgDir)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   591
  if leader ~= nil then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   592
    AnimSetGearPosition(leader, unpack(leaderPos))
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
    AnimTurn(leader, leaderDir[i])
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   594
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   595
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   596
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   597
-----------------------------Main Functions----------------------------
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   598
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   599
function onGameInit()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   600
	Seed = 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   601
	GameFlags = gfSolidLand
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   602
	TurnTime = 60000 
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   603
	CaseFreq = 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
	MinesNum = 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
	MinesTime = 3000
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
	Explosives = 0
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
  Map = "Islands"
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   608
	Theme = "EarthRise"
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
  SuddenDeathTurns = 20
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
  GetVariables()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   612
  AnimInit()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   613
  AddHogs()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   615
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   616
function onGameStart()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   617
  SetupAmmo()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   618
  SetupPlace()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   619
  AnimationSetup()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   620
  SetupEvents()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   621
  AddAnim(startAnim)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   622
  AddFunction({func = AfterStartAnim, args = {}})
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   623
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   624
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   625
function onGameTick()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   626
  AnimUnWait()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   627
  if ShowAnimation() == false then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   628
    return
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   629
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   630
  ExecuteAfterAnimations()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
  CheckEvents()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   633
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   634
function onGearDelete(gear)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   635
  gearDead[gear] = true
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   636
  if GetGearType(gear) == gtHedgehog then
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   637
    if GetHogTeamName(gear) == nativesTeamName then
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
      for i = 1, nativesLeft do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   639
        if natives[i] == gear then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   640
          table.remove(natives, i)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   641
          table.remove(players, i)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   642
          nativesLeft = nativesLeft - 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   643
          playersLeft = playersLeft - 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
        end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
      end
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   646
    elseif GetHogTeamName(gear) == cannibalsTeamName then
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   647
      for i = 1, cannibalsLeft do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   648
        if cannibals[i] == gear then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   649
          table.remove(cannibals, i)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
          table.remove(players, nativesLeft + i)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   651
          cannibalsLeft = cannibalsLeft - 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   652
          playersLeft = playersLeft - 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   653
        end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   654
      end
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   655
    elseif GetHogTeamName(gear) == hedgecogsTeamName then
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
      for i = 1, cyborgsLeft do
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   657
        if cyborgs[i] == gear then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   658
          table.remove(cyborgs, i)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   659
        end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   660
      end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
      cyborgsLeft = cyborgsLeft - 1
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
    end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   664
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   666
function onAmmoStoreInit()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
  SetAmmo(amSkip, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
  SetAmmo(amSwitch, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
  SetAmmo(amDEagle, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
  SetAmmo(amSniperRifle, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   671
  SetAmmo(amBazooka, 8, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   672
  SetAmmo(amGrenade, 7, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   673
  SetAmmo(amFirePunch, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   674
  SetAmmo(amShotgun, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   675
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   676
  SetAmmo(amParachute, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
  SetAmmo(amRope, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   678
  SetAmmo(amPickHammer, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   679
  SetAmmo(amBlowTorch, 9, 0, 0, 0)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   680
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   681
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   682
function onNewTurn()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   683
  if AnimInProgress() then
13750
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13740
diff changeset
   684
    SetTurnTimeLeft(MAX_TURN_TIME)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   685
    return
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   686
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   687
  if playersDeadFresh then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   688
    playersDeadFresh = false
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   689
    FailedMission()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   690
  elseif cyborgsDeadFresh then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   691
    cyborgsDeadFresh = false
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   692
    WonMission()
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   693
  elseif nativesDeadFresh and GetHogTeamName(CurrentHedgehog) == cannibalsTeamName then
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   694
    AnimSay(CurrentHedgehog, string.format(loc("Your deaths will be avenged, %s!"), nativesTeamName), SAY_SHOUT, 0)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   695
    nativesDeadFresh = false
14485
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   696
  elseif cannibalsDeadFresh and GetHogTeamName(CurrentHedgehog) == nativesTeamName then
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14401
diff changeset
   697
    AnimSay(CurrentHedgehog, string.format(loc("Your deaths will be avenged, %s!"), cannibalsTeamName), SAY_SHOUT, 0)
7460
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   698
    cannibalsDeadFresh = false
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   699
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   700
end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   701
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   702
function onPrecise()
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   703
  if GameTime > 3000 and AnimInProgress() then
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   704
    SetAnimSkip(true)
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   705
  end
d32d573aeb64 Forgot to add mission 9 -.-'
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   706
end