share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 09 Feb 2018 07:41:37 +0100
changeset 12934 bc7138add7eb
parent 12933 e65aa3c3d4e6
child 13142 39aa98d01e80
permissions -rw-r--r--
2 minor spelling/grammar fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12794
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     1
--[[
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     2
A Classic Fairytale: The Journey Back
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     3
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     4
= SUMMARY =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     5
This is a very complex and heavily scripted mission with
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     6
2 major gameplay variants and 2 sub-variants each.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     7
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     8
This mission is mostly about movement and overcoming obstacles,
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
     9
and not much about fighting.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    10
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    11
The player has either 1 or 2 hogs (depending on previous mission)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    12
and must reach the left coast. The cyborg will show up from time
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    13
to time and constantly annoys the heroes with obstacles and additional
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    14
challenges.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    15
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    16
The mission's gameplay is affected by whether Dense Cloud survived
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    17
in the previous mission. The mission's dialogues are affected by
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    18
the decision of the player in the previous mission.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    19
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    20
= GOALS =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    21
- Collect the crate at the left coast
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    22
- (Need to accomplish various sub-goals before this is possible)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    23
- Then kill the cyborg
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    24
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    25
= FLOW CHART =
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    26
== Linear events ==
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    27
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    28
Note: This mission's gameplay is significantly affected by the choices of the previous mission (The Shadow Falls).
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    29
There are two major paths, and each of them has two variants.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    30
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    31
=== PATH ONE (AL) ===
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    32
Condition: Cyborg's offer in ACF2 accepted and Dense Cloud survived.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    33
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    34
- Mission starts with Dense Cloud and Leaks a Lot
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    35
- Mines time: 5s
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    36
- Cut scene: startAnimAL (initial instructions)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    37
- Hog moves past flower (via teamwork)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    38
- Animation: pastFlowerAnimAL
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    39
- Player jumps up the tree
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    40
- Cut scene: outPutAnimAL
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    41
- Cyborg teleports one hog to the pit, while the other hog remains
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    42
- TBS
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    43
- Trapped hog walks out of pit
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    44
- Cut scene: midAnimAL
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    45
- Trapped hog is teleported below bridge (and trapped again)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    46
- A huge barricade at the bridge is erected, and mines spawn on bridge
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    47
- Now any hog needs to collect the final crate
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    48
- TBS
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    49
- Final crate collected
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    50
- Cut scene: endAnimAL
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    51
- Cyborg and princess apear, player must kill cyborg
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    52
| Cyborg killed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    53
    - Cut scene: winAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    54
    > Victory
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    55
| Princess killed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    56
    - Cut scene: endFailAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    57
    > Game over
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    58
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    59
=== PATH TWO (AD) ===
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    60
Condition: Cyborg's offer in ACF2 accepted, but Dense Cloud died afterwards.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    61
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    62
- Mission starts with Leaks a Lot only
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    63
- Cut scene: startAnimAD (initial instructions)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    64
- Hog moves past flower (via blowtorch)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    65
- Animation: pastFlowerAnimAD
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    66
- TBS
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    67
- Hog proceeds all the way to the bridge
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    68
- Cut scene: outPutAnimAD (the “Princess Game”)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    69
- Hog is teleported to the pit
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    70
- TBS
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    71
- Hog must reach goal crate within a given number of turns
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    72
| Hog reaches goal crate within the turn limit
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    73
    - Cut scene: endAnimAD
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    74
    - Cyborg and princess spawn
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    75
    | Cyborg killed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    76
        - Cut scene: winAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    77
        > Victory
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    78
    | Princess killed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    79
        - Cut scene: endFailAnim
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    80
        > Game over
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    81
| Turn limit exceeded
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    82
    - Cut scene: failAnimAD (princess is caged and killed by cyborg)
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    83
    > Game over
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    84
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    85
=== PATH THREE (RL) ===
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    86
Condition: Cyborg's offer in ACF2 rejected.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    87
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    88
This is almost identical to Path One, only the dialogues differ.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    89
All AL animations are replaced with RL animations.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    90
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    91
=== PATH FOUR (attacked) ===
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    92
Condition: Cyborg from ACF2 was attacked.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    93
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    94
This is almost identical to Path Two, only the dialogues differ.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    95
Uses startAnim and midAnim from SetupAnimAttacked.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    96
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    97
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    98
== Non-linear events ==
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
    99
- Any of the Natives dies
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
   100
   > Game over
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
   101
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
   102
]]
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12554
diff changeset
   103
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7524
diff changeset
   104
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7524
diff changeset
   105
HedgewarsScriptLoad("/Scripts/Animate.lua")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   106
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   107
--///////////////////////////////CONSTANTS///////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
7219
6c7739c6446f Set the choice constants to the correct values (1-3 instead of 0-2).
belphegorr <szabibibi@gmail.com>
parents: 7217
diff changeset
   109
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
   110
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
   111
choiceAttacked = 3
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
endStage = 1
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
cannibalNum = 8
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   116
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
   117
                 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
   118
cannibalPos = {{2471, 1174}, {939, 1019}, {1953, 902}, {3055, 1041},
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
               {1121, 729}, {1150, 718}, {1149, 680}, {1161, 773}}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
startLeaksPosDuo = {3572, 1426}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
startEventXDuo = 3300
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
startDensePosDuo = {3454, 1471}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
startCyborgPosDuo = {3202, 1307}
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   125
midDensePosDuo = {1464, 1410}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
midCyborgPosDuo = {1264, 1390}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
--///////////////////////////////VARIABLES///////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   130
m2Choice = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   131
m2DenseDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   132
m2RamonDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
m2SpikyDead = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   134
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
TurnsLeft = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   136
stage = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
blowTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   139
fireTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   140
gravityTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
sniperTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
leaksDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
denseDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
princessDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
cyborgDead = false
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   146
victory = false
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
cannibalDead = {}
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   148
hedgeHidden = {}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   151
startAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   152
startAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
startAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   155
pastFlowerAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
pastFlowerAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
pastFlowerAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
outPitAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
outPitAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
outPitAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
midAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
failAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
failAnimAD = {}
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
endAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
endAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
endAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
endAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
endFailAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
winAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
winAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
--/////////////////////////Animation Functions///////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
function AfterMidFailAnim()
10290
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
   181
  DismissTeam(loc("Natives"))
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   182
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   185
function AfterMidAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
  SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   188
    RestoreHedge(cannibals[i])
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   189
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   192
  AddAmmo(cannibals[5], amDEagle, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   194
  AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   195
  AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   196
  AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
  TurnsLeft = 12
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  TurnTimeLeft = TurnTime
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   200
  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: 12379
diff changeset
   201
    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: 12379
diff changeset
   202
    loc("Mines time: 3 seconds"), 0, 6000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
  -----------------------///////////////------------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
function SkipEndAnimAlone()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   207
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   208
  RestoreHedge(princess)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   209
  AnimSetGearPosition(cyborg, 437, 1700)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   210
  AnimSetGearPosition(princess, 519, 1722)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   211
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   212
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
function SkipEndAnimDuo()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   214
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   215
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
  if princessHidden then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   217
    RestoreHog(princess)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
    princessHidden = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   219
  end
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   220
  AnimSetGearPosition(cyborg, 437, 1700)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   221
  AnimSetGearPosition(princess, 519, 1722)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   222
  AnimSetGearPosition(leaks, 763, 1760)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   223
  AnimSetGearPosition(dense, 835, 1519)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
  HogTurnLeft(leaks, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
  HogTurnLeft(dense, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
function AfterEndAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   229
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   230
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   233
  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
   234
  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
   235
  AddEvent(CheckWon, {}, DoWon, {}, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
  RemoveEventFunc(CheckFailedCourse)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   239
function AfterEndAnimDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   240
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   241
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   242
  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
   243
  SetGearMessage(dense, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   245
  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
   246
  AddEvent(CheckLost, {}, DoLost, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
  AddEvent(CheckWon, {}, DoWon, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   250
function SkipMidAnimAlone()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   251
  AnimSetGearPosition(leaks, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   252
  AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
  SetInputMask(0xFFFFFFFF)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   254
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   255
  AddFunction({func = HideHedge, args = {princess}})
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   256
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   258
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
function AfterStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   260
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
  TurnTimeLeft = TurnTime
12934
bc7138add7eb 2 minor spelling/grammar fixes
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   262
  local goal = loc("Get the crate on the other side of the island.")
12901
bdf8e80a97b8 Fix some minor formatting and grammar flaws in script strings
Wuzzy <Wuzzy2@mail.ru>
parents: 12797
diff changeset
   263
  local hint = loc("Hint: You might want to stay out of sight and take all the crates ...")
bdf8e80a97b8 Fix some minor formatting and grammar flaws in script strings
Wuzzy <Wuzzy2@mail.ru>
parents: 12797
diff changeset
   264
  local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   265
  local conds = loc("Leaks A Lot must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  if m2DenseDead == 0 then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   267
    conds = loc("Your hogs must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
  end
12901
bdf8e80a97b8 Fix some minor formatting and grammar flaws in script strings
Wuzzy <Wuzzy2@mail.ru>
parents: 12797
diff changeset
   269
  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
   270
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
function SkipStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
  AnimSwitchHog(leaks)
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 PlaceCratesDuo()
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   277
  SpawnSupplyCrate(3090, 827, amBaseballBat)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   278
  girderCrate1 = SpawnSupplyCrate(2466, 1814, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   279
  girderCrate2 = SpawnSupplyCrate(2630, 1278, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   280
  SpawnSupplyCrate(2422, 1810, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   281
  SpawnSupplyCrate(3157, 1009, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   282
  sniperCrate = SpawnSupplyCrate(784, 1715, amSniperRifle)
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 PlaceMinesDuo()
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   286
  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: 12379
diff changeset
   287
  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: 12379
diff changeset
   288
  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: 12379
diff changeset
   289
  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: 12379
diff changeset
   290
  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: 12379
diff changeset
   291
  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: 12379
diff changeset
   292
  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: 12379
diff changeset
   293
  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: 12379
diff changeset
   294
  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: 12379
diff changeset
   295
  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: 12379
diff changeset
   296
  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: 12379
diff changeset
   297
  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: 12379
diff changeset
   298
  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: 12379
diff changeset
   299
  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: 12379
diff changeset
   300
  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: 12379
diff changeset
   301
  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: 12379
diff changeset
   302
  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: 12379
diff changeset
   303
  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: 12379
diff changeset
   304
  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: 12379
diff changeset
   305
  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: 12379
diff changeset
   306
  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: 12379
diff changeset
   307
  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: 12379
diff changeset
   308
  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: 12379
diff changeset
   309
  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: 12379
diff changeset
   310
  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: 12379
diff changeset
   311
  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: 12379
diff changeset
   312
  AddGear(1519, 1213, gtMine, 0, 0, 0, 0)
7215
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
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
function AfterPastFlowerAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
  PlaceMinesDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
  AddEvent(CheckDensePit, {}, DoDensePit, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
  SetGearMessage(dense, 0)
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   320
  EndTurn(0)
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   321
  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: 12379
diff changeset
   322
    loc("Get Dense Cloud out of the pit!") .. "|" ..
12381
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12380
diff changeset
   323
    loc("Your hogs must survive!") .. "|" ..
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   324
    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
   325
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
function SkipPastFlowerAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   328
  AnimSetGearPosition(dense, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   330
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   331
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
function AfterOutPitAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
  SetupCourseDuo()
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   336
  RestoreHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   337
  AddAmmo(cannibals[5], amDEagle, 0)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   338
  HideHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
  AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
  SetGearMessage(dense, 0)
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   342
  EndTurn(true)
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   343
  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: 12379
diff changeset
   344
    loc("Free Dense Cloud and continue the mission!") .. "|" ..
12381
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12380
diff changeset
   345
    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: 12380
diff changeset
   346
    loc("Your hogs must survive!") .. "|" ..
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   347
    loc("Mines time: 5 seconds"), 1, 5000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   348
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
function SkipOutPitAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   351
  AnimSetGearPosition(dense, unpack(midDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   352
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   353
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   354
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
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
   358
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   359
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
  AnimOutOfNowhere(cyborg, x, y)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
  AnimOutOfNowhere(princess, xx, yy)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
  HogTurnLeft(princess, false)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
  return true
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 RestoreCyborgOnly(x, y)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   367
  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
   368
  SetState(cyborg, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
  AnimOutOfNowhere(cyborg, x, y)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
function TargetPrincess()
10289
c3a77ff02a23 lua api: SetWeapon(ammoType)
sheepluva
parents: 9308
diff changeset
   374
  SetWeapon(amDEagle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  SetGearMessage(cyborg, gmUp)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   378
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
function HideCyborg()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   380
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   381
  HideHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
function HideCyborgOnly()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   385
  HideHedge(cyborg)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   387
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
function SetupKillRoom()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
  PlaceGirder(2342, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
  PlaceGirder(2294, 1783, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
  PlaceGirder(2245, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
function SetupCourseDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
  PlaceGirder(1083, 1152, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
  PlaceGirder(1087, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
  PlaceGirder(1133, 1155, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
  PlaceGirder(1135, 1152, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
  PlaceGirder(1135, 1078, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
  PlaceGirder(1087, 1016, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  PlaceGirder(1018, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
  PlaceGirder(1016, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  PlaceGirder(962, 782, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
  PlaceGirder(962, 662, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  PlaceGirder(962, 661, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
  PlaceGirder(962, 650, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  PlaceGirder(962, 630, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  PlaceGirder(1033, 649, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
  PlaceGirder(952, 650, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   411
  fireCrate = SpawnSupplyCrate(1846, 1100, amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   412
  SpawnSupplyCrate(1900, 1100, amPickHammer)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   413
  SpawnSupplyCrate(950, 674, amDynamite)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   414
  SpawnSupplyCrate(994, 825, amRope)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   415
  SpawnSupplyCrate(570, 1357, amLowGravity)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   417
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   418
local trackedGears = {}
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   419
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   420
-- 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: 12542
diff changeset
   421
-- 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: 12542
diff changeset
   422
-- 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: 12542
diff changeset
   423
function ClearTrashForPrincessCage()
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   424
  for gear, _ in pairs(trackedGears) do
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   425
    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: 12542
diff changeset
   426
      DeleteGear(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   427
    end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   428
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   429
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   430
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   431
-- Dump mines in princess cage
12905
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   432
function DumpMines(t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   433
  if not t then
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   434
    t = 0
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   435
  end
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   436
  AddGear(2261, 1835, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   437
  AddGear(2280, 1831, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   438
  AddGear(2272, 1809, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   439
  AddGear(2290, 1815, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   440
  AddGear(2278, 1815, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   441
  AddGear(2307, 1811, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   442
  AddGear(2286, 1820, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   443
  AddGear(2309, 1813, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   444
  AddGear(2303, 1822, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   445
  AddGear(2317, 1827, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   446
  AddGear(2312, 1816, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   447
  AddGear(2316, 1812, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   448
  AddGear(2307, 1802, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   449
  AddGear(2276, 1818, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   450
  AddGear(2284, 1816, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   451
  AddGear(2292, 1811, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   452
  AddGear(2295, 1814, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   453
  AddGear(2306, 1811, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   454
  AddGear(2292, 1815, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   455
  AddGear(2314, 1815, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   456
  AddGear(2286, 1813, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   457
  AddGear(2275, 1813, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   458
  AddGear(2269, 1814, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   459
  AddGear(2273, 1812, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   460
  AddGear(2300, 1808, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   461
  AddGear(2322, 1812, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   462
  AddGear(2323, 1813, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   463
  AddGear(2311, 1811, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   464
  AddGear(2303, 1809, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   465
  AddGear(2287, 1808, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   466
  AddGear(2282, 1808, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   467
  AddGear(2277, 1809, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   468
  AddGear(2296, 1809, gtMine, 0, 0, 0, t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   469
  AddGear(2314, 1818, gtMine, 0, 0, 0, t)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   471
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
function SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
  SetupAnimAcceptedDied()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   474
  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
   475
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
function SetupAnimAttacked()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
  SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
  startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
  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
   482
  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
   483
  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
   484
  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
   485
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
  table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
  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
   489
  table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
  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
   491
  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
   492
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
12903
9e7c1d5eec73 String cleanup: Double/triple exclamation marks
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   493
  table.insert(midAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   494
  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
   495
  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
   496
  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
   497
  table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
  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
   499
  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
   500
  AddSkipFunction(midAnim, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
function SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
  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
   505
  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
   506
  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
   507
  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
   508
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
  table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
  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
   511
  table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
  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
   513
  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
   514
  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
12903
9e7c1d5eec73 String cleanup: Double/triple exclamation marks
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   515
  table.insert(midAnimAD, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   516
  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
   517
  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
   518
  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
   519
  table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
  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
   521
  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
   522
  AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   524
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, ClearTrashForPrincessCage, {}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
  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
   526
  table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   527
  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   528
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   530
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
  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
   532
  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
   533
  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
   534
  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
   535
  table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, KillPrincess, {}}})
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   538
  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: 12542
diff changeset
   539
  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: 12542
diff changeset
   540
  table.insert(failAnimAD, {func = AnimSwitchHog, args = {princess}})
12905
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   541
  AddSkipFunction(failAnimAD, SkipFailAnimAlone, {})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
  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
   544
  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
  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
   546
  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
   547
  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
   548
  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
   549
  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
   550
  AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   551
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   552
  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
   553
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
   554
  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
   555
  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
   556
  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
   557
  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
   558
  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
   559
  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
   560
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
  startAnim = startAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
  midAnim = midAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   563
  failAnim = failAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
  endAnim = endAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   565
  winAnim = winAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   566
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   567
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   568
function SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
  table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
  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
   571
  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
   572
  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
   573
  table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
  AddSkipFunction(startAnimAL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
  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
   577
  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
   578
  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
   579
  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
   580
  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
   581
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
  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
   584
  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
   585
  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
   586
  table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
  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
   588
  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
  AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   590
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   591
  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
   592
  table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
  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
   594
  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
   595
  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
   596
  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
   597
  table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   598
  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
   599
  table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   600
  AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   601
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   602
  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
   603
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   608
  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
   609
  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
   610
  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
   611
  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
   612
  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
   613
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   615
  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
   616
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
   617
  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
   618
  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
   619
  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
   620
  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
   621
  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
   622
  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
   623
  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
   624
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   625
  startAnim = startAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   626
  pastFlowerAnim = pastFlowerAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   627
  outPitAnim = outPitAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   628
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   629
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   630
function SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
  table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
  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
   633
  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
   634
  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
   635
  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
   636
  AddSkipFunction(startAnimRL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   637
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
  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
   639
  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
   640
  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
   641
  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
   642
  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
   643
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
  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
   646
  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
   647
  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
   648
  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
   649
  table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
  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
   651
  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   652
  AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   653
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   654
  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
   655
  table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
  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
   657
  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
   658
  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
   659
  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
   660
  table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
  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
   662
  table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
  AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   664
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
  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
   666
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   671
  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
   672
  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
   673
  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
   674
  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
   675
  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
   676
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   678
  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
   679
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
   680
  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
   681
  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
   682
  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
   683
  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
   684
  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
   685
  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
   686
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   687
  startAnim = startAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   688
  pastFlowerAnim = pastFlowerAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   689
  outPitAnim = outPitAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   690
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   691
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   692
function KillPrincess()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   693
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   694
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   695
--/////////////////////////////Misc Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   696
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   697
function HideHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   698
  if hedgeHidden[hedge] ~= true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   699
    HideHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   700
    hedgeHidden[hedge] = true
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   701
  end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   702
end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   703
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   704
function RestoreHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   705
  if hedgeHidden[hedge] == true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   706
    RestoreHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   707
    hedgeHidden[hedge] = false
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   708
  end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   709
end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   710
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   711
function CondNeedToTurn(hog1, hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   712
  xl, xd = GetX(hog1), GetX(hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   713
  if xl > xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   714
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   715
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   716
  elseif xl < xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   717
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   718
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   719
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   720
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   721
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   722
function SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   723
  ------ AMMO CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   724
  SpawnSupplyCrate(3124, 952, amBaseballBat)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   725
  SpawnSupplyCrate(2508, 1110, amFirePunch)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   726
  ------ UTILITY CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   727
  blowCrate = SpawnSupplyCrate(3675, 1480, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   728
  gravityCrate = SpawnSupplyCrate(3448, 1349, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   729
  SpawnSupplyCrate(3212, 1256, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   730
  SpawnSupplyCrate(3113, 911, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   731
  sniperCrate = SpawnSupplyCrate(784, 1715, amSniperRifle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   732
  ------ MINE LIST ------
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   733
  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: 12379
diff changeset
   734
  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: 12379
diff changeset
   735
  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: 12379
diff changeset
   736
  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: 12379
diff changeset
   737
  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: 12379
diff changeset
   738
  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: 12379
diff changeset
   739
  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: 12379
diff changeset
   740
  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: 12379
diff changeset
   741
  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: 12379
diff changeset
   742
  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: 12379
diff changeset
   743
  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: 12379
diff changeset
   744
  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: 12379
diff changeset
   745
  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: 12379
diff changeset
   746
  AddGear(2239, 1295, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   747
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   748
  AnimSetGearPosition(leaks, 3781, 1583)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   749
  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
   750
  AddAmmo(leaks, amSwitch, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   751
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   752
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   753
function SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   754
  PlaceCratesDuo()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   755
  AnimSetGearPosition(leaks, unpack(startLeaksPosDuo))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   756
  AnimSetGearPosition(dense, unpack(startDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   757
end
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
function SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   760
  AddEvent(CheckPastFlower, {}, DoPastFlower, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   761
  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   762
  AddEvent(CheckDenseDead, {}, DoDenseDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   763
  AddEvent(CheckTookSniper2, {}, DoTookSniper2, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   764
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   765
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   766
function SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   767
  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   768
  AddEvent(CheckTookBlowTorch, {}, DoTookBlowTorch, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   769
  AddEvent(CheckTookLowGravity, {}, DoTookLowGravity, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   770
  AddEvent(CheckOnBridge, {}, DoOnBridge, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   771
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   772
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   773
function StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   774
  if m2DenseDead == 1 then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   775
    DeleteGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   776
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   777
      SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   778
    elseif m2Choice == choiceRefused then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   779
      SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   780
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   781
      SetupAnimAttacked()
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
    SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   784
    SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   785
    AddAnim(startAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   786
    AddFunction({func = AfterStartAnim, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   787
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   788
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   789
      SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   790
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   791
      SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   792
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   793
    SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   794
    SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   795
    AddAnim(startAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   796
    AddFunction({func = AfterStartAnim, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   797
  end
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   798
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   799
  HideHedge(princess)
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   800
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   801
    HideHedge(cannibals[i])
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   802
  end
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   803
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   804
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   805
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   806
function SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   807
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   808
  ------ GIRDER LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   809
  PlaceGirder(1091, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   810
  PlaceGirder(1091, 989, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   811
  PlaceGirder(1091, 829, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   812
  PlaceGirder(1091, 669, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   813
  PlaceGirder(1091, 668, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   814
  PlaceGirder(1091, 669, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   815
  PlaceGirder(1088, 667, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   816
  PlaceGirder(1091, 658, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   817
  PlaceGirder(1091, 646, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   818
  PlaceGirder(1091, 607, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   819
  PlaceGirder(1091, 571, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   820
  PlaceGirder(1376, 821, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   821
  PlaceGirder(1145, 1192, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   822
  PlaceGirder(1169, 1076, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   823
  PlaceGirder(1351, 1082, 4)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   824
  PlaceGirder(1469, 987, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   825
  PlaceGirder(1386, 951, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   826
  PlaceGirder(1465, 852, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   827
  PlaceGirder(1630, 913, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   828
  PlaceGirder(1733, 856, 7)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   829
  PlaceGirder(1688, 713, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   830
  PlaceGirder(1556, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   831
  PlaceGirder(1525, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   832
  PlaceGirder(1457, 697, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   833
  PlaceGirder(1413, 700, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   834
  PlaceGirder(1270, 783, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   835
  PlaceGirder(1207, 825, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   836
  PlaceGirder(1135, 775, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   837
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   838
  ------ UTILITY CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   839
  SpawnSupplyCrate(1590, 628, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   840
  SpawnSupplyCrate(1540, 100, amDynamite)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   841
  SpawnSupplyCrate(2175, 1815, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   842
  SpawnSupplyCrate(2210, 1499, amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   843
  girderCrate = SpawnSupplyCrate(2300, 1663, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   844
  SpawnSupplyCrate(610, 1394, amPickHammer)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   845
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   846
  ------ BARREL LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   847
  SetHealth(AddGear(1148, 736, gtExplosives, 0, 0, 0, 0), 20)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   848
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 PlaceCourseMines()
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   852
  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: 12379
diff changeset
   853
  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: 12379
diff changeset
   854
  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: 12379
diff changeset
   855
  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: 12379
diff changeset
   856
  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: 12379
diff changeset
   857
  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: 12379
diff changeset
   858
  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: 12379
diff changeset
   859
  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: 12379
diff changeset
   860
  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: 12379
diff changeset
   861
  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: 12379
diff changeset
   862
  AddGear(1815, 1184, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   863
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   864
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   865
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   866
--////////////////////////////Event Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   867
function CheckTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   868
  return fireTaken
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 DoTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   872
  AddAmmo(leaks, amFirePunch, 100)
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 CheckDensePit()
12372
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   876
  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: 12263
diff changeset
   877
    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: 12263
diff changeset
   878
  else
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   879
    return false
35e76306b016 ACF, mission 3: Fix Lua error spam when Dense Cloud dies in the pit sequence
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   880
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   881
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   882
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   883
function DoDensePit()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   884
  EndTurn(0)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   885
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   886
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   887
  AddFunction({func = AddAnim, args = {outPitAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   888
  AddFunction({func = AddFunction, args = {{func = AfterOutPitAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   889
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   890
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   891
function CheckPastFlower()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   892
  if denseDead == true or leaksDead == true then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   893
    return false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   894
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   895
  return (GetX(dense) < startEventXDuo and StoppedGear(dense))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   896
      or (GetX(leaks) < startEventXDuo and StoppedGear(leaks))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   897
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   898
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   899
function DoPastFlower()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   900
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   901
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   902
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   903
  AddFunction({func = AddAnim, args = {pastFlowerAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   904
  AddFunction({func = AddFunction, args = {{func = AfterPastFlowerAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   905
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   906
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   907
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   908
function CheckLeaksDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   909
  return leaksDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   910
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   911
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   912
function DoLeaksDead()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   913
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   914
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   915
    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: 12378
diff changeset
   916
    DismissTeam(loc("Natives"))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   917
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   918
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   919
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   920
function CheckDenseDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   921
  return denseDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   922
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   923
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   924
function DoDenseDead()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   925
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   926
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   927
    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: 12378
diff changeset
   928
    DismissTeam(loc("Natives"))
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   929
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   930
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   931
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   932
function CheckTookBlowTorch()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   933
  return blowTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   934
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   935
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   936
function DoTookBlowTorch()
12381
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12380
diff changeset
   937
  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: 12380
diff changeset
   938
    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: 12380
diff changeset
   939
    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: 12380
diff changeset
   940
    loc("Don't blow up the crate."), 0, 6000)
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
function CheckTookLowGravity()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   944
  return gravityTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   945
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   946
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   947
function DoTookLowGravity()
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   948
  ShowMission(loc("The Journey Back"), loc("The Moonwalk"),
12381
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12380
diff changeset
   949
    loc("Hop on top of the next flower and advance to the left coast.").."|"..
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
   950
    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: 12379
diff changeset
   951
    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
   952
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   953
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   954
function CheckOnBridge()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   955
  return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   956
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   957
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   958
function DoOnBridge()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   959
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   960
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   961
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   962
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   963
  AddFunction({func = AddAnim, args = {midAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   964
  AddFunction({func = AddFunction, args = {{func = AfterMidAnimAlone, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   965
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   966
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   967
function CheckOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   968
  return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   969
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   970
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   971
function DoOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   972
  PlaceCourseMines()
12381
6af2b5406419 ACF, mission 3: Add mission strings to remind the player of the main goal
Wuzzy <almikes@aol.com>
parents: 12380
diff changeset
   973
  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: 12380
diff changeset
   974
    loc("Collect the weapon crate at the left coast!") .. "|" ..
12797
981036f1bdef ACF3: Mention mines time in a sequence where it has been forgotten
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   975
    loc("You'd better watch your steps...") .. "|" ..
981036f1bdef ACF3: Mention mines time in a sequence where it has been forgotten
Wuzzy <Wuzzy2@mail.ru>
parents: 12794
diff changeset
   976
    loc("Mines time: 3 seconds"), 0, 4000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   977
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   978
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   979
function CheckTookSniper()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   980
  return sniperTaken and StoppedGear(leaks)
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
function DoTookSniper()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   984
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   985
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   986
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   987
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   988
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   989
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimAlone, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   990
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   991
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   992
function CheckTookSniper2()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   993
  return sniperTaken and StoppedGear(leaks) and StoppedGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   994
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   995
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   996
function DoTookSniper2()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
   997
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   998
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   999
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1000
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1001
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1002
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimDuo, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1003
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1004
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1005
function CheckLost()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1006
  return princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1007
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1008
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1009
function DoLost()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1010
  if not cyborgDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1011
    SwitchHog(cyborg)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1012
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1013
  AddAnim(endFailAnim)
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1014
  AddFunction({func = DismissTeam, args = {loc("Natives")}})
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1015
  AddFunction({func = EndTurn, args = {true}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1016
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1017
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1018
function CheckWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1019
  return cyborgDead and not princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1020
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1021
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1022
function DoWon()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1023
  victory = true
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
  1024
  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
  1025
    SaveCampaignVar("Progress", "3")
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
  1026
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1027
  AddAnim(winAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1028
  AddFunction({func = FinishWon, args = {}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1029
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1030
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1031
function FinishWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1032
  SwitchHog(leaks)
10290
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
  1033
  DismissTeam(loc("Cannibal Sentry"))
42efccba0711 lua api: DismissTeam(teamname)
sheepluva
parents: 10289
diff changeset
  1034
  DismissTeam(loc("011101001"))
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1035
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1036
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1037
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1038
function CheckFailedCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1039
  return TurnsLeft == 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1040
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1041
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1042
function DoFailedCourse()
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1043
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1044
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1045
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1046
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1047
  AddFunction({func = AddAnim, args = {failAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1048
  AddFunction({func = AddFunction, args = {{func = AfterMidFailAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1049
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1050
12905
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1051
function SkipFailAnimAlone()
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1052
  DumpMines(1)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1053
  KillPrincess()
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1054
  AnimSwitchHog(princess)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1055
end
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1056
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1057
--////////////////////////////Main Functions/////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1058
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1059
function onGameInit()
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1060
  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: 12379
diff changeset
  1061
  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: 12379
diff changeset
  1062
  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: 12379
diff changeset
  1063
  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: 12379
diff changeset
  1064
  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: 12379
diff changeset
  1065
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1066
	Seed = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1067
	GameFlags = gfSolidLand + gfDisableWind
7239
598fe796dd01 Increased turn time to 40
belphegorr <szabibibi@gmail.com>
parents: 7236
diff changeset
  1068
	TurnTime = 40000 
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1069
	CaseFreq = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1070
	MinesNum = 0
12380
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1071
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1072
	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: 12379
diff changeset
  1073
		MinesTime = 3000
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1074
	else
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1075
		MinesTime = 5000
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1076
	end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1077
	Explosives = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1078
	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
  1079
    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
  1080
    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
  1081
12224
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1082
    -- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1083
    HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1084
    WaterRise = 0
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1085
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1086
	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
  1087
	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
  1088
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1089
12554
194b00c4ba07 ACF: Use skull grave for cannibal teams (for real)
Wuzzy <almikes@aol.com>
parents: 12543
diff changeset
  1090
  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
  1091
  cannibals = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1092
  for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1093
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1094
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1095
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1096
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1097
  for i = 5, 8 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1098
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1099
    AnimSetGearPosition(cannibals[i], 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1100
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1101
12049
030464f34d47 Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
  1102
  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
  1103
  cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1104
  princess = AddHog(loc("Fell From Heaven"), 0, 200, "tiara")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1105
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1106
  AnimSetGearPosition(dense, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1107
  AnimSetGearPosition(leaks, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1108
  AnimSetGearPosition(cyborg, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1109
  AnimSetGearPosition(princess, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1110
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1111
  AnimInit()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1112
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1113
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1114
function onGameStart()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1115
  StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1116
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1117
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1118
function onGameTick()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1119
  AnimUnWait()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1120
  if ShowAnimation() == false then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1121
    return
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1122
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1123
  ExecuteAfterAnimations()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1124
  CheckEvents()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1125
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1126
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1127
-- Track gears for princess cage cleanup
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1128
function onGearAdd(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1129
  local gt = GetGearType(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1130
  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: 12542
diff changeset
  1131
    trackedGears[gear] = true
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1132
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1133
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1134
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1135
function onGearDelete(gear)
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1136
  if trackedGears[gear] then
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1137
    trackedGears[gear] = nil
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1138
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1139
  if gear == blowCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1140
    blowTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1141
  elseif gear == fireCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1142
    fireTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1143
  elseif gear == gravityCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1144
    gravityTaken = true
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1145
  elseif gear == leaks and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1146
    leaksDead = true
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1147
  elseif gear == dense and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1148
    denseDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1149
  elseif gear == cyborg then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1150
    cyborgDead = true
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1151
  elseif gear == princess and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1152
    princessDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1153
  elseif gear == sniperCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1154
    sniperTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1155
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1156
    for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1157
      if gear == cannibals[i] then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1158
        cannibalDead[i] = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1159
      end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1160
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1161
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1162
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1163
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1164
function onAmmoStoreInit()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1165
  SetAmmo(amBlowTorch, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1166
  SetAmmo(amParachute, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1167
  SetAmmo(amGirder, 0, 0, 0, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1168
  SetAmmo(amLowGravity, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1169
  SetAmmo(amBaseballBat, 0, 0, 0, 1)
7524
a98ce9191832 Mission 3: Added initial FirePunch
belphegorr <szabibibi@gmail.com>
parents: 7514
diff changeset
  1170
  SetAmmo(amFirePunch, 1, 0, 0, 1)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1171
  SetAmmo(amSkip, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1172
  SetAmmo(amSwitch, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1173
  SetAmmo(amDEagle, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1174
  SetAmmo(amRope, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1175
  SetAmmo(amSniperRifle, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1176
  SetAmmo(amDynamite, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1177
  SetAmmo(amPickHammer, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1178
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1179
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1180
function onNewTurn()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1181
  if AnimInProgress() then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1182
    TurnTimeLeft = -1
12375
3126214d0e7d ACF, mission 3: Fix victory causing a lot of loser message being displayed. Also add EndTurn()
Wuzzy <almikes@aol.com>
parents: 12374
diff changeset
  1183
  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: 12374
diff changeset
  1184
    EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1185
  elseif stage == endStage and CurrentHedgehog ~= leaks then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1186
    AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1187
    SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1188
    TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1189
  elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1190
    for i = 1, 4 do
12373
b43c00e36369 ACF, mission 3: Fix Lua error when Leaks a Lot dies at the beginning
Wuzzy <almikes@aol.com>
parents: 12372
diff changeset
  1191
      if cannibalDead[i] ~= true and leaksDead ~= true then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1192
        if GetX(cannibals[i]) < GetX(leaks) then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1193
          HogTurnLeft(cannibals[i], false)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1194
        else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1195
          HogTurnLeft(cannibals[i], true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1196
        end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1197
      end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1198
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1199
    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
  1200
    TurnTimeLeft = 20000
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1201
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1202
    SetInputMask(0xFFFFFFFF)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1203
    TurnsLeft = TurnsLeft - 1
12904
c851be2c0494 Show # of turns left in the 12-turn parcour segment of ACF3
Wuzzy <Wuzzy2@mail.ru>
parents: 12903
diff changeset
  1204
    if TurnsLeft >= 1 then
c851be2c0494 Show # of turns left in the 12-turn parcour segment of ACF3
Wuzzy <Wuzzy2@mail.ru>
parents: 12903
diff changeset
  1205
      AddCaption(string.format(loc("Turns left: %d"), TurnsLeft), 0xFFFFFFFF, capgrpGameState)
c851be2c0494 Show # of turns left in the 12-turn parcour segment of ACF3
Wuzzy <Wuzzy2@mail.ru>
parents: 12903
diff changeset
  1206
    end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1207
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1208
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1209
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1210
function onPrecise()
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1211
  if GameTime > 2500 and AnimInProgress() then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1212
    SetAnimSkip(true)
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1213
    return
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1214
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1215
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1216