share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
author Wuzzy <Wuzzy2@mail.ru>
Thu, 26 Oct 2017 22:49:39 +0200
changeset 12784 1f8a62d1609d
parent 12559 194b00c4ba07
child 12799 bca911f8e804
permissions -rw-r--r--
ACF5: Fix final animation being stuck when the cyborg's way to the right is blocked Fixed with the new maxMoveTime parameter in AnimMove. If cyborg didn't reach its destination in 7000ms, the move anim is skipped and the sequence just continues.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7524
diff changeset
     1
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7524
diff changeset
     2
HedgewarsScriptLoad("/Scripts/Animate.lua")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     3
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     4
--///////////////////////////////CONSTANTS///////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     5
7219
6c7739c6446f Set the choice constants to the correct values (1-3 instead of 0-2).
belphegorr <szabibibi@gmail.com>
parents: 7217
diff changeset
     6
choiceAccepted = 1
6c7739c6446f Set the choice constants to the correct values (1-3 instead of 0-2).
belphegorr <szabibibi@gmail.com>
parents: 7217
diff changeset
     7
choiceRefused = 2
6c7739c6446f Set the choice constants to the correct values (1-3 instead of 0-2).
belphegorr <szabibibi@gmail.com>
parents: 7217
diff changeset
     8
choiceAttacked = 3
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     9
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    10
endStage = 1
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    11
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    12
cannibalNum = 8
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
    13
cannibalNames = {loc("John"), loc("Flesh for Brainz"), loc("Eye Chewer"), loc("Torn Muscle"),
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
    14
                 loc("Nom-Nom"), loc("Vedgies"), loc("Brain Blower"), loc("Gorkij")}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    15
cannibalPos = {{2471, 1174}, {939, 1019}, {1953, 902}, {3055, 1041},
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    16
               {1121, 729}, {1150, 718}, {1149, 680}, {1161, 773}}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    17
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    18
startLeaksPosDuo = {3572, 1426}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    19
startEventXDuo = 3300
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    20
startDensePosDuo = {3454, 1471}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    21
startCyborgPosDuo = {3202, 1307}
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
    22
midDensePosDuo = {1464, 1410}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    23
midCyborgPosDuo = {1264, 1390}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    24
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    25
--///////////////////////////////VARIABLES///////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    26
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    27
m2Choice = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    28
m2DenseDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    29
m2RamonDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
m2SpikyDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
TurnsLeft = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
stage = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
blowTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
fireTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
gravityTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
sniperTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
leaksDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
denseDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
princessDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
cyborgDead = false
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
    43
victory = false
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
cannibalDead = {}
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
    45
hedgeHidden = {}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
startAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
startAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
startAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
pastFlowerAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
pastFlowerAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
pastFlowerAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
outPitAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
outPitAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
outPitAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
midAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
failAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
failAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
endAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
endAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
endAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
endAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
endFailAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
winAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
winAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
--/////////////////////////Animation Functions///////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
function AfterMidFailAnim()
10290
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
    78
  DismissTeam(loc("Natives"))
12384
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
    79
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
function AfterMidAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    83
  SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    84
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
    85
    RestoreHedge(cannibals[i])
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
    86
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
  AddAmmo(cannibals[5], amDEagle, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
  AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
  AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
  AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
  TurnsLeft = 12
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
  TurnTimeLeft = TurnTime
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
    97
  ShowMission(loc("The Journey Back"), loc("Collateral Damage"),
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
    98
    loc("Save the princess by collecting the crate in under 12 turns!") .. "|" ..
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
    99
    loc("Mines time: 3 seconds"), 0, 6000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   100
  -----------------------///////////////------------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   101
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
function SkipEndAnimAlone()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   104
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   105
  RestoreHedge(princess)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   106
  AnimSetGearPosition(cyborg, 437, 1700)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   107
  AnimSetGearPosition(princess, 519, 1722)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   109
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   110
function SkipEndAnimDuo()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   111
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   112
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
  if princessHidden then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
    RestoreHog(princess)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
    princessHidden = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
  end
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   117
  AnimSetGearPosition(cyborg, 437, 1700)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   118
  AnimSetGearPosition(princess, 519, 1722)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   119
  AnimSetGearPosition(leaks, 763, 1760)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   120
  AnimSetGearPosition(dense, 835, 1519)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
  HogTurnLeft(leaks, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
  HogTurnLeft(dense, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
function AfterEndAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   130
  ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
  AddEvent(CheckLost, {}, DoLost, {}, 0)
7236
378fc97dae99 Reduced number of crates on the challenge in mission 1, fixed an error with mission 3 (at the end)
belphegorr <szabibibi@gmail.com>
parents: 7228
diff changeset
   132
  AddEvent(CheckWon, {}, DoWon, {}, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
  RemoveEventFunc(CheckFailedCourse)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   134
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   136
function AfterEndAnimDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   139
  SetGearMessage(leaks, 0)
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
   140
  SetGearMessage(dense, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   142
  ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
  AddEvent(CheckLost, {}, DoLost, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
  AddEvent(CheckWon, {}, DoWon, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
function SkipMidAnimAlone()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   148
  AnimSetGearPosition(leaks, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
  AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
  SetInputMask(0xFFFFFFFF)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   151
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   152
  AddFunction({func = HideHedge, args = {princess}})
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   153
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   155
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
function AfterStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
  TurnTimeLeft = TurnTime
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   159
  local goal = loc("Get the crate on the other side of the island!|")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   160
  local hint = loc("Hint: you might want to stay out of sight and take all the crates...|")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   161
  local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!|")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   162
  local conds = loc("Leaks A Lot must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
  if m2DenseDead == 0 then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   164
    conds = loc("Your hogs must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
  end
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   166
  ShowMission(loc("The Journey Back"), loc("Adventurous"), goal .. hint .. stuck .. conds, 0, 7000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   168
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   169
function SkipStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
  AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
function PlaceCratesDuo()
7228
1b29b8cfb17a Modified some crate positions, added sound to teleports, fixed loc errors...
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   174
  SpawnAmmoCrate(3090, 827, amBaseballBat)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
  girderCrate1 = SpawnUtilityCrate(2466, 1814, amGirder)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
  girderCrate2 = SpawnUtilityCrate(2630, 1278, amGirder)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
  SpawnUtilityCrate(2422, 1810, amParachute)
7228
1b29b8cfb17a Modified some crate positions, added sound to teleports, fixed loc errors...
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   178
  SpawnUtilityCrate(3157, 1009, amLowGravity)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
  sniperCrate = SpawnAmmoCrate(784, 1715, amSniperRifle)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
function PlaceMinesDuo()
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   183
  AddGear(2920, 1448, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   184
  AddGear(2985, 1338, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   185
  AddGear(3005, 1302, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   186
  AddGear(3030, 1270, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   187
  AddGear(3046, 1257, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   188
  AddGear(2954, 1400, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   189
  AddGear(2967, 1385, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   190
  AddGear(2849, 1449, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   191
  AddGear(2811, 1436, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   192
  AddGear(2773, 1411, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   193
  AddGear(2732, 1390, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   194
  AddGear(2700, 1362, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   195
  AddGear(2642, 1321, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   196
  AddGear(2172, 1417, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   197
  AddGear(2190, 1363, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   198
  AddGear(2219, 1332, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   199
  AddGear(1201, 1207, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   200
  AddGear(1247, 1205, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   201
  AddGear(1295, 1212, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   202
  AddGear(1356, 1209, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   203
  AddGear(1416, 1201, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   204
  AddGear(1466, 1201, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   205
  AddGear(1678, 1198, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   206
  AddGear(1738, 1198, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   207
  AddGear(1796, 1198, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   208
  AddGear(1637, 1217, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   209
  AddGear(1519, 1213, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   210
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   211
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   212
function AfterPastFlowerAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
  PlaceMinesDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   214
  AddEvent(CheckDensePit, {}, DoDensePit, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
  SetGearMessage(dense, 0)
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   217
  EndTurn(0)
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   218
  ShowMission(loc("The Journey Back"), loc("The Savior"), 
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   219
    loc("Get Dense Cloud out of the pit!") .. "|" ..
12386
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   220
    loc("Your hogs must survive!") .. "|" ..
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   221
    loc("Beware of mines: They explode after 5 seconds."), 1, 5000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
function SkipPastFlowerAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   225
  AnimSetGearPosition(dense, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   227
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   228
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
function AfterOutPitAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
  SetupCourseDuo()
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   233
  RestoreHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
  AddAmmo(cannibals[5], amDEagle, 0)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   235
  HideHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
  AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
  SetGearMessage(dense, 0)
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   239
  EndTurn(true)
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   240
  ShowMission(loc("The Journey Back"), loc("They never learn"),
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   241
    loc("Free Dense Cloud and continue the mission!") .. "|" ..
12386
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   242
    loc("Collect the weapon crate at the left coast!") .. "|" ..
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   243
    loc("Your hogs must survive!") .. "|" ..
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   244
    loc("Mines time: 5 seconds"), 1, 5000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
function SkipOutPitAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   248
  AnimSetGearPosition(dense, unpack(midDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   250
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   251
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
function RestoreCyborg(x, y, xx, yy)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   255
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   256
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
  AnimOutOfNowhere(cyborg, x, y)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
  AnimOutOfNowhere(princess, xx, yy)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
  HogTurnLeft(princess, false)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
function RestoreCyborgOnly(x, y)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   264
  RestoreHedge(cyborg)
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
   265
  SetState(cyborg, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  AnimOutOfNowhere(cyborg, x, y)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
function TargetPrincess()
10289
c3a77ff02a23 lua api: SetWeapon(ammoType)
sheepluva
parents: 9308
diff changeset
   271
  SetWeapon(amDEagle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
  SetGearMessage(cyborg, gmUp)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
function HideCyborg()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   277
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   278
  HideHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
function HideCyborgOnly()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   282
  HideHedge(cyborg)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
function SetupKillRoom()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
  PlaceGirder(2342, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
  PlaceGirder(2294, 1783, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
  PlaceGirder(2245, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
function SetupCourseDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
  PlaceGirder(1083, 1152, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
  PlaceGirder(1087, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
  PlaceGirder(1133, 1155, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
  PlaceGirder(1135, 1152, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   296
  PlaceGirder(1135, 1078, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
  PlaceGirder(1087, 1016, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
  PlaceGirder(1018, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
  PlaceGirder(1016, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   300
  PlaceGirder(962, 782, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
  PlaceGirder(962, 662, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
  PlaceGirder(962, 661, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
  PlaceGirder(962, 650, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
  PlaceGirder(962, 630, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
  PlaceGirder(1033, 649, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
  PlaceGirder(952, 650, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
  fireCrate = SpawnAmmoCrate(1846, 1100, amFirePunch)
12517
b1c2b0a8a43e Fix crate types (weapon/utility) in A Classic Fairytale missions
Wuzzy <almikes@aol.com>
parents: 12386
diff changeset
   309
  SpawnAmmoCrate(1900, 1100, amPickHammer)
7228
1b29b8cfb17a Modified some crate positions, added sound to teleports, fixed loc errors...
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   310
  SpawnAmmoCrate(950, 674, amDynamite)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
  SpawnUtilityCrate(994, 825, amRope)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
  SpawnUtilityCrate(570, 1357, amLowGravity)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
12548
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   315
local trackedGears = {}
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   316
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   317
-- Remove mines and crates for the princess cage scene.
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   318
-- Some annoying gears might get in the way for this scene, like a dropped
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   319
-- mine, or the crate on the leaf.
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   320
function ClearTrashForPrincessCage()
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   321
  for gear, _ in pairs(trackedGears) do
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   322
    if GetY(gear) > 1600 and GetX(gear) > 1800 and GetX(gear) < 2700 then
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   323
      DeleteGear(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   324
    end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   325
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   326
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   327
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   328
-- Dump mines in princess cage
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
function DumpMines()
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   330
  AddGear(2261, 1835, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   331
  AddGear(2280, 1831, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   332
  AddGear(2272, 1809, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   333
  AddGear(2290, 1815, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   334
  AddGear(2278, 1815, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   335
  AddGear(2307, 1811, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   336
  AddGear(2286, 1820, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   337
  AddGear(2309, 1813, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   338
  AddGear(2303, 1822, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   339
  AddGear(2317, 1827, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   340
  AddGear(2312, 1816, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   341
  AddGear(2316, 1812, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   342
  AddGear(2307, 1802, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   343
  AddGear(2276, 1818, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   344
  AddGear(2284, 1816, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   345
  AddGear(2292, 1811, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   346
  AddGear(2295, 1814, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   347
  AddGear(2306, 1811, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   348
  AddGear(2292, 1815, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   349
  AddGear(2314, 1815, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   350
  AddGear(2286, 1813, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   351
  AddGear(2275, 1813, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   352
  AddGear(2269, 1814, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   353
  AddGear(2273, 1812, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   354
  AddGear(2300, 1808, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   355
  AddGear(2322, 1812, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   356
  AddGear(2323, 1813, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   357
  AddGear(2311, 1811, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   358
  AddGear(2303, 1809, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   359
  AddGear(2287, 1808, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   360
  AddGear(2282, 1808, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   361
  AddGear(2277, 1809, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   362
  AddGear(2296, 1809, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   363
  AddGear(2314, 1818, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
function SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
  SetupAnimAcceptedDied()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   368
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I just wonder where Ramon and Spiky disappeared..."), SAY_THINK, 6000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
function SetupAnimAttacked()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
  SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
  startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
  table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  table.insert(startAnim, {func = AnimTurn, args = {leaks, "Left"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   376
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I wonder where Dense Cloud is..."), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   377
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("He must be in the village already."), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   378
  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'd better get going myself."), SAY_THINK, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
  midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
  table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
  table.insert(midAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
  table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
  table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   385
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   386
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   387
  table.insert(midAnim, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   388
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   389
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death! Muahahaha!"), SAY_SAY, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   390
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
  table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
  table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   393
  table.insert(midAnim, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
  AddSkipFunction(midAnim, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
function SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
  table.insert(startAnimAD, {func = AnimWait, args = {leaks, 3000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7239
diff changeset
   399
  table.insert(startAnimAD, {func = AnimTurn, args = {leaks, "Left"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   400
  table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("I need to get to the other side of this island, fast!"), SAY_THINK, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   401
  table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("With Dense Cloud on the land of shadows, I'm the village's only hope..."), SAY_THINK, 7000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
  table.insert(midAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
  table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   407
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   408
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   409
  table.insert(midAnimAD, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   410
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   411
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"), SAY_SAY, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   412
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
  table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   415
  table.insert(midAnimAD, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
  AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
12548
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   418
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, ClearTrashForPrincessCage, {}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {2299, 1687, 2294, 1841}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
  table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
  table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   426
  table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("You have failed to complete your task, young one!"), SAY_SAY, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   427
  table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("It's time you learned that your actions have consequences!"), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   428
  table.insert(failAnimAD, {func = AnimSay, args = {princess, loc("No! Please, help me!"), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
  table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, KillPrincess, {}}})
12548
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   432
  table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 500}})
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   433
  table.insert(failAnimAD, {func = AnimSay, args = {leaks, loc("No! What have I done?! What have YOU done?!"), SAY_SHOUT, 3000}})
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
   434
  table.insert(failAnimAD, {func = AnimSwitchHog, args = {princess}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
  table.insert(endAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   438
  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {princess, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   439
  table.insert(endAnimAD, {func = AnimSay, args = {princess, loc("Help me, Leaks!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   440
  table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("But you said you'd let her go!"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   441
  table.insert(endAnimAD, {func = AnimSay, args = {cyborg, loc("And you believed me? Oh, god, that's cute!"), SAY_SHOUT, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   442
  table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("I won't let you kill her!"), SAY_SHOUT, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   443
  AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   444
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   445
  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
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
   447
  table.insert(winAnimAD, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   448
  table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, Leaks A Lot!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   449
  table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   450
  table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   451
  table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   452
  table.insert(winAnimAD, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   454
  startAnim = startAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
  midAnim = midAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
  failAnim = failAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
  endAnim = endAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
  winAnim = winAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
function SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
  table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
  table.insert(startAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   464
  table.insert(startAnimAL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 8000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   465
  table.insert(startAnimAL, {func = AnimSay, args = {dense, loc("We have no time to waste..."), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
  table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
  AddSkipFunction(startAnimAL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
  table.insert(pastFlowerAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   471
  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   472
  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   473
  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   477
  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   478
  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("To help you, of course!"), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
  table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  table.insert(pastFlowerAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
  AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
  table.insert(outPitAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
  table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  table.insert(outPitAnimAL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   487
  table.insert(outPitAnimAL, {func = AnimTurn, args = {dense, "Left"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   488
  table.insert(outPitAnimAL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   489
  table.insert(outPitAnimAL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
  table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
  table.insert(outPitAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
  table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
  table.insert(endAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   497
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   502
  table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   503
  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   504
  table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   505
  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   508
  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
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
   510
  table.insert(winAnim, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   511
  table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   512
  table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
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
   513
  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty..."), SAY_SAY, 7000}})
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
   514
  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("... share your beauty with the world every morning, my princess!"), SAY_SAY, 7000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   515
  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   516
  table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  startAnim = startAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
  pastFlowerAnim = pastFlowerAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
  outPitAnim = outPitAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
function SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
  table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
  table.insert(startAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   526
  table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   527
  table.insert(startAnimRL, {func = AnimSay, args = {dense, loc("Dude, can you see Ramon and Spiky?"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   528
  table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("No...I wonder where they disappeared?!"), SAY_SAY, 5000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
  AddSkipFunction(startAnimRL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   530
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   532
  table.insert(pastFlowerAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   533
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   534
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   535
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   538
  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   539
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   540
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You couldn't possibly believe that after refusing my offer I'd just let you go!"), SAY_SAY, 9000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   541
  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You're funny!"), SAY_SAY, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
  table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
  table.insert(pastFlowerAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
  AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
  table.insert(outPitAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
  table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   549
  table.insert(outPitAnimRL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   550
  table.insert(outPitAnimRL, {func = AnimTurn, args = {dense, "Left"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   551
  table.insert(outPitAnimRL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   552
  table.insert(outPitAnimRL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   553
  table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   554
  table.insert(outPitAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   555
  table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   556
  AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   557
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   558
  table.insert(endAnim, {func = AnimCustomFunction, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   559
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   560
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   563
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   565
  table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   566
  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   567
  table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   568
  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   571
  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
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
   573
  table.insert(winAnim, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   574
  table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   575
  table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   576
  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   577
  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   578
  table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   579
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
  startAnim = startAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
  pastFlowerAnim = pastFlowerAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
  outPitAnim = outPitAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   584
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   585
function KillPrincess()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   586
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   588
--/////////////////////////////Misc Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   590
function HideHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   591
  if hedgeHidden[hedge] ~= true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   592
    HideHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   593
    hedgeHidden[hedge] = true
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   594
  end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   595
end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   596
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   597
function RestoreHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   598
  if hedgeHidden[hedge] == true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   599
    RestoreHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   600
    hedgeHidden[hedge] = false
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   601
  end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   602
end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   603
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
function CondNeedToTurn(hog1, hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
  xl, xd = GetX(hog1), GetX(hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
  if xl > xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   608
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
  elseif xl < xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   612
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   613
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   615
function SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   616
  ------ AMMO CRATE LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   617
  SpawnAmmoCrate(3124, 952, amBaseballBat)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   618
  SpawnAmmoCrate(2508, 1110, amFirePunch)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   619
  ------ UTILITY CRATE LIST ------
12517
b1c2b0a8a43e Fix crate types (weapon/utility) in A Classic Fairytale missions
Wuzzy <almikes@aol.com>
parents: 12386
diff changeset
   620
  blowCrate = SpawnAmmoCrate(3675, 1480, amBlowTorch)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   621
  gravityCrate = SpawnUtilityCrate(3448, 1349, amLowGravity)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   622
  SpawnUtilityCrate(3212, 1256, amGirder)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   623
  SpawnUtilityCrate(3113, 911, amParachute)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   624
  sniperCrate = SpawnAmmoCrate(784, 1715, amSniperRifle)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   625
  ------ MINE LIST ------
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   626
  AddGear(3328, 1399, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   627
  AddGear(3028, 1262, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   628
  AddGear(2994, 1274, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   629
  AddGear(2956, 1277, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   630
  AddGear(2925, 1282, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   631
  AddGear(2838, 1276, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   632
  AddGear(2822, 1278, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   633
  AddGear(2786, 1283, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   634
  AddGear(2766, 1270, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   635
  AddGear(2749, 1231, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   636
  AddGear(2717, 1354, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   637
  AddGear(2167, 1330, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   638
  AddGear(2201, 1321, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   639
  AddGear(2239, 1295, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   640
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   641
  AnimSetGearPosition(leaks, 3781, 1583)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   642
  AddAmmo(cannibals[1], amShotgun, 100)
7236
378fc97dae99 Reduced number of crates on the challenge in mission 1, fixed an error with mission 3 (at the end)
belphegorr <szabibibi@gmail.com>
parents: 7228
diff changeset
   643
  AddAmmo(leaks, amSwitch, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   646
function SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   647
  PlaceCratesDuo()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   648
  AnimSetGearPosition(leaks, unpack(startLeaksPosDuo))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   649
  AnimSetGearPosition(dense, unpack(startDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   651
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   652
function SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   653
  AddEvent(CheckPastFlower, {}, DoPastFlower, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   654
  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   655
  AddEvent(CheckDenseDead, {}, DoDenseDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
  AddEvent(CheckTookSniper2, {}, DoTookSniper2, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   657
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   658
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   659
function SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   660
  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
  AddEvent(CheckTookBlowTorch, {}, DoTookBlowTorch, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
  AddEvent(CheckTookLowGravity, {}, DoTookLowGravity, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
  AddEvent(CheckOnBridge, {}, DoOnBridge, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   664
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   666
function StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
  if m2DenseDead == 1 then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
    DeleteGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
      SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   671
    elseif m2Choice == choiceRefused then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   672
      SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   673
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   674
      SetupAnimAttacked()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   675
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   676
    SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
    SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   678
    AddAnim(startAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   679
    AddFunction({func = AfterStartAnim, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   680
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   681
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   682
      SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   683
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   684
      SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   685
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   686
    SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   687
    SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   688
    AddAnim(startAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   689
    AddFunction({func = AfterStartAnim, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   690
  end
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   691
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   692
  HideHedge(princess)
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   693
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   694
    HideHedge(cannibals[i])
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   695
  end
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   696
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   697
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   698
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   699
function SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   700
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   701
  ------ GIRDER LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   702
  PlaceGirder(1091, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   703
  PlaceGirder(1091, 989, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   704
  PlaceGirder(1091, 829, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   705
  PlaceGirder(1091, 669, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   706
  PlaceGirder(1091, 668, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   707
  PlaceGirder(1091, 669, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   708
  PlaceGirder(1088, 667, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   709
  PlaceGirder(1091, 658, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   710
  PlaceGirder(1091, 646, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   711
  PlaceGirder(1091, 607, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   712
  PlaceGirder(1091, 571, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   713
  PlaceGirder(1376, 821, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   714
  PlaceGirder(1145, 1192, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   715
  PlaceGirder(1169, 1076, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   716
  PlaceGirder(1351, 1082, 4)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   717
  PlaceGirder(1469, 987, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   718
  PlaceGirder(1386, 951, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   719
  PlaceGirder(1465, 852, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   720
  PlaceGirder(1630, 913, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   721
  PlaceGirder(1733, 856, 7)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   722
  PlaceGirder(1688, 713, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   723
  PlaceGirder(1556, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   724
  PlaceGirder(1525, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   725
  PlaceGirder(1457, 697, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   726
  PlaceGirder(1413, 700, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   727
  PlaceGirder(1270, 783, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   728
  PlaceGirder(1207, 825, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   729
  PlaceGirder(1135, 775, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   730
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   731
  ------ UTILITY CRATE LIST ------
7228
1b29b8cfb17a Modified some crate positions, added sound to teleports, fixed loc errors...
belphegorr <szabibibi@gmail.com>
parents: 7225
diff changeset
   732
  SpawnUtilityCrate(1590, 628, amParachute)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   733
  SpawnAmmoCrate(1540, 100, amDynamite)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   734
  SpawnUtilityCrate(2175, 1815, amLowGravity)
12517
b1c2b0a8a43e Fix crate types (weapon/utility) in A Classic Fairytale missions
Wuzzy <almikes@aol.com>
parents: 12386
diff changeset
   735
  SpawnAmmoCrate(2210, 1499, amFirePunch)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   736
  girderCrate = SpawnUtilityCrate(2300, 1663, amGirder)
12517
b1c2b0a8a43e Fix crate types (weapon/utility) in A Classic Fairytale missions
Wuzzy <almikes@aol.com>
parents: 12386
diff changeset
   737
  SpawnAmmoCrate(610, 1394, amPickHammer)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   738
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   739
  ------ BARREL LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   740
  SetHealth(AddGear(1148, 736, gtExplosives, 0, 0, 0, 0), 20)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   741
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   742
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   743
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   744
function PlaceCourseMines()
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   745
  AddGear(1215, 1193, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   746
  AddGear(1259, 1199, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   747
  AddGear(1310, 1198, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   748
  AddGear(1346, 1196, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   749
  AddGear(1383, 1192, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   750
  AddGear(1436, 1196, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   751
  AddGear(1487, 1199, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   752
  AddGear(1651, 1209, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   753
  AddGear(1708, 1209, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   754
  AddGear(1759, 1190, gtMine, 0, 0, 0, 0)
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   755
  AddGear(1815, 1184, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   756
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   757
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   758
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   759
--////////////////////////////Event Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   760
function CheckTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   761
  return fireTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   762
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   763
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   764
function DoTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   765
  AddAmmo(leaks, amFirePunch, 100)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   766
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   767
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   768
function CheckDensePit()
12377
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   769
  if GetHealth(dense) ~= nil then
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   770
    return GetY(dense) < 1250 and StoppedGear(dense)
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   771
  else
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   772
    return false
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12268
diff changeset
   773
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   774
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   775
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   776
function DoDensePit()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   777
  EndTurn(0)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   778
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   779
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   780
  AddFunction({func = AddAnim, args = {outPitAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   781
  AddFunction({func = AddFunction, args = {{func = AfterOutPitAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   782
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   783
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   784
function CheckPastFlower()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   785
  if denseDead == true or leaksDead == true then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   786
    return false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   787
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   788
  return (GetX(dense) < startEventXDuo and StoppedGear(dense))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   789
      or (GetX(leaks) < startEventXDuo and StoppedGear(leaks))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   790
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   791
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   792
function DoPastFlower()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   793
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   794
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   795
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   796
  AddFunction({func = AddAnim, args = {pastFlowerAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   797
  AddFunction({func = AddFunction, args = {{func = AfterPastFlowerAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   798
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   799
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   800
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   801
function CheckLeaksDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   802
  return leaksDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   803
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   804
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   805
function DoLeaksDead()
12384
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   806
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   807
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   808
    AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   809
    DismissTeam(loc("Natives"))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   810
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   811
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   812
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   813
function CheckDenseDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   814
  return denseDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   815
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   816
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   817
function DoDenseDead()
12384
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   818
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   819
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   820
    AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   821
    DismissTeam(loc("Natives"))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   822
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   823
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   824
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   825
function CheckTookBlowTorch()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   826
  return blowTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   827
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   828
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   829
function DoTookBlowTorch()
12386
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   830
  ShowMission(loc("The Journey Back"), loc("The Tunnel Maker"), 
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   831
    loc("Get past the flower.").."|"..
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   832
    loc("Hint: Select the blow torch, aim and press [Fire]. Press [Fire] again to stop.").."|"..
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   833
    loc("Don't blow up the crate."), 0, 6000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   834
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   835
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   836
function CheckTookLowGravity()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   837
  return gravityTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   838
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   839
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   840
function DoTookLowGravity()
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   841
  ShowMission(loc("The Journey Back"), loc("The Moonwalk"),
12386
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   842
    loc("Hop on top of the next flower and advance to the left coast.").."|"..
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   843
    loc("Hint: Select the low gravity and press [Fire].") .. "|" ..
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   844
    loc("Beware of mines: They explode after 3 seconds."), 0, 6000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   845
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   846
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   847
function CheckOnBridge()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   848
  return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   849
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   850
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   851
function DoOnBridge()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   852
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   853
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   854
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   855
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   856
  AddFunction({func = AddAnim, args = {midAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   857
  AddFunction({func = AddFunction, args = {{func = AfterMidAnimAlone, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   858
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   859
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   860
function CheckOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   861
  return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   862
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   863
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   864
function DoOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   865
  PlaceCourseMines()
12386
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   866
  ShowMission(loc("The Journey Back"), loc("Slippery"), 
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   867
    loc("Collect the weapon crate at the left coast!") .. "|" ..
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12385
diff changeset
   868
    loc("You'd better watch your steps..."), 0, 4000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   869
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   870
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   871
function CheckTookSniper()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   872
  return sniperTaken and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   873
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   874
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   875
function DoTookSniper()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   876
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   877
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   878
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   879
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   880
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   881
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimAlone, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   882
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   883
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   884
function CheckTookSniper2()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   885
  return sniperTaken and StoppedGear(leaks) and StoppedGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   886
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   887
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   888
function DoTookSniper2()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   889
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   890
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   891
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   892
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   893
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   894
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimDuo, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   895
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   896
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   897
function CheckLost()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   898
  return princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   899
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   900
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   901
function DoLost()
12384
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   902
  if not cyborgDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   903
    SwitchHog(cyborg)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   904
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   905
  AddAnim(endFailAnim)
12384
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   906
  AddFunction({func = DismissTeam, args = {loc("Natives")}})
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12383
diff changeset
   907
  AddFunction({func = EndTurn, args = {true}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   908
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   909
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   910
function CheckWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   911
  return cyborgDead and not princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   912
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   913
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   914
function DoWon()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   915
  victory = true
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   916
  if progress and progress<3 then
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   917
    SaveCampaignVar("Progress", "3")
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   918
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   919
  AddAnim(winAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   920
  AddFunction({func = FinishWon, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   921
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   922
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   923
function FinishWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   924
  SwitchHog(leaks)
10290
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
   925
  DismissTeam(loc("Cannibal Sentry"))
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
   926
  DismissTeam(loc("011101001"))
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   927
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   928
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   929
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   930
function CheckFailedCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   931
  return TurnsLeft == 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   932
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   933
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   934
function DoFailedCourse()
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   935
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   936
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   937
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   938
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   939
  AddFunction({func = AddAnim, args = {failAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   940
  AddFunction({func = AddFunction, args = {{func = AfterMidFailAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   941
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   942
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   943
--////////////////////////////Main Functions/////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   944
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   945
function onGameInit()
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   946
  progress = tonumber(GetCampaignVar("Progress"))
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   947
  m2Choice = tonumber(GetCampaignVar("M2Choice"))
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   948
  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   949
  m2RamonDead = tonumber(GetCampaignVar("M2RamonDead"))
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   950
  m2SpikyDead = tonumber(GetCampaignVar("M2SpikyDead"))
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   951
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   952
	Seed = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   953
	GameFlags = gfSolidLand + gfDisableWind
7239
598fe796dd01 Increased turn time to 40
belphegorr <szabibibi@gmail.com>
parents: 7236
diff changeset
   954
	TurnTime = 40000 
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   955
	CaseFreq = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   956
	MinesNum = 0
12385
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   957
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   958
	if m2DenseDead == 1 then
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   959
		MinesTime = 3000
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   960
	else
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   961
		MinesTime = 5000
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12384
diff changeset
   962
	end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   963
	Explosives = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   964
	Delay = 5
8979
860836494821 Package the 3 dynamic maps broken by recent uFloat changes as static maps. first_blood actually didn't seem to need it, but, just in case.
nemo
parents: 8944
diff changeset
   965
    Map = "A_Classic_Fairytale_journey"
860836494821 Package the 3 dynamic maps broken by recent uFloat changes as static maps. first_blood actually didn't seem to need it, but, just in case.
nemo
parents: 8944
diff changeset
   966
    Theme = "Nature"
860836494821 Package the 3 dynamic maps broken by recent uFloat changes as static maps. first_blood actually didn't seem to need it, but, just in case.
nemo
parents: 8944
diff changeset
   967
12229
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   968
    -- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   969
    HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12054
diff changeset
   970
    WaterRise = 0
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   971
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   972
	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   973
	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   974
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   975
12559
194b00c4ba07 ACF: Use skull grave for cannibal teams (for real)
Wuzzy <almikes@aol.com>
parents: 12548
diff changeset
   976
  AddTeam(loc("Cannibal Sentry"), 14483456, "skull", "Island", "Pirate","cm_vampire")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   977
  cannibals = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   978
  for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   979
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   980
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   981
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   982
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   983
  for i = 5, 8 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   984
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   985
    AnimSetGearPosition(cannibals[i], 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   986
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   987
12054
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   988
  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_binary")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   989
  cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   990
  princess = AddHog(loc("Fell From Heaven"), 0, 200, "tiara")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   991
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   992
  AnimSetGearPosition(dense, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   993
  AnimSetGearPosition(leaks, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   994
  AnimSetGearPosition(cyborg, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   995
  AnimSetGearPosition(princess, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   996
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   997
  AnimInit()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   998
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   999
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1000
function onGameStart()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1001
  StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1002
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1003
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1004
function onGameTick()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1005
  AnimUnWait()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1006
  if ShowAnimation() == false then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1007
    return
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1008
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1009
  ExecuteAfterAnimations()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1010
  CheckEvents()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1011
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1012
12548
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1013
-- Track gears for princess cage cleanup
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1014
function onGearAdd(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1015
  local gt = GetGearType(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1016
  if gt == gtCase or gt == gtMine then
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1017
    trackedGears[gear] = true
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1018
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1019
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1020
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1021
function onGearDelete(gear)
12548
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1022
  if trackedGears[gear] then
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1023
    trackedGears[gear] = nil
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12547
diff changeset
  1024
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1025
  if gear == blowCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1026
    blowTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1027
  elseif gear == fireCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1028
    fireTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1029
  elseif gear == gravityCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1030
    gravityTaken = true
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1031
  elseif gear == leaks and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1032
    leaksDead = true
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1033
  elseif gear == dense and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1034
    denseDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1035
  elseif gear == cyborg then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1036
    cyborgDead = true
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1037
  elseif gear == princess and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1038
    princessDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1039
  elseif gear == sniperCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1040
    sniperTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1041
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1042
    for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1043
      if gear == cannibals[i] then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1044
        cannibalDead[i] = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1045
      end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1046
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1047
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1048
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1049
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1050
function onAmmoStoreInit()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1051
  SetAmmo(amBlowTorch, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1052
  SetAmmo(amParachute, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1053
  SetAmmo(amGirder, 0, 0, 0, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1054
  SetAmmo(amLowGravity, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1055
  SetAmmo(amBaseballBat, 0, 0, 0, 1)
7524
a98ce9191832 Mission 3: Added initial FirePunch
belphegorr <szabibibi@gmail.com>
parents: 7514
diff changeset
  1056
  SetAmmo(amFirePunch, 1, 0, 0, 1)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1057
  SetAmmo(amSkip, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1058
  SetAmmo(amSwitch, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1059
  SetAmmo(amDEagle, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1060
  SetAmmo(amRope, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1061
  SetAmmo(amSniperRifle, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1062
  SetAmmo(amDynamite, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1063
  SetAmmo(amPickHammer, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1064
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1065
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1066
function onNewTurn()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1067
  if AnimInProgress() then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1068
    TurnTimeLeft = -1
12380
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1069
  elseif victory then
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1070
    EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1071
  elseif stage == endStage and CurrentHedgehog ~= leaks then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1072
    AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1073
    SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1074
    TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1075
  elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1076
    for i = 1, 4 do
12378
b43c00e36369 ACF, mission 3: Fix Lua error when Leaks a Lot dies at the beginning
Wuzzy <almikes@aol.com>
parents: 12377
diff changeset
  1077
      if cannibalDead[i] ~= true and leaksDead ~= true then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1078
        if GetX(cannibals[i]) < GetX(leaks) then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1079
          HogTurnLeft(cannibals[i], false)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1080
        else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1081
          HogTurnLeft(cannibals[i], true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1082
        end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1083
      end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1084
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1085
    SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
  1086
    TurnTimeLeft = 20000
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1087
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1088
    SetInputMask(0xFFFFFFFF)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1089
    TurnsLeft = TurnsLeft - 1
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1090
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1091
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1092
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1093
function onPrecise()
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1094
  if GameTime > 2500 and AnimInProgress() then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1095
    SetAnimSkip(true)
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1096
    return
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1097
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1098
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1099