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