share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 21 Dec 2018 01:43:21 +0100
changeset 14507 f8c2b995c009
parent 14506 f37910a73c19
child 14508 d72fb761aa59
permissions -rw-r--r--
Use player team name in ACF campaign
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
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   138
nativesTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   139
princessTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   140
cannibalsTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   141
cyborgTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   142
14465
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   143
startAnimStarted = false
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
blowTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
fireTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
gravityTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
sniperTaken = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   148
leaksDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   149
denseDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   150
princessDead = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   151
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
   152
victory = false
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
cannibalDead = {}
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   154
hedgeHidden = {}
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   155
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
startAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
startAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
startAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
pastFlowerAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
pastFlowerAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
pastFlowerAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
outPitAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
outPitAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
outPitAnim = {}
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
midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
midAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
failAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
failAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
endAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
endAnimAD = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
endAnimAL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
endAnimRL = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
endFailAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
winAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
winAnimAD = {}
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
--/////////////////////////Animation Functions///////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
function AfterMidFailAnim()
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   187
  DismissTeam(nativesTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   188
  DismissTeam(princessTeamName)
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   189
  EndTurn(true)
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
function AfterMidAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
  SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   194
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   195
    RestoreHedge(cannibals[i])
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   196
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  AddAmmo(cannibals[5], amDEagle, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   200
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
  AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   202
  AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
  AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
  TurnsLeft = 12
13742
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   206
  SetTurnTimeLeft(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
   207
  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
   208
    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
   209
    loc("Mines time: 3 seconds"), 0, 6000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   210
  -----------------------///////////////------------
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 SkipEndAnimAlone()
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)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   216
  AnimSetGearPosition(cyborg, 437, 1700)
13474
4ea2c8fa699e ACF3: Tweak princess spawn position
Wuzzy <Wuzzy2@mail.ru>
parents: 13473
diff changeset
   217
  AnimSetGearPosition(princess, 519, 1726)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   219
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   220
function SkipEndAnimDuo()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   221
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   222
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
  if princessHidden then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
    RestoreHog(princess)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
    princessHidden = false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  end
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   227
  AnimSetGearPosition(cyborg, 437, 1700)
13474
4ea2c8fa699e ACF3: Tweak princess spawn position
Wuzzy <Wuzzy2@mail.ru>
parents: 13473
diff changeset
   228
  AnimSetGearPosition(princess, 519, 1726)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   229
  AnimSetGearPosition(leaks, 763, 1760)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   230
  AnimSetGearPosition(dense, 835, 1519)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   231
  HogTurnLeft(leaks, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   232
  HogTurnLeft(dense, true)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   233
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   234
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   235
function AfterEndAnimAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   236
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   237
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   238
  SetGearMessage(leaks, 0)
13752
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13742
diff changeset
   239
  SetTurnTimeLeft(MAX_TURN_TIME)
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   240
  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
   241
  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
   242
  AddEvent(CheckWon, {}, DoWon, {}, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   243
  RemoveEventFunc(CheckFailedCourse)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   244
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   245
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   246
function AfterEndAnimDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   247
  stage = endStage
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   248
  SwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   249
  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
   250
  SetGearMessage(dense, 0)
13752
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13742
diff changeset
   251
  SetTurnTimeLeft(MAX_TURN_TIME)
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   252
  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
   253
  AddEvent(CheckLost, {}, DoLost, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   254
  AddEvent(CheckWon, {}, DoWon, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   255
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   256
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   257
function SkipMidAnimAlone()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   258
  AnimSetGearPosition(leaks, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   259
  AnimSwitchHog(leaks)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   260
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   261
  AddFunction({func = HideHedge, args = {princess}})
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   262
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
function AfterStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
  SetGearMessage(leaks, 0)
13742
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   267
  SetTurnTimeLeft(TurnTime)
12934
bc7138add7eb 2 minor spelling/grammar fixes
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   268
  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
   269
  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
   270
  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
   271
  local conds = loc("Leaks A Lot must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
  if m2DenseDead == 0 then
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   273
    conds = loc("Your hogs must survive!")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  end
12901
bdf8e80a97b8 Fix some minor formatting and grammar flaws in script strings
Wuzzy <Wuzzy2@mail.ru>
parents: 12797
diff changeset
   275
  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
   276
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
function SkipStartAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
  AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
function PlaceCratesDuo()
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   283
  SpawnSupplyCrate(3090, 827, amBaseballBat)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   284
  girderCrate1 = SpawnSupplyCrate(2466, 1814, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   285
  girderCrate2 = SpawnSupplyCrate(2630, 1278, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   286
  SpawnSupplyCrate(2422, 1810, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   287
  SpawnSupplyCrate(3157, 1009, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   288
  sniperCrate = SpawnSupplyCrate(784, 1715, amSniperRifle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
function 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
   292
  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
   293
  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
   294
  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
   295
  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
   296
  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
   297
  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
   298
  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
   299
  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
   300
  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
   301
  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
   302
  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
   303
  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
   304
  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
   305
  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
   306
  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
   307
  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
   308
  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
   309
  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
   310
  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
   311
  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
   312
  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
   313
  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
   314
  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
   315
  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
   316
  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
   317
  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
   318
  AddGear(1519, 1213, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   320
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
function AfterPastFlowerAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
  PlaceMinesDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
  AddEvent(CheckDensePit, {}, DoDensePit, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   325
  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
   326
  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
   327
  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
   328
    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
   329
    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
   330
    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
   331
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
function SkipPastFlowerAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   334
  AnimSetGearPosition(dense, 2656, 1842)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   336
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   337
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
function AfterOutPitAnim()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
  SetupCourseDuo()
7506
e2632a18bb4c Mission 3: reduced enemy turn time, fixed other HideHog problems
belphegorr <szabibibi@gmail.com>
parents: 7502
diff changeset
   342
  RestoreHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
  AddAmmo(cannibals[5], amDEagle, 0)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   344
  HideHedge(cannibals[5])
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   345
  AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   346
  SetGearMessage(leaks, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
  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
   348
  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
   349
  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
   350
    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
   351
    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
   352
    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
   353
    loc("Mines time: 5 seconds"), 1, 5000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   354
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
function SkipOutPitAnim()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   357
  AnimSetGearPosition(dense, unpack(midDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
  AnimSwitchHog(dense)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   359
  AnimWait(dense, 1)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   360
  AddFunction({func = HideHedge, args = {cyborg}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   362
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
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
   364
  RestoreHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   365
  RestoreHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
  AnimOutOfNowhere(cyborg, x, y)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
  AnimOutOfNowhere(princess, xx, yy)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
  HogTurnLeft(princess, false)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   369
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
function RestoreCyborgOnly(x, y)
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   373
  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
   374
  SetState(cyborg, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  AnimOutOfNowhere(cyborg, x, y)
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 TargetPrincess()
10289
c3a77ff02a23 lua api: SetWeapon(ammoType)
sheepluva
parents: 9308
diff changeset
   380
  SetWeapon(amDEagle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
  SetGearMessage(cyborg, gmUp)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
  return true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
function HideCyborg()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   386
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   387
  HideHedge(princess)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   389
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
function HideCyborgOnly()
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   391
  HideHedge(cyborg)
7215
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 SetupKillRoom()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
  PlaceGirder(2342, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
  PlaceGirder(2294, 1783, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
  PlaceGirder(2245, 1814, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
function SetupCourseDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  PlaceGirder(1083, 1152, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
  PlaceGirder(1087, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  PlaceGirder(1133, 1155, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
  PlaceGirder(1135, 1152, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  PlaceGirder(1135, 1078, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
  PlaceGirder(1087, 1016, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  PlaceGirder(1018, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  PlaceGirder(1016, 921, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
  PlaceGirder(962, 782, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
  PlaceGirder(962, 662, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
  PlaceGirder(962, 661, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  PlaceGirder(962, 650, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  PlaceGirder(962, 630, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
  PlaceGirder(1033, 649, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
  PlaceGirder(952, 650, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   417
  fireCrate = SpawnSupplyCrate(1846, 1100, amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   418
  SpawnSupplyCrate(1900, 1100, amPickHammer)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   419
  SpawnSupplyCrate(950, 674, amDynamite)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   420
  SpawnSupplyCrate(994, 825, amRope)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   421
  SpawnSupplyCrate(570, 1357, amLowGravity)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   424
local trackedGears = {}
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   425
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   426
-- 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
   427
-- 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
   428
-- 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
   429
function ClearTrashForPrincessCage()
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   430
  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
   431
    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
   432
      DeleteGear(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   433
    end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   434
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   435
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   436
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   437
-- Dump mines in princess cage
12905
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   438
function DumpMines(t)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   439
  if not t then
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   440
    t = 0
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   441
  end
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
   442
  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
   443
  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
   444
  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
   445
  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
   446
  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
   447
  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
   448
  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
   449
  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
   450
  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
   451
  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
   452
  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
   453
  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
   454
  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
   455
  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
   456
  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
   457
  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
   458
  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
   459
  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
   460
  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
   461
  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
   462
  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
   463
  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
   464
  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
   465
  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
   466
  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
   467
  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
   468
  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
   469
  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
   470
  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
   471
  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
   472
  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
   473
  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
   474
  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
   475
  AddGear(2314, 1818, gtMine, 0, 0, 0, t)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
function SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
  SetupAnimAcceptedDied()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   480
  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
   481
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
function SetupAnimAttacked()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
  SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
  startAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
  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
   488
  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
   489
  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
   490
  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
   491
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
  midAnim = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
  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
   495
  table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  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
   497
  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
   498
  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
   499
  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
   500
  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
   501
  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
   502
  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
   503
  table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
  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
   505
  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
   506
  AddSkipFunction(midAnim, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
end
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
function SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
  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
   511
  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
   512
  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
   513
  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
   514
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
  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
   517
  table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  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
   519
  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
   520
  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
   521
  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
   522
  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
   523
  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
   524
  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
   525
  table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
  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
   527
  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
   528
  AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
   530
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, ClearTrashForPrincessCage, {}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
  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
   532
  table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   533
  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  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
   538
  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
   539
  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
   540
  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
   541
  table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
  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
   544
  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
   545
  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
   546
  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
   547
  AddSkipFunction(failAnimAD, SkipFailAnimAlone, {})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
13474
4ea2c8fa699e ACF3: Tweak princess spawn position
Wuzzy <Wuzzy2@mail.ru>
parents: 13473
diff changeset
   549
  table.insert(endAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1726}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550
  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   551
  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
   552
  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
   553
  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
   554
  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
   555
  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
   556
  AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   557
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   558
  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
   559
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
   560
  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
   561
  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
   562
  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
   563
  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
   564
  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
   565
  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
   566
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   567
  startAnim = startAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   568
  midAnim = midAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
  failAnim = failAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
  endAnim = endAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   571
  winAnim = winAnimAD
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   573
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
function SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
  table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
  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
   577
  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
   578
  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
   579
  table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
  AddSkipFunction(startAnimAL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
  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
   583
  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
   584
  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
   585
  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
   586
  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
   587
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   588
  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
  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
   590
  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
   591
  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
   592
  table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
  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
   594
  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   595
  AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   596
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   597
  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
   598
  table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   599
  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
   600
  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
   601
  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
   602
  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
   603
  table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
  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
   605
  table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
  AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
13474
4ea2c8fa699e ACF3: Tweak princess spawn position
Wuzzy <Wuzzy2@mail.ru>
parents: 13473
diff changeset
   608
  table.insert(endAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1726}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   612
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   613
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
  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
   615
  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
   616
  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
   617
  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
   618
  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
   619
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   620
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   621
  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
   622
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
   623
  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
   624
  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
   625
  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
   626
  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
   627
  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
   628
  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
   629
  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
   630
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
  startAnim = startAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
  pastFlowerAnim = pastFlowerAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   633
  outPitAnim = outPitAnimAL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   634
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   635
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   636
function SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   637
  table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
  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
   639
  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
   640
  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
   641
  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
   642
  AddSkipFunction(startAnimRL, SkipStartAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   643
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
  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
   645
  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
   646
  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
   647
  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
   648
  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
   649
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   651
  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
   652
  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
   653
  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
   654
  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
   655
  table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
  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
   657
  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   658
  AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   659
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   660
  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
   661
  table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
  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
   663
  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
   664
  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
   665
  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
   666
  table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
  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
   668
  table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
  AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
13474
4ea2c8fa699e ACF3: Tweak princess spawn position
Wuzzy <Wuzzy2@mail.ru>
parents: 13473
diff changeset
   671
  table.insert(endAnim, {func = AnimCustomFunction, args = {leaks, RestoreCyborg, {437, 1700, 519, 1726}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   672
  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   673
  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   674
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   675
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   676
  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
  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
   678
  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
   679
  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
   680
  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
   681
  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
   682
  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   683
  
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
   684
  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
   685
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
   686
  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
   687
  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
   688
  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
   689
  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
   690
  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
   691
  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
   692
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   693
  startAnim = startAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   694
  pastFlowerAnim = pastFlowerAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   695
  outPitAnim = outPitAnimRL
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   696
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   697
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   698
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
   699
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   700
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   701
--/////////////////////////////Misc Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   702
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   703
function HideHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   704
  if hedgeHidden[hedge] ~= true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   705
    HideHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   706
    hedgeHidden[hedge] = true
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   707
  end
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
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   710
function RestoreHedge(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   711
  if hedgeHidden[hedge] == true then
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   712
    RestoreHog(hedge)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   713
    hedgeHidden[hedge] = false
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   714
  end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   715
end
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   716
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   717
function CondNeedToTurn(hog1, hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   718
  xl, xd = GetX(hog1), GetX(hog2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   719
  if xl > xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   720
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   721
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   722
  elseif xl < xd then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   723
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   724
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   725
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   726
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   727
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   728
function SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   729
  ------ AMMO CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   730
  SpawnSupplyCrate(3124, 952, amBaseballBat)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   731
  SpawnSupplyCrate(2508, 1110, amFirePunch)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   732
  ------ UTILITY CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   733
  blowCrate = SpawnSupplyCrate(3675, 1480, amBlowTorch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   734
  gravityCrate = SpawnSupplyCrate(3448, 1349, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   735
  SpawnSupplyCrate(3212, 1256, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   736
  SpawnSupplyCrate(3113, 911, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   737
  sniperCrate = SpawnSupplyCrate(784, 1715, amSniperRifle)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   738
  ------ 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
   739
  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
   740
  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
   741
  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
   742
  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
   743
  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
   744
  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
   745
  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
   746
  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
   747
  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
   748
  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
   749
  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
   750
  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
   751
  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
   752
  AddGear(2239, 1295, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   753
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   754
  AnimSetGearPosition(leaks, 3781, 1583)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   755
  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
   756
  AddAmmo(leaks, amSwitch, 0)
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 SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   760
  PlaceCratesDuo()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   761
  AnimSetGearPosition(leaks, unpack(startLeaksPosDuo))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
   762
  AnimSetGearPosition(dense, unpack(startDensePosDuo))
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   763
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   764
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   765
function SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   766
  AddEvent(CheckPastFlower, {}, DoPastFlower, {}, 0)
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(CheckDenseDead, {}, DoDenseDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   769
  AddEvent(CheckTookSniper2, {}, DoTookSniper2, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   770
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   771
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   772
function SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   773
  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   774
  AddEvent(CheckTookBlowTorch, {}, DoTookBlowTorch, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   775
  AddEvent(CheckTookLowGravity, {}, DoTookLowGravity, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   776
  AddEvent(CheckOnBridge, {}, DoOnBridge, {}, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   777
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   778
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   779
function StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   780
  if m2DenseDead == 1 then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   781
    DeleteGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   782
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   783
      SetupAnimAcceptedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   784
    elseif m2Choice == choiceRefused then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   785
      SetupAnimRefusedDied()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   786
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   787
      SetupAnimAttacked()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   788
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   789
    SetupPlaceAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   790
    SetupEventsAlone()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   791
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   792
    if m2Choice == choiceAccepted then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   793
      SetupAnimAcceptedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   794
    else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   795
      SetupAnimRefusedLived()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   796
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   797
    SetupPlaceDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   798
    SetupEventsDuo()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   799
  end
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   800
  HideHedge(cyborg)
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   801
  HideHedge(princess)
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   802
  for i = 5, 8 do
7502
16c36f62247b Solved issues with HideHog in mission 2 and 3
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   803
    HideHedge(cannibals[i])
7261
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   804
  end
158f8fb74ded Placed hiding hogs at the end of StartMission in Mission 3
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   805
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   806
end
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
function SetupCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   809
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   810
  ------ GIRDER LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   811
  PlaceGirder(1091, 1150, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   812
  PlaceGirder(1091, 989, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   813
  PlaceGirder(1091, 829, 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(1091, 668, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   816
  PlaceGirder(1091, 669, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   817
  PlaceGirder(1088, 667, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   818
  PlaceGirder(1091, 658, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   819
  PlaceGirder(1091, 646, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   820
  PlaceGirder(1091, 607, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   821
  PlaceGirder(1091, 571, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   822
  PlaceGirder(1376, 821, 6)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   823
  PlaceGirder(1145, 1192, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   824
  PlaceGirder(1169, 1076, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   825
  PlaceGirder(1351, 1082, 4)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   826
  PlaceGirder(1469, 987, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   827
  PlaceGirder(1386, 951, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   828
  PlaceGirder(1465, 852, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   829
  PlaceGirder(1630, 913, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   830
  PlaceGirder(1733, 856, 7)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   831
  PlaceGirder(1688, 713, 5)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   832
  PlaceGirder(1556, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   833
  PlaceGirder(1525, 696, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   834
  PlaceGirder(1457, 697, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   835
  PlaceGirder(1413, 700, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   836
  PlaceGirder(1270, 783, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   837
  PlaceGirder(1207, 825, 2)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   838
  PlaceGirder(1135, 775, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   839
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   840
  ------ UTILITY CRATE LIST ------
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   841
  SpawnSupplyCrate(1590, 628, amParachute)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   842
  SpawnSupplyCrate(1540, 100, amDynamite)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   843
  SpawnSupplyCrate(2175, 1815, amLowGravity)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   844
  SpawnSupplyCrate(2210, 1499, amFirePunch)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   845
  girderCrate = SpawnSupplyCrate(2300, 1663, amGirder)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12905
diff changeset
   846
  SpawnSupplyCrate(610, 1394, amPickHammer)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   847
  
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   848
  ------ BARREL LIST ------
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   849
  SetHealth(AddGear(1148, 736, gtExplosives, 0, 0, 0, 0), 20)
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
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   852
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   853
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
   854
  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
   855
  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
   856
  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
   857
  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
   858
  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
   859
  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
   860
  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
   861
  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
   862
  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
   863
  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
   864
  AddGear(1815, 1184, gtMine, 0, 0, 0, 0)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   865
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   866
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   867
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   868
--////////////////////////////Event Functions////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   869
function CheckTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   870
  return fireTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   871
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   872
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   873
function DoTookFire()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   874
  AddAmmo(leaks, amFirePunch, 100)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   875
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   876
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   877
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
   878
  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
   879
    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
   880
  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
   881
    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
   882
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   883
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   884
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   885
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
   886
  EndTurn(0)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   887
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   888
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   889
  AddFunction({func = AddAnim, args = {outPitAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   890
  AddFunction({func = AddFunction, args = {{func = AfterOutPitAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   891
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   892
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   893
function CheckPastFlower()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   894
  if denseDead == true or leaksDead == true then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   895
    return false
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   896
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   897
  return (GetX(dense) < startEventXDuo and StoppedGear(dense))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   898
      or (GetX(leaks) < startEventXDuo and StoppedGear(leaks))
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   899
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   900
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   901
function 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
   902
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   903
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   904
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   905
  AddFunction({func = AddAnim, args = {pastFlowerAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   906
  AddFunction({func = AddFunction, args = {{func = AfterPastFlowerAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   907
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   908
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   909
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   910
function CheckLeaksDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   911
  return leaksDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   912
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   913
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   914
function DoLeaksDead()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   915
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   916
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   917
    AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   918
    DismissTeam(nativesTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   919
    DismissTeam(princessTeamName)
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   920
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   921
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   922
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   923
function CheckDenseDead()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   924
  return denseDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   925
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   926
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   927
function DoDenseDead()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   928
  if not princessDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   929
    EndTurn(true)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   930
    AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   931
    DismissTeam(nativesTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
   932
    DismissTeam(princessTeamName)
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
   933
  end
7215
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 CheckTookBlowTorch()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   937
  return blowTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   938
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   939
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   940
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
   941
  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
   942
    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
   943
    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
   944
    loc("Don't blow up the crate."), 0, 6000)
7215
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 CheckTookLowGravity()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   948
  return gravityTaken
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   949
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   950
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   951
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
   952
  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
   953
    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
   954
    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
   955
    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
   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 CheckOnBridge()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   959
  return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   960
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   961
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   962
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
   963
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   964
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   965
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   966
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   967
  AddFunction({func = AddAnim, args = {midAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   968
  AddFunction({func = AddFunction, args = {{func = AfterMidAnimAlone, args = {}}}})
7215
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 CheckOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   972
  return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   973
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   974
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   975
function DoOnFirstGirder()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   976
  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
   977
  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
   978
    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
   979
    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
   980
    loc("Mines time: 3 seconds"), 0, 4000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   981
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   982
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   983
function CheckTookSniper()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   984
  return sniperTaken and StoppedGear(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   985
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   986
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   987
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
   988
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   989
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   990
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   991
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   992
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   993
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimAlone, args = {}}}})
7215
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 CheckTookSniper2()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   997
  return sniperTaken and StoppedGear(leaks) and StoppedGear(dense)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   998
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   999
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1000
function 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
  1001
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1002
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1003
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1004
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1005
  AddFunction({func = AddAnim, args = {endAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1006
  AddFunction({func = AddFunction, args = {{func = AfterEndAnimDuo, args = {}}}})
7215
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 CheckLost()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1010
  return princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1011
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1012
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1013
function DoLost()
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1014
  if not cyborgDead then
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1015
    SwitchHog(cyborg)
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1016
  end
13473
1515e643cd91 ACF3: Move princess to her own team, fix clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13145
diff changeset
  1017
  if not (leaksDead or denseDead) then
1515e643cd91 ACF3: Move princess to her own team, fix clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13145
diff changeset
  1018
    AddAnim(endFailAnim)
1515e643cd91 ACF3: Move princess to her own team, fix clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13145
diff changeset
  1019
  end
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1020
  AddFunction({func = DismissTeam, args = {nativesTeamName}})
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1021
  AddFunction({func = DismissTeam, args = {princessTeamName}})
12379
eb11e1bc7547 ACF, mission 3: Fix player not losing properly after killing princess
Wuzzy <almikes@aol.com>
parents: 12378
diff changeset
  1022
  AddFunction({func = EndTurn, args = {true}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1023
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1024
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1025
function CheckWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1026
  return cyborgDead and not princessDead
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1027
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1028
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1029
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
  1030
  victory = true
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
  1031
  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
  1032
    SaveCampaignVar("Progress", "3")
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
  1033
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1034
  AddAnim(winAnim)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1035
  AddFunction({func = FinishWon, args = {}})
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 FinishWon()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1039
  SwitchHog(leaks)
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1040
  DismissTeam(cannibalsTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1041
  DismissTeam(cyborgTeamName)
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
  1042
  EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1043
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1044
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1045
function CheckFailedCourse()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1046
  return TurnsLeft == 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1047
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1048
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1049
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
  1050
  EndTurn(true)
7514
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1051
  RestoreHedge(cyborg)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1052
  RestoreHedge(princess)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1053
  AnimWait(cyborg, 1)
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1054
  AddFunction({func = AddAnim, args = {failAnim}})
8699d501a01e Fixed crashes in mission 3 after RestoreHog
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
  1055
  AddFunction({func = AddFunction, args = {{func = AfterMidFailAnim, args = {}}}})
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1056
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1057
12905
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1058
function SkipFailAnimAlone()
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1059
  DumpMines(1)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1060
  KillPrincess()
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1061
  AnimSwitchHog(princess)
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1062
end
06791c62c759 ACF3: Explode princess when skipping 12turn course failanim
Wuzzy <Wuzzy2@mail.ru>
parents: 12904
diff changeset
  1063
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1064
--////////////////////////////Main Functions/////////////////////////
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1065
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1066
function 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
  1067
  progress = tonumber(GetCampaignVar("Progress"))
13145
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13142
diff changeset
  1068
  m2Choice = tonumber(GetCampaignVar("M2Choice")) or choiceRefused
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
  1069
  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
  1070
  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
  1071
  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
  1072
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1073
	Seed = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1074
	GameFlags = gfSolidLand + gfDisableWind
7239
598fe796dd01 Increased turn time to 40
belphegorr <szabibibi@gmail.com>
parents: 7236
diff changeset
  1075
	TurnTime = 40000 
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1076
	CaseFreq = 0
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1077
	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
  1078
1eaef4b1b3c1 ACF, mission 3: Standardize mine times. 3s if alone, 5s if playing with 2 hogs
Wuzzy <almikes@aol.com>
parents: 12379
diff changeset
  1079
	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
  1080
		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
  1081
	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
  1082
		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
  1083
	end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1084
	Explosives = 0
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
  1085
    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
  1086
    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
  1087
12224
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1088
    -- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1089
    HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
  1090
    WaterRise = 0
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1091
14465
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1092
  AnimInit(true)
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1093
14507
f8c2b995c009 Use player team name in ACF campaign
Wuzzy <Wuzzy2@mail.ru>
parents: 14506
diff changeset
  1094
  nativesTeamName = AddMissionTeam(-2)
13475
2c7ae236b2d8 ACF3: Fix initial ammo being locked
Wuzzy <Wuzzy2@mail.ru>
parents: 13474
diff changeset
  1095
  leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1096
  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1097
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1098
  princessTeamName = AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
13475
2c7ae236b2d8 ACF3: Fix initial ammo being locked
Wuzzy <Wuzzy2@mail.ru>
parents: 13474
diff changeset
  1099
  princess = AddHog(loc("Fell From Heaven"), 0, 200, "tiara")
2c7ae236b2d8 ACF3: Fix initial ammo being locked
Wuzzy <Wuzzy2@mail.ru>
parents: 13474
diff changeset
  1100
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1101
  cannibalsTeamName = AddTeam(loc("Cannibal Sentry"), -1, "skull", "Island", "Pirate","cm_vampire")
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1102
  cannibals = {}
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1103
  for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1104
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1105
    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
13142
39aa98d01e80 ACF3: Fix cannibals sometimes doing nothing for a full turn
Wuzzy <Wuzzy2@mail.ru>
parents: 12934
diff changeset
  1106
    SetEffect(cannibals[i], heArtillery, 1)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1107
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1108
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1109
  for i = 5, 8 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1110
    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1111
    AnimSetGearPosition(cannibals[i], 0, 0)
13142
39aa98d01e80 ACF3: Fix cannibals sometimes doing nothing for a full turn
Wuzzy <Wuzzy2@mail.ru>
parents: 12934
diff changeset
  1112
    SetEffect(cannibals[i], heArtillery, 1)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1113
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1114
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1115
  cyborgTeamName = AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7219
diff changeset
  1116
  cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
13473
1515e643cd91 ACF3: Move princess to her own team, fix clan color
Wuzzy <Wuzzy2@mail.ru>
parents: 13145
diff changeset
  1117
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1118
  AnimSetGearPosition(dense, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1119
  AnimSetGearPosition(leaks, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1120
  AnimSetGearPosition(cyborg, 0, 0)
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7261
diff changeset
  1121
  AnimSetGearPosition(princess, 0, 0)
7215
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
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1124
function onGameStart()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1125
  StartMission()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1126
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1127
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1128
function onGameTick()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1129
  AnimUnWait()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1130
  if ShowAnimation() == false then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1131
    return
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1132
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1133
  ExecuteAfterAnimations()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1134
  CheckEvents()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1135
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1136
12543
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1137
-- 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
  1138
function onGearAdd(gear)
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1139
  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
  1140
  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
  1141
    trackedGears[gear] = true
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1142
  end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1143
end
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1144
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1145
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
  1146
  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
  1147
    trackedGears[gear] = nil
9fda510f0bc4 ACF, mission 3: Fix broken sequence when princess got caged (failed parcours)
Wuzzy <almikes@aol.com>
parents: 12542
diff changeset
  1148
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1149
  if gear == blowCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1150
    blowTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1151
  elseif gear == fireCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1152
    fireTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1153
  elseif gear == gravityCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1154
    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
  1155
  elseif gear == leaks and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1156
    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
  1157
  elseif gear == dense and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1158
    denseDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1159
  elseif gear == cyborg then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1160
    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
  1161
  elseif gear == princess and not victory then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1162
    princessDead = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1163
  elseif gear == sniperCrate then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1164
    sniperTaken = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1165
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1166
    for i = 1, 4 do
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1167
      if gear == cannibals[i] then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1168
        cannibalDead[i] = true
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1169
      end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1170
    end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1171
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1172
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1173
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1174
function onAmmoStoreInit()
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1175
  SetAmmo(amBlowTorch, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1176
  SetAmmo(amParachute, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1177
  SetAmmo(amGirder, 0, 0, 0, 3)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1178
  SetAmmo(amLowGravity, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1179
  SetAmmo(amBaseballBat, 0, 0, 0, 1)
7524
a98ce9191832 Mission 3: Added initial FirePunch
belphegorr <szabibibi@gmail.com>
parents: 7514
diff changeset
  1180
  SetAmmo(amFirePunch, 1, 0, 0, 1)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1181
  SetAmmo(amSkip, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1182
  SetAmmo(amSwitch, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1183
  SetAmmo(amDEagle, 9, 0, 0, 0)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1184
  SetAmmo(amRope, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1185
  SetAmmo(amSniperRifle, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1186
  SetAmmo(amDynamite, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1187
  SetAmmo(amPickHammer, 0, 0, 0, 1)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1188
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1189
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1190
function onNewTurn()
14465
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1191
  if not startAnimStarted then
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1192
      AddAnim(startAnim)
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1193
      AddFunction({func = AfterStartAnim, args = {}})
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1194
      startAnimStarted = true
d084fc76c566 ACF3: Fix weapons being disabled in first turn
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
  1195
  end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1196
  if AnimInProgress() then
13752
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13742
diff changeset
  1197
    SetTurnTimeLeft(MAX_TURN_TIME)
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
  1198
  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
  1199
    EndTurn(true)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1200
  elseif stage == endStage and CurrentHedgehog ~= leaks then
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1201
    AnimSwitchHog(leaks)
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1202
    SetGearMessage(leaks, 0)
13752
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13742
diff changeset
  1203
    SetTurnTimeLeft(MAX_TURN_TIME)
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14465
diff changeset
  1204
  elseif GetHogTeamName(CurrentHedgehog) ~= nativesTeamName then
13742
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
  1205
    SetTurnTimeLeft(20000)
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1206
  else
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1207
    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
  1208
    if TurnsLeft >= 1 then
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
  1209
      AddCaption(string.format(loc("Turns left: %d"), TurnsLeft), capcolDefault, capgrpGameState)
12904
c851be2c0494 Show # of turns left in the 12-turn parcour segment of ACF3
Wuzzy <Wuzzy2@mail.ru>
parents: 12903
diff changeset
  1210
    end
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1211
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1212
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1213
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1214
function onPrecise()
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1215
  if GameTime > 2500 and AnimInProgress() then
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1216
    SetAnimSkip(true)
7510
a7601ce08b5d Mission 3: Modified onPrecise (added out-commented debug code)
belphegorr <szabibibi@gmail.com>
parents: 7506
diff changeset
  1217
    return
7215
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1218
  end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1219
end
533debc28ee5 Added mission 3: The Journey Back
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
  1220