share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/united.lua
author Wuzzy <Wuzzy2@mail.ru>
Wed, 01 Aug 2018 15:50:39 +0200
changeset 13588 141cdfe0f3ca
parent 13150 5083fb0a2992
child 13745 2bb7141496a9
permissions -rw-r--r--
Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color Missing: fruit02, HedgeEditor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12799
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
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: 12560
diff changeset
     2
A Classic Fairytale: United we stand
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
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: 12560
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: 12560
diff changeset
     5
Simple Deathmatch against cannibals in two waves.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
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: 12560
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: 12560
diff changeset
     8
Kill both Cannfantery (cannibal) 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: 12560
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: 12560
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: 12560
diff changeset
    11
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    12
- Light Cannfantery and player hogs spawn
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    13
- Cut scene: startAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    14
- 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: 12560
diff changeset
    15
- Light Cannfantery defeated
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    16
- Cut scene: wave2Anim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    17
- Heavy Cannfantery spawns
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    18
- 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: 12560
diff changeset
    19
- Heavy Cannfantery defeated
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    20
- 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: 12560
diff changeset
    21
> 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: 12560
diff changeset
    22
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    23
]]
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12560
diff changeset
    24
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7827
diff changeset
    25
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7827
diff changeset
    26
HedgewarsScriptLoad("/Scripts/Animate.lua")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    27
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    28
-----------------------------Constants---------------------------------
13150
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
    29
choiceAccepted = 1
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
    30
choiceRefused = 2
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
    31
choiceAttacked = 3
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
leaksPos = {2067, 509}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
densePos = {1882, 503}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
waterPos = {3100, 930}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
buffaloPos = {2609, 494}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
chiefPos = {2538, 617}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
cannibalPos = {{2219, 1339}, {2322, 1357}, {805, 784}, {3876, 1048},
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
              {1101, 916}, {2854, 1408}, {1974, 486}, {1103, 961}}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    41
HogNames = {loc("Olive"), loc("Brain Stu"), loc("Brainila"), loc("Salivaslurper"),
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
    42
            loc("Spleenlover"), loc("Thighlicker"), loc("NomNom"), loc("Mindy")}
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    43
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
natives = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    45
-----------------------------Variables---------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
cannibals = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
cannibalDead = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
cannibalHidden = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
cratesSpawned = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
healthCratesSpawned = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
    52
sdrmv = 0
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
denseDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
leaksDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
waterDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
buffaloDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
chiefDead = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
nativesDead = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
m2Choice = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
m2DenseDead = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
startAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
wave2Anim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
finalAnim = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
--------------------------Anim skip functions--------------------------
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    67
function AfterHogDeadAnim()
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    68
  freshDead = nil
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    69
  TurnTimeLeft = TurnTime
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    70
end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
    71
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
function AfterStartAnim()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    73
  local goal = loc("Defeat the cannibals!|")
7247
9aba0c6458af Changed a ShowMission in Mission 4
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
    74
  local chiefgoal = loc("Try to protect the chief! You won't lose if he dies, but it is advised that he survives.")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
  TurnTimeLeft = TurnTime
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
    76
  ShowMission(loc("United We Stand"), loc("Invasion"), goal .. chiefgoal, 1, 6000)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
function SkipStartAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
    80
  AnimSetGearPosition(water, 2467, 754)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
  if cratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
    SpawnCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    83
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    84
  if healthCratesSpawned[1] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    85
    SpawnHealthCrates(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
  if cannibalHidden[1] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
    RestoreWave(1)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
  AnimSwitchHog(leaks)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
function SkipWave2Anim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
  if cratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
    SpawnCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
  if healthCratesSpawned[2] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    98
    SpawnHealthCrates(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    99
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   100
  if cannibalHidden[5] == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   101
    RestoreWave(2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
  AnimSwitchHog(cannibals[5])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   104
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   105
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   106
function AfterWave2Anim()
12560
d51ea6ac1ca1 ACF: Replace TurnTimeLeft=0 with EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12559
diff changeset
   107
  EndTurn(true)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   109
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   110
function AfterFinalAnim()
7251
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   111
  if leaksDead == true then
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   112
    SaveCampaignVar("M4LeaksDead", "1")
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   113
  else
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   114
    SaveCampaignVar("M4LeaksDead", "0")
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   115
  end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
  if chiefDead == true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   117
    SaveCampaignVar("M4ChiefDead", "1")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   118
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
    SaveCampaignVar("M4ChiefDead", "0")
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
  end
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   121
  if buffaloDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   122
    SaveCampaignVar("M4BuffaloDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   123
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   124
    SaveCampaignVar("M4BuffaloDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   125
  end
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   126
  if waterDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   127
    SaveCampaignVar("M4WaterDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   128
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   129
    SaveCampaignVar("M4WaterDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   130
  end
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   131
  if denseDead == true then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   132
    SaveCampaignVar("M4DenseDead", "1")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   133
  else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   134
    SaveCampaignVar("M4DenseDead", "0")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   135
  end
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   136
  if progress and progress<4 then
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   137
    SaveCampaignVar("Progress", "4")
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   138
  end
10290
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 9306
diff changeset
   139
  DismissTeam(loc("011101001"))
12560
d51ea6ac1ca1 ACF: Replace TurnTimeLeft=0 with EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12559
diff changeset
   140
  EndTurn(true)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
-----------------------------Animations--------------------------------
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   143
function Wave2Reaction()
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   144
  local i = 1
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   145
  local gearr = nil
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   146
  while nativesDead[i] == true do
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   147
    i = i + 1
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   148
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   149
  gearr = natives[i]
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   150
  if denseDead ~= true and band(GetState(dense), gstDrowning) == 0 then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   151
    AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   152
    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   153
    AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   154
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   155
  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   156
end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   158
function EmitDenseClouds(dir)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  local dif
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   160
  if dir == "Left" then
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
    dif = 10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
    dif = -10
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   168
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   169
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
function AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
  table.insert(startAnim, {func = AnimWait, args = {leaks, 4000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   177
  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Back in the village, after telling the villagers about the threat..."), 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   178
  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Their buildings were very primitive back then, even for an uncivilised island."), 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   179
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Young one, you are telling us that they can instantly change location without a shaman?"), SAY_SAY, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   180
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("That is, indeed, very weird..."), SAY_SAY, 3500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   181
  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("If they try coming here, they can have a taste of my delicious knuckles!"), SAY_SHOUT, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   182
  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("Haha!"), SAY_SHOUT, 2000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
  if denseDead == false then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   184
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("I'm not sure about that!"), SAY_SAY, 3400}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   185
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   186
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Luckily, I've managed to snatch some of them."), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
    table.insert(startAnim, {func = AnimCustomFunction, args = {dense, SpawnCrates, {1}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   188
    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Oops...I dropped them."), SAY_SAY, 3000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
  else
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   190
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'm not sure about that!"), SAY_SAY, 3400}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   191
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   192
    table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
    table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   194
    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They keep appearing like this. It's weird!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   195
  end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   196
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Did anyone follow you?"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   197
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("No, we made sure of that!"), SAY_SAY, 3500}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
  table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   200
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("First aid kits?!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   201
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   202
  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 3000, 0}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
  table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   204
  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2655, 0}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
  table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
  table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   209
  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2467, 754}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   210
  table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   211
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("..."), SAY_THINK, 1500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   212
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Where have you been?"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   213
  table.insert(startAnim, {func = AnimSay, args = {water, loc("Just on a walk."), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   214
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("You have chosen the perfect moment to leave."), SAY_SAY, 6000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
  table.insert(startAnim, {func = AnimCustomFunction, args = {chief, RestoreWave, {1}}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
  for i = 1, 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   217
    table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   219
  table.insert(startAnim, {func = AnimWait, args = {chief, 1500}})
12268
2c8e7e73ef58 Use format strings everywhere in A Classic Fairytale (for translators)
Wuzzy <almikes@aol.com>
parents: 12229
diff changeset
   220
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("HOW DO THEY KNOW WHERE WE ARE?"), SAY_SHOUT, 5000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   221
  table.insert(startAnim, {func = AnimSay, args = {chief, loc("We have to protect the village!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
  table.insert(startAnim, {func = AnimSwitchHog, args = {leaks}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
  AddSkipFunction(startAnim, SkipStartAnim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, RestoreWave, {2}}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  for i = 5, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
    table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
  end
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   229
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, Wave2Reaction, {}}, swh = false})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {2}}, swh = false})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   232
  table.insert(wave2Anim, {func = AnimSwitchHog, args = {cannibals[5]}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   233
  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   236
function SetupHogDeadAnim(gear)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   237
  hogDeadAnim = {}
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   238
  if nativesNum == 0 then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   239
    return
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   240
  end
12268
2c8e7e73ef58 Use format strings everywhere in A Classic Fairytale (for translators)
Wuzzy <almikes@aol.com>
parents: 12229
diff changeset
   241
  local hogDeadStrings = {string.format(loc("They killed %s! You bastards!"), gear), 
2c8e7e73ef58 Use format strings everywhere in A Classic Fairytale (for translators)
Wuzzy <almikes@aol.com>
parents: 12229
diff changeset
   242
                          string.format(loc("%s! Why?!"), gear), 
7827
353d90ddc188 Fix bad loc calls in campaign, rope training. Regenerate lua. Untested.
nemo
parents: 7675
diff changeset
   243
                          loc("That was just mean!"), 
12268
2c8e7e73ef58 Use format strings everywhere in A Classic Fairytale (for translators)
Wuzzy <almikes@aol.com>
parents: 12229
diff changeset
   244
                          string.format(loc("Oh no, not %s!"), gear)}
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   245
  table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[nativesNum], SAY_SHOUT, 4000}})
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   246
end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   247
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
function SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
  local found = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   250
  local hogs = {}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   251
  local i = 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
  if nativesNum >= 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
    while found < 2 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
      if  nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
        found = found + 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
        hogs[found] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
      i = i + 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
    if chiefDead ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
      hogs[2] = chief
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
    table.insert(finalAnim, {func = AnimCustomFunction, args = {hogs[1], CondNeedToTurn, {hogs[1], hogs[2]}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   264
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We can't hold them up much longer!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   265
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We need to move!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   266
    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("But where can we go?"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   267
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("To the caves..."), SAY_SAY, 2500}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   268
    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("Good idea, they'll never find us there!"), SAY_SAY, 5000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
    for i = 1, 5 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
      if nativesDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
        hogs[1] = natives[i]
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
    end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   275
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("I need to move the tribe!"), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   276
    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("The caves are well hidden, they won't find us there!"), SAY_THINK, 7000}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
-----------------------------Misc--------------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
function RestoreWave(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
    RestoreHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
    cannibalHidden[i] = false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
function GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
  if m2DenseDead == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
    denseDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
  end
13150
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   292
  m2Choice = tonumber(GetCampaignVar("M2Choice")) or choiceRefused
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
function SetupPlace()
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   296
  if m2DenseDead == 1 then
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   297
    sdrmv = 1
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
    DeleteGear(dense)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   300
  for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
    HideHog(cannibals[i])
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
    cannibalHidden[i] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
  HideHog(cyborg)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
function SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
function SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
  AddAmmo(cannibals[1], amGrenade, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
  AddAmmo(cannibals[1], amBazooka, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
  AddAmmo(cannibals[1], amShotgun, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
  AddAmmo(cannibals[1], amMine, 2)
7251
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   317
  AddAmmo(cannibals[5], amGrenade, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   318
  AddAmmo(cannibals[5], amBazooka, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   319
  AddAmmo(cannibals[5], amShotgun, 4)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   320
  AddAmmo(cannibals[5], amMine, 2)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   321
  AddAmmo(cannibals[5], amMolotov, 2)
cba4960b426f Fixed a bug where certain ammo types were added to the wrong hogs.
belphegorr <szabibibi@gmail.com>
parents: 7249
diff changeset
   322
  AddAmmo(cannibals[5], amFlamethrower, 3)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
function AddHogs()
13588
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13150
diff changeset
   326
	AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   327
	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   328
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   329
  water = AddHog(loc("Fiery Water"), 0, 100, "pirate_jack")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   330
  buffalo = AddHog(loc("Raging Buffalo"), 0, 100, "zoo_Bunny")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   331
  chief = AddHog(loc("Righteous Beard"), 0, 100, "IndianChief")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
  natives = {leaks, dense, water, buffalo, chief}
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
  nativesNum = 5
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
13588
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13150
diff changeset
   335
  AddTeam(loc("Light Cannfantry"), -1, "skull", "Island", "Pirate", "cm_vampire")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
  for i = 1, 4 do
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   337
    cannibals[i] = AddHog(HogNames[i], 2, 40, "Zombi")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
13588
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13150
diff changeset
   340
  AddTeam(loc("Heavy Cannfantry"), -1, "skull", "Island", "Pirate", "cm_vampire")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
  for i = 5, 8 do
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   342
    cannibals[i] = AddHog(HogNames[i], 2, 55, "vampirichog")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   344
13588
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13150
diff changeset
   345
  AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7222
diff changeset
   346
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   348
  AnimSetGearPosition(leaks,   unpack(leaksPos))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   349
  AnimSetGearPosition(dense,   unpack(densePos))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   350
  AnimSetGearPosition(water,   unpack(waterPos))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   351
  HogTurnLeft(water, true)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   352
  AnimSetGearPosition(buffalo, unpack(buffaloPos))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   353
  HogTurnLeft(buffalo, true)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   354
  AnimSetGearPosition(chief,   unpack(chiefPos))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
  HogTurnLeft(chief, true)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   356
  AnimSetGearPosition(cyborg, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
  for i = 1, 8 do
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7253
diff changeset
   358
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
function CondNeedToTurn(hog1, hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
  xl, xd = GetX(hog1), GetX(hog2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
  if xl > xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
  elseif xl < xd then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
function SpawnHealthCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
  SetHealth(SpawnHealthCrate(0, 0), 25)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
  healthCratesSpawned[index] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
function SpawnCrates(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
  if index == 1 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   382
    SpawnSupplyCrate(1943, 408, amBazooka)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   383
    SpawnSupplyCrate(1981, 464, amGrenade)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   384
    SpawnSupplyCrate(1957, 459, amShotgun)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   385
    SpawnSupplyCrate(1902, 450, amDynamite)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   386
    SpawnSupplyCrate(1982, 405, amPickHammer)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   387
    SpawnSupplyCrate(2028, 455, amRope)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   388
    SpawnSupplyCrate(2025, 464, amTeleport)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
  else
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   390
    SpawnSupplyCrate(1982, 405, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   391
    SpawnSupplyCrate(2171, 428, amMolotov)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   392
    SpawnSupplyCrate(2364, 346, amFlamethrower)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   393
    SpawnSupplyCrate(2521, 303, amBazooka)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   394
    SpawnSupplyCrate(2223, 967, amGrenade)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12799
diff changeset
   395
    SpawnSupplyCrate(1437, 371, amShotgun)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
 end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
  cratesSpawned[index] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
-----------------------------Events------------------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
function CheckWaveDead(index)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  for i = (index - 1) * 4 + 1, index * 4 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
    if cannibalDead[i] ~= true then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
      return false
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  return true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
function DoWaveDead(index)
7253
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents: 7251
diff changeset
   412
  SetGearMessage(CurrentHedgehog, 0)
86814ed9feab Added fifth mission and fixed minor control bug with mission 4
belphegorr <szabibibi@gmail.com>
parents: 7251
diff changeset
   413
  SetState(CurrentHedgehog, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
  if index == 1 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
    AddAnim(wave2Anim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
    AddFunction({func = AfterWave2Anim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
  elseif index == 2 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
    SetupFinalAnim()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
    AddAnim(finalAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
    AddFunction({func = AfterFinalAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
-----------------------------Main Functions----------------------------
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
function onGameInit()
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7241
diff changeset
   428
	Seed = 1
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
	GameFlags = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
	TurnTime = 60000 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
	CaseFreq = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
	MinesNum = 0
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
	MinesTime = 3000
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
	Explosives = 2
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
	Delay = 10 
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
  Map = "Hogville"
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
	Theme = "Nature"
12229
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   438
	-- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   439
	HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   440
	WaterRise = 0
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   441
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   442
  AddHogs()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   443
  AnimInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   444
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   445
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
function onGameStart()
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   447
  progress = tonumber(GetCampaignVar("Progress"))
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
  GetVariables()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   449
  SetupAmmo()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
  SetupPlace()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
  AnimationSetup()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
  SetupEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
  AddAnim(startAnim)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   454
  AddFunction({func = AfterStartAnim, args = {}})
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
function onGameTick()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
  AnimUnWait()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
  if ShowAnimation() == false then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
    return
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
  ExecuteAfterAnimations()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
  CheckEvents()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   464
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   465
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
function onGearDelete(gear)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
  if gear == dense then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
    denseDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
    nativesDead[2] = true
7249
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   471
    if sdrmv == 1 then
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   472
      freshDead = nil
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   473
    else
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   474
      freshDead = loc("Dense Cloud")
79b399c04410 Reduced mission 4 difficulty (enemy health and level) and fixed a bug where hogs would comment on the death of Dense Cloud eve though he isn't added
belphegorr <szabibibi@gmail.com>
parents: 7247
diff changeset
   475
    end
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
  elseif gear == leaks then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
    leaksDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
    nativesDead[1] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   480
    freshDead = loc("Leaks A Lot")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  elseif gear == chief then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
    chiefDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
    nativesDead[5] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   485
    freshDead = loc("Righteous Beard")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  elseif gear == water then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
    waterDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   489
    nativesDead[3] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   490
    freshDead = loc("Fiery Water")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
  elseif gear == buffalo then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
    buffaloDead = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
    nativesNum = nativesNum - 1
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
    nativesDead[4] = true
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   495
    freshDead = loc("Raging Buffalo")
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  else
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
    for i = 1, 8 do
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
      if gear == cannibals[i] then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
        cannibalDead[i] = true
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
      end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
    end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
function onAmmoStoreInit()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  SetAmmo(amDEagle, 9, 0, 0, 0)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   507
  SetAmmo(amSniperRifle, 4, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   508
  SetAmmo(amFirePunch, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
  SetAmmo(amWhip, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
  SetAmmo(amBaseballBat, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   511
  SetAmmo(amHammer, 9, 0, 0, 0)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
  SetAmmo(amLandGun, 9, 0, 0, 0)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   513
  SetAmmo(amSnowball, 8, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
  SetAmmo(amGirder, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  SetAmmo(amParachute, 4, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
  SetAmmo(amSwitch, 8, 0, 0, 2)
12368
6ad1f86e0c81 Set infinite skip in ACF: United We Stand
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   517
  SetAmmo(amSkip, 9, 0, 0, 0)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  SetAmmo(amRope, 5, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
  SetAmmo(amBlowTorch, 3, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
  SetAmmo(amPickHammer, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
  SetAmmo(amLowGravity, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
  SetAmmo(amDynamite, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
  SetAmmo(amBazooka, 0, 0, 0, 4)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
  SetAmmo(amGrenade, 0, 0, 0, 5)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
  SetAmmo(amMine, 0, 0, 0, 2)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
  SetAmmo(amMolotov, 0, 0, 0, 3)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   527
  SetAmmo(amFlamethrower, 0, 0, 0, 3)
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   528
  SetAmmo(amShotgun, 0, 0, 0, 3)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   529
  SetAmmo(amTeleport, 0, 0, 0, 2)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   530
  SetAmmo(amFlamethrower, 0, 0, 0, 3)
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   532
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   533
function onNewTurn()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
  if AnimInProgress() then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
    TurnTimeLeft = -1
7241
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   536
    return
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   537
  end
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   538
  if freshDead ~= nil and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   539
    SetupHogDeadAnim(freshDead)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   540
    AddAnim(hogDeadAnim)
7fda4d886c5e Modified Mission 4: reduced second wave health, reduced some ammos, added some ammos, added reaction to hog death, added reaction to second wave of hogs
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   541
    AddFunction({func = AfterHogDeadAnim, args = {}})
7222
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
function onPrecise()
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
  if GameTime > 2500 then
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
    SetAnimSkip(true)
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
  end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   549
end
4a17a921ec93 Added Mission 4: United We Stand
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550