share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua
author Wuzzy <Wuzzy2@mail.ru>
Tue, 07 May 2019 16:08:27 +0200
changeset 14919 4596357d002d
parent 14633 bd15c8551318
child 14953 ff4003a90ff8
permissions -rw-r--r--
Fix cut scenes not being skipped when pressing precise in enemy turn (bug #280)
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: 12776
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: 12776
diff changeset
     2
A Classic Fairytale: Family Reunion
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
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: 12776
diff changeset
     4
= 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: 12776
diff changeset
     5
Kill all visible cyborgs (not the princess).
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
     6
Then move hero to princess and Ramon and Spike Cheese to the surface.
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
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: 12776
diff changeset
     8
= 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: 12776
diff changeset
     9
== 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: 12776
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: 12776
diff changeset
    11
- Cut scene: Intro
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    12
- First goal: Kill all visible cyborgs (princess is not a 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: 12776
diff changeset
    13
- First goal completed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    14
- Cut scene: Cyborg reveals second goal
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    15
- A ton of 5s mines spawn on the surface
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    16
- Second goal: Hero must reach princess; Ramon and Spiky Cheese must reach the surface
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    17
- Second goal completed
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    18
> 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: 12776
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: 12776
diff changeset
    20
== 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: 12776
diff changeset
    21
| Princess dead:
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    22
    > 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: 12776
diff changeset
    23
| Ramon, Spiky Cheese or hero dead:
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    24
    > 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: 12776
diff changeset
    25
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    26
]]
bca911f8e804 Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents: 12776
diff changeset
    27
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7675
diff changeset
    28
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7675
diff changeset
    29
HedgewarsScriptLoad("/Scripts/Animate.lua")
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    30
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    31
-----------------------------Map--------------------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    32
local map = 
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    33
{
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
	"\255\242\4\218\132\0\53\4\253\0\0\53\4\253\132\0\102\5\92\0\0\102\5\92\132\0\106\5\205\0\0\106\5\205\132\1\1\6\37\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
	"\1\1\6\37\132\1\124\6\160\0\1\113\6\160\132\2\157\6\111\0\2\164\6\107\132\2\252\6\178\0\2\252\6\178\132\3\224\4\179\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
	"\3\224\4\179\132\3\38\2\209\0\3\38\2\209\132\4\109\3\179\0\4\109\3\179\132\5\124\3\172\0\5\128\3\172\132\6\69\4\239\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
	"\6\69\4\239\132\7\175\4\32\0\7\172\4\46\132\8\116\5\18\0\3\38\2\213\132\3\41\1\244\0\3\41\1\244\132\3\94\2\245\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
	"\8\127\5\8\132\8\127\0\14\0\8\127\0\14\132\8\194\5\29\0\8\194\5\29\132\9\36\5\82\0\9\29\5\75\132\9\180\5\103\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
	"\9\194\5\92\132\10\51\6\5\0\10\51\6\5\132\10\216\5\152\0\10\227\5\145\132\11\189\5\212\0\11\189\5\212\132\12\91\5\131\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
	"\12\91\5\131\132\12\253\5\191\0\12\253\5\191\132\13\149\5\106\0\13\149\5\106\132\16\11\5\106\0\14\19\5\110\132\14\16\4\236\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
	"\14\16\4\236\132\15\66\4\236\0\15\66\4\236\132\15\66\5\110\0\14\79\4\194\132\15\6\4\194\0\14\255\4\176\132\14\255\4\49\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
	"\14\255\4\49\132\14\76\4\53\0\14\76\4\53\132\14\76\4\201\0\14\125\4\74\128\14\128\4\187\0\14\188\4\77\128\14\185\4\179\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    43
	"\14\111\4\39\129\14\76\3\252\0\14\72\3\249\129\14\72\3\147\0\14\72\3\147\129\14\97\3\235\0\14\97\3\235\129\14\146\4\28\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
	"\14\202\4\28\129\14\248\3\238\0\14\248\3\238\129\15\17\3\133\0\15\17\3\133\129\15\27\3\235\0\15\27\3\235\129\14\230\4\49\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    45
	"\1\124\6\220\130\1\244\7\13\0\1\244\7\13\130\2\104\6\206\0\2\100\6\206\130\2\30\6\178\0\2\12\6\181\130\1\135\6\213\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
	"\3\172\7\136\130\15\41\7\136\0\15\41\7\136\130\15\41\7\62\0\15\41\7\62\130\3\175\7\52\0\3\175\7\52\130\3\126\6\206\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
	"\3\126\6\206\130\3\122\7\133\0\3\122\7\133\130\3\186\7\136\0\8\123\7\94\136\9\173\7\101\0\8\88\7\66\130\8\88\7\119\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
	"\9\212\7\69\130\9\212\7\126\0\8\155\0\14\133\8\151\5\11\0\8\190\2\160\131\8\194\5\1\0\14\83\3\235\131\14\114\4\21\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
	"\15\10\3\196\131\15\10\3\235\0\15\10\3\235\131\14\220\4\32\0\14\65\5\47\137\15\20\5\36\0\15\41\5\82\132\15\41\5\82\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
	"\3\94\3\17\138\4\137\5\124\0\3\221\3\119\138\5\57\4\250\0\4\102\4\67\160\5\26\4\74\0\4\113\5\36\161\5\142\4\222\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
	"\4\42\5\216\169\9\89\6\26\0\6\100\5\22\145\8\134\5\64\0\6\255\4\197\140\7\161\4\120\0\7\214\4\204\146\7\214\4\204\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
	"\10\55\6\97\147\11\13\5\247\0\11\59\6\26\146\11\224\6\30\0\12\95\6\16\153\14\55\6\90\0\13\173\5\226\153\15\196\5\212\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
	"\15\172\7\91\152\15\165\5\230\0\15\235\7\221\142\255\238\7\207\0\14\248\6\188\152\3\217\6\178\0\3\112\6\83\143\3\31\7\101\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
	"\3\73\7\143\140\3\73\7\143\0\15\62\7\13\140\15\62\7\13\0\15\101\7\157\140\15\101\7\157\0\2\181\6\220\141\1\205\7\108\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
	"\2\86\6\160\137\2\150\6\128\0\2\26\6\153\134\1\96\6\195\0\1\82\6\241\136\1\226\7\59\0\2\157\7\98\155\2\157\7\98\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
	"\1\64\7\80\149\255\249\7\27\0\1\4\6\174\148\0\25\6\86\0\0\211\6\58\139\0\7\5\219\0\0\35\5\159\142\0\4\5\47\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
	"\8\123\0\14\199\8\187\0\11\0\16\14\5\99\199\16\14\7\245\0\255\235\4\218\199\255\238\8\25\0\8\67\2\72\202\8\208\2\72\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
	"\8\141\1\251\202\8\141\0\74\0\8\201\2\143\195\8\204\4\49\0\8\84\2\185\205\8\204\2\188\0\8\99\2\230\205\8\187\2\230\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
	"\8\165\3\41\131\8\144\3\3\0\8\144\3\3\131\8\60\2\248\0\8\60\2\248\131\7\252\3\59\0\7\252\3\59\131\8\137\3\31\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    60
	"\8\56\3\20\131\8\102\3\20\0\8\60\3\13\194\8\60\3\13\0\8\60\3\3\128\8\60\3\31\0\7\238\3\66\128\7\214\3\84\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    61
	"\7\217\3\87\128\7\217\3\98\0\7\217\3\87\128\7\200\3\91\0\6\209\4\70\208\8\18\4\95\0\0\11\4\225\131\0\0\8\21\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
	"\15\224\5\99\131\15\245\7\252\0\15\242\5\191\192\15\196\6\33\0\15\196\6\33\192\15\245\6\209\0\15\245\6\209\192\15\193\7\115\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
	"\15\193\7\115\192\15\235\8\18\0\15\249\5\223\196\15\217\6\40\0\15\217\6\40\196\16\4\6\188\0\15\245\6\16\196\16\21\7\77\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    64
	"\16\0\6\245\196\15\214\7\112\0\15\207\7\129\196\16\0\8\4\0\15\245\7\80\196\16\4\7\207\0\15\221\5\85\196\16\11\5\184\0",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    65
}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    66
--------------------------------------------Constants------------------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    67
choiceAccepted = 1
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    68
choiceRefused = 2
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    69
choiceAttacked = 3
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    70
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    71
choiceEliminate = 1
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    72
choiceSpare = 2
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    73
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    74
leaksNum = 1
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    75
denseNum = 2
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
waterNum = 3
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
buffaloNum = 4
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
chiefNum = 5
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
girlNum = 6
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
wiseNum = 7
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    83
               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    84
               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese")
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    85
              }
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
nativeUnNames = {loc("Zork"), loc("Steve"), loc("Jack"),
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
                 loc("Lee"), loc("Elmo"), loc("Rachel"),
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
                 loc("Muriel")}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
              "tiara", "AkuAku", "rasta", "hair_yellow"}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
nativePos = {{110, 1310}, {984, 1907}, {1040, 1907}}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    95
nativePos2 = {196, 1499}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
cyborgNames = {loc("Unit 0x0007"), loc("Hogminator"), loc("Carol"), 
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    98
               loc("Blender"), loc("Elderbot"), loc("Fiery Water")}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    99
cyborgsDif = {2, 2, 2, 2, 2, 1}
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   100
cyborgsHealth = {45, 45, 45, 40, 40, 20}
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   101
cyborgPos = {945, 1216}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
cyborgsNum = 6
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
cyborgsPos = {{2243, 1043}, {3588, 1227}, {2781, 1388},
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   104
              {3749, 1040}, {2475, 1338}, {3853, 881}}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   105
cyborgsDir = {"Left", "Left", "Left", "Left", "Left", "Right"}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   106
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   107
princessTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   108
nativesTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   109
biomechanicTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   110
cyborgTeamName = nil
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   111
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
princessPos = {3737, 1181}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
crateConsts = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
reactions = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   116
nativeMidPos = {1991, 841}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   117
cyborgMidPos = {2109, 726}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   118
nativeMidPos2 = {2250, 1071}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   119
-----------------------------Variables---------------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   120
natives = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   121
native = nil
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   122
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
cyborgs = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
cyborg = nil
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   126
gearDead = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
hedgeHidden = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   129
startAnim = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   130
midAnim = {}
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   131
princessFreedAnim = {}
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   132
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
freshDead = nil
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   134
crates = {}
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
cratesNum = 0
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   136
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   137
princessFreed = false
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   138
closeToPrincess = false
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   139
friendsEscaped = false
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   140
-----------------------------Animations--------------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   141
function EmitDenseClouds(dir)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
  local dif
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   143
  if dir == "Left" then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
    dif = 10
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
  else
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
    dif = -10
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   147
  end
7520
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   148
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   149
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   150
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   151
  AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   152
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   153
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   154
  AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
dd0b68bbe456 Mission 7: increased distance between Leaks and the princess, fixed EmitDenseClouds typo
belphegorr <szabibibi@gmail.com>
parents: 7512
diff changeset
   155
  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   156
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   157
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   158
function AnimationSetup()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  table.insert(startAnim, {func = AnimWait, args = {natives[1], 4000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
  table.insert(startAnim, {func = AnimMove, args = {natives[1], "Right", unpack(nativePos2)}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
  if m5DeployedNum == leaksNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   162
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Those aliens are destroying the island!"), SAY_THINK, 5000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   163
  elseif m5DeployedNum == denseNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Dude, all the plants are gone!"), SAY_THINK, 3500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("What am I gonna...eat, yo?"), SAY_THINK, 3500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  elseif m5DeployedNum == girlNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   167
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Fell From Heaven is the best! Fell From Heaven is the greatest!"), SAY_THINK, 7000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   168
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Yuck! I bet they'll keep worshipping her even after I save the village!"), SAY_THINK, 7500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   169
  elseif m5DeployedNum == chiefNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I'm getting old for this!"), SAY_THINK, 4000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
  elseif m5DeployedNum == waterNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I'm getting thirsty..."), SAY_THINK, 3000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   173
  elseif m5DeployedNum == buffaloNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   174
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I wonder why I'm so angry all the time..."), SAY_THINK, 6000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   175
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("It must be a childhood trauma..."), SAY_THINK, 4000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Just wait till I get my hands on that trauma! ARGH!"), SAY_THINK, 6500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
  elseif m5DeployedNum == wiseNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I could just teleport myself there..."), SAY_THINK, 4500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   179
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("It's a shame, I forgot how to do that!"), SAY_THINK, 4500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   180
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   181
  table.insert(startAnim, {func = AnimCustomFunction, args = {natives[1], RestoreHedge, {cyborg}}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   182
  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
  table.insert(startAnim, {func = AnimTurn, args = {natives[2], "Left"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   185
  table.insert(startAnim, {func = AnimTurn, args = {natives[3], "Left"}})
12263
2c8e7e73ef58 Use format strings everywhere in A Classic Fairytale (for translators)
Wuzzy <almikes@aol.com>
parents: 12049
diff changeset
   186
  table.insert(startAnim, {func = AnimSay, args = {cyborg, string.format(loc("Hello again, %s!"), nativeUnNames[m5DeployedNum]), SAY_SAY, 2500}})
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   187
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I just found out that they have captured your princess!"), SAY_SAY, 7000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   188
  if m5DeployedNum == girlNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Of course I have to save her. What did I expect?!"), SAY_SAY, 7000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
  elseif m5DeployedNum == denseNum then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
    table.insert(startAnim, {func = AnimCustomFunction, args = {natives[1], EmitDenseClouds, {"Right"}}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   192
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   193
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("She's behind that tall thingy."), SAY_SAY, 5000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   194
  table.insert(startAnim, {func = FollowGear, swh = false, args = {princess}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   195
  table.insert(startAnim, {func = AnimWait, swh = false, args = {princess, 1000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   196
  table.insert(startAnim, {func = FollowGear, swh = false, args = {cyborg}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I'm here to help you rescue her."), SAY_SAY, 5000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
  table.insert(startAnim, {func = AnimSay, args = {natives[2], loc("Yo, dude, we're here, too!"), SAY_SHOUT, 4000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  table.insert(startAnim, {func = AnimSay, args = {natives[3], loc("We were trying to save her and we got lost."), SAY_SHOUT, 6000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   200
  table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("That's typical of you!"), SAY_SAY, 3000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
  table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Why are you helping us, uhm...?"), SAY_SAY, 3000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   202
  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Call me Beep! Well, 'cause I'm such a nice...person!"), SAY_SAY, 2500}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   203
  table.insert(startAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   204
  table.insert(startAnim, {func = AnimSwitchHog, args = {natives[1]}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   205
  table.insert(startAnim, {func = AnimWait, args = {natives[1], 1}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
  AddSkipFunction(startAnim, SkipStartAnim, {})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
  table.insert(midAnim, {func = AnimCustomFunction, args = {natives[1], RestoreHedge, {cyborg}}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   209
  table.insert(midAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgMidPos)}}) 
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   210
  table.insert(midAnim, {func = AnimTurn, args = {cyborg, "Left"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   211
  table.insert(midAnim, {func = AnimTeleportGear, args = {natives[1], unpack(nativeMidPos)}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   212
  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Here, let me help you save her!"), SAY_SAY, 5000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   213
  table.insert(midAnim, {func = AnimSay, args = {natives[1], loc("Thanks!"), SAY_SAY, 2000}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   214
  table.insert(midAnim, {func = AnimTeleportGear, args = {natives[1], unpack(nativeMidPos2)}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
  table.insert(midAnim, {func = AnimSay, args = {natives[1], loc("Why can't he just let her go?!"), SAY_THINK, 5000}})
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   216
  AddSkipFunction(midAnim, SkipMidAnim, {})
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   217
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   218
  table.insert(princessFreedAnim, {func = AnimSay, args = {princess, loc("Thank you, my hero!"), SAY_SAY, 4000}})
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   219
  table.insert(princessFreedAnim, {func = Victory, args = {}})
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   220
  AddSkipFunction(princessFreedAnim, SkipPrincessFreedAnim, {})
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   221
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   222
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   223
--------------------------Anim skip functions--------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   224
function AfterMidAnim()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   225
  HideHedge(cyborg)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   226
  SetupPlace3()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   227
  SetGearMessage(natives[1], 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   228
  AddNewEvent(CheckPrincessFreed, {}, DoPrincessFreed, {}, 0)
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   229
  AddNewEvent(CheckCloseToPrincess, {}, DoCloseToPrincess, {}, 0)
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   230
  AddNewEvent(CheckFriendsEscaped, {}, DoFriendsEscaped, {}, 0)
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   231
  EndTurn(true)
13134
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   232
  ShowMission(loc("Family Reunion"), loc("Salvation"),
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   233
     loc("Get your teammates out of their natural prison and save the princess!") .."|"..
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   234
     loc("All your hedgehogs must be above the marked height!") .."|"..
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   235
     loc("Hint: Drilling holes should solve everything.").."|"..
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   236
     loc("Hint: It might be a good idea to place a girder before starting to drill. Just saying.").."|"..
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   237
     string.format(loc("Hint: %s needs to get really close to the princess!"), nativeNames[m5DeployedNum]).."|"..
d204ed947785 ACF7: Fix incorrect hog name mentioned in 2nd mission text
Wuzzy <Wuzzy2@mail.ru>
parents: 12933
diff changeset
   238
     loc("Mines time: 5 seconds"), 1, 7000)
13687
a8b2a5e7e9db Clean up more visual gears stuff in scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
   239
  local vCirc = AddVisualGear(0,0,vgtCircle,0,true)
7493
f261d6bf76b3 Mission 7: Added a visual gear to mark height, changed ShowMission to be more precise.
belphegorr <szabibibi@gmail.com>
parents: 7484
diff changeset
   240
  SetVisualGearValues(vCirc, 2625, 1500, 100, 255, 1, 10, 0, 120, 3, 0xff00ffff)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   241
end
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   242
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   243
function SkipPrincessFreedAnim()
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   244
  Victory()
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   245
end
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   246
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   247
function SkipMidAnim()
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   248
  AnimTeleportGear(natives[1], unpack(nativeMidPos2))
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   249
  AnimSwitchHog(natives[1])
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   250
  AnimWait(natives[1], 1)
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   251
end
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   252
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   253
function SetupPlace3()
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   254
  SpawnSupplyCrate(2086, 1887, amRope, 1)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   255
  SpawnSupplyCrate(2147, 728, amBlowTorch, 2)
13169
6869d27a2f3f ACF7: Add one pick hammer in crate
Wuzzy <Wuzzy2@mail.ru>
parents: 13145
diff changeset
   256
  SpawnSupplyCrate(2778, 1372, amPickHammer, 4)
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   257
  SpawnSupplyCrate(2579, 1886, amPickHammer, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   258
  SpawnSupplyCrate(2622, 1893, amGirder, 1)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   259
  SpawnSupplyCrate(2671, 1883, amPortalGun, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   260
  SpawnSupplyCrate(2831, 1384, amGirder, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   261
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
  SetTimer(AddGear(2725, 1387, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
  SetTimer(AddGear(2760, 1351, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
	SetTimer(AddGear(2805, 1287, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
	SetTimer(AddGear(2831, 1376, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
	SetTimer(AddGear(2684, 1409, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
	SetTimer(AddGear(2637, 1428, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
	SetTimer(AddGear(2278, 1280, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
	SetTimer(AddGear(2311, 1160, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
	SetTimer(AddGear(2339, 1162, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
	SetTimer(AddGear(2362, 1184, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
	SetTimer(AddGear(2407, 1117, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
	SetTimer(AddGear(2437, 1143, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
	SetTimer(AddGear(2472, 1309, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
	SetTimer(AddGear(2495, 1331, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
	SetTimer(AddGear(2536, 1340, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
	SetTimer(AddGear(2569, 1360, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
	SetTimer(AddGear(2619, 1379, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
	SetTimer(AddGear(2596, 1246, gtMine, 0, 0, 0, 0), 5000)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   282
function SkipStartAnim()
12776
7260e9b37b62 ACF7: Set correct hog position after skipping start anim
Wuzzy <Wuzzy2@mail.ru>
parents: 12613
diff changeset
   283
  AnimSetGearPosition(natives[1], unpack(nativePos2))
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
  AnimSwitchHog(natives[1])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
  AnimWait(natives[1], 1)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
function AfterStartAnim()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
  HideHedge(cyborg)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
  SetupPlace2()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
  SetGearMessage(natives[1], 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
  AddNewEvent(CheckGearDead, {natives[1]}, EndMission, {}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
  AddNewEvent(CheckGearDead, {natives[2]}, EndMission, {}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
  AddNewEvent(CheckGearDead, {natives[3]}, EndMission, {}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
  AddNewEvent(CheckGearDead, {princess}, EndMission, {}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   296
  AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
  for i = 1, cyborgsNum do
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
    AddNewEvent(CheckGearDead, {cyborgs[i]}, DoCyborgDead, {i}, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
  end
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   300
  AddNewEvent(CheckOutOfCluster, {}, DoOutOfCluster, {}, 1)
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   301
  AddNewEvent(CheckOutOfGrenade, {}, DoOutOfGrenade, {}, 1)
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   302
--  AddNewEvent(CheckNeedToHide, {}, DoNeedToHide, {}, 1)
13742
2bb7141496a9 Use SetTurnTimeLeft and SetReadyTimeLeft in all scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13687
diff changeset
   303
  SetTurnTimeLeft(TurnTime)
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   304
  ShowMission(loc("Family Reunion"), loc("Hostage Situation"), loc("Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"), 1, 7000)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   306
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
function SetupPlace2()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
	PlaceGirder(709, 564, 7)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
	PlaceGirder(591, 677, 7)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
	PlaceGirder(473, 794, 7)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
	PlaceGirder(433, 933, 5)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
	PlaceGirder(553, 1052, 5)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
	PlaceGirder(674, 1170, 5)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
	PlaceGirder(710, 1310, 7)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   315
	PlaceGirder(648, 1427, 5)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
  PlaceGirder(2110, 980, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   318
	SpawnSupplyCrate(814, 407, amBazooka, 4)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   319
	clusterCrate = SpawnSupplyCrate(862, 494, amClusterBomb, 4)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   320
	SpawnSupplyCrate(855, 486, amBee, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   321
	grenadeCrate1 = SpawnSupplyCrate(849, 459, amGrenade, 4)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   322
	SpawnSupplyCrate(2077, 847, amWatermelon, 3)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   323
	grenadeCrate2 = SpawnSupplyCrate(2122, 847, amGrenade, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   325
	SpawnSupplyCrate(747, 1577, amPickHammer, 1)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   326
	SpawnSupplyCrate(496, 1757, amGirder, 2)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   327
	SpawnSupplyCrate(1809, 1880, amGirder, 1)
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   328
	SpawnSupplyCrate(530, 1747, amPortalGun, 1)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   331
-----------------------------Events------------------------------------
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   332
function CheckCloseToPrincess()
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   333
  if GetX(natives[1]) == nil or GetX(princess) == nil then
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   334
    return false
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   335
  end
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   336
  return math.abs(GetX(natives[1]) - GetX(princess)) <= 20 and math.abs(GetY(natives[1]) - GetY(princess)) <= 17 and StoppedGear(natives[1])
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   337
end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   338
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   339
function CheckFriendsEscaped()
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   340
  if GetX(natives[2]) == nil or GetX(natives[3]) == nil then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   341
    return false
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   342
  end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   343
  return GetY(natives[2]) < 1500 and GetY(natives[3]) < 1500 and StoppedGear(natives[2]) and StoppedGear(natives[3])
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   344
end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   345
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   346
function CheckPrincessFreed()
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   347
  return CheckCloseToPrincess() and CheckFriendsEscaped()
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   348
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
function DoPrincessFreed()
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   351
  AddAnim(princessFreedAnim)
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   352
end
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   353
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   354
function DoFriendsEscaped()
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   355
  if friendsEscaped then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   356
    return
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   357
  end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   358
  if not CheckCloseToPrincess() then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   359
    if GetX(natives[2]) == nil and GetX(natives[1]) == nil then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   360
      return
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   361
    end
13138
52d7672363c1 ACF7: Fix incorrect hog name used in speech bubble
Wuzzy <Wuzzy2@mail.ru>
parents: 13135
diff changeset
   362
    HogSay(natives[2], string.format(loc("Finally! We're out of this hellhole. Now go save the princess, %s!"), nativeNames[m5DeployedNum]), SAY_SAY)
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   363
  end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   364
  friendsEscaped = true
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   365
end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   366
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   367
function DoCloseToPrincess()
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   368
  if closeToPrincess then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   369
    return
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   370
  end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   371
  if not CheckFriendsEscaped() then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   372
    if GetX(natives[2]) == nil then
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   373
      return
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   374
    end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   375
    HogSay(natives[2], loc("Hey, don't forget us! We still need to climb up!"), SAY_SHOUT)
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   376
    FollowGear(natives[2])
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   377
  end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   378
  closeToPrincess = true
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   379
end
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   380
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   381
function Victory()
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   382
  if not princessFreed then
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   383
    if progress and progress<7 then
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   384
      SaveCampaignVar("Progress", "7")
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   385
    end
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   386
    princessFreed = true
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   387
    DismissTeam(cyborgTeamName)
12613
34685d3326a7 ACF7: Don't make princess disappear instantly after victory
Wuzzy <almikes@aol.com>
parents: 12569
diff changeset
   388
    EndTurn(true)
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   389
  end
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
function CheckCyborgsDead()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
  return cyborgsLeft == 0
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
function DoCyborgsDead()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7436
diff changeset
   397
  SetGearMessage(CurrentHedgehog, 0)
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   398
  RestoreHedge(princess)
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   399
--  RemoveEventFunc(CheckNeedToHide)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
  AddAnim(midAnim)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  AddFunction({func = AfterMidAnim, args = {}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   402
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
function DoCyborgDead(index)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  if cyborgsLeft == 0 then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
    return
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   408
  if index == 1 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   409
    SpawnSupplyCrate(1700, 407, amBazooka, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
  elseif index == 2 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   411
    SpawnSupplyCrate(1862, 494, amClusterBomb, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
  elseif index == 3 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   413
    SpawnSupplyCrate(1855, 486, amBee, 1)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
  elseif index == 4 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   415
    SpawnSupplyCrate(1849, 459, amGrenade, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
  elseif index == 5 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   417
    SpawnSupplyCrate(2122, 847, amGrenade, 3)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
  elseif index == 6 then
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   419
    SpawnSupplyCrate(2077, 847, amWatermelon, 1)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
function CheckGearsDead(gearList)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
  for i = 1, # gearList do
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
    if gearDead[gearList[i]] ~= true then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
      return false
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
    end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   428
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
  return true
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
function CheckGearDead(gear)
7436
4802191f6a09 Removed gfOneClanMode from Mission 7
belphegorr <szabibibi@gmail.com>
parents: 7434
diff changeset
   434
  return gearDead[gear]
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
function EndMission()
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   438
  if not princessFreed then
13135
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   439
    RemoveEventFunc(CheckFriendsEscaped)
824a75401a61 ACF7: Make hogs talk when you complete a part of the second mission goal (reach princess / free friends)
Wuzzy <Wuzzy2@mail.ru>
parents: 13134
diff changeset
   440
    RemoveEventFunc(CheckCloseToPrincess)
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   441
    RemoveEventFunc(CheckPrincessFreed)
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   442
    AddCaption(loc("So the princess was never heard of again ..."))
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   443
    DismissTeam(nativesTeamName)
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   444
    DismissTeam(princessTeamName)
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   445
    EndTurn(true)
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   446
  end
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   447
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   449
function CheckOutOfCluster()
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   450
  return CheckGearDead(clusterCrate) and GetAmmoCount(natives[1], amClusterBomb) == 0
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   451
end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   452
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   453
function CheckOutOfGrenade()
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   454
  return CheckGearDead(grenadeCrate1) and CheckGearDead(grenadeCrate2) and GetAmmoCount(natives[1], amGrenade) == 0
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   455
end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   456
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   457
function DoOutOfCluster()
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   458
  if (GetX(natives[1]) == nil) then
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   459
    return
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   460
  end
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   461
  clusterCrate = SpawnSupplyCrate(GetX(natives[1]) - 50, GetY(natives[1]) - 50, amClusterBomb, 3)
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   462
end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   463
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   464
function DoOutOfGrenade()
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   465
  if (GetX(natives[1]) == nil) then
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   466
    return
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   467
  end
12933
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12901
diff changeset
   468
  grenadeCrate2 = SpawnSupplyCrate(GetX(natives[1]) - 50, GetY(natives[1]) - 50, amGrenade, 3)
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   469
end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   470
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   471
function CheckNeedToHide()
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   472
  if gearDead[princess] == true then
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   473
    return false
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   474
  end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   475
  return TurnTimeLeft == 0
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   476
end
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   477
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   478
function DoNeedToHide()
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   479
  HideHedge(princess)
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   480
end
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   481
-----------------------------Misc--------------------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
function HideHedge(hedge)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
  if hedgeHidden[hedge] ~= true then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
    HideHog(hedge)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
    hedgeHidden[hedge] = true
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   489
function RestoreHedge(hedge)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
  if hedgeHidden[hedge] == true then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
    RestoreHog(hedge)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
    hedgeHidden[hedge] = false
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
function GetVariables()
8944
ed2509832311 fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents: 8043
diff changeset
   497
  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: 13138
diff changeset
   498
  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum")) or leaksNum
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13138
diff changeset
   499
  m2Choice = tonumber(GetCampaignVar("M2Choice")) or choiceRefused
5083fb0a2992 A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents: 13138
diff changeset
   500
  m5Choice = tonumber(GetCampaignVar("M5Choice")) or choiceEliminate
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
function SetupPlace()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
  SetHogHat(natives[1], nativeHats[m5DeployedNum])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
  SetHogName(natives[1], nativeNames[m5DeployedNum])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  if m2Choice ~= choiceAccepted or m5Choice ~= choiceEliminate then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   507
    DeleteGear(cyborgs[cyborgsNum])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   508
    cyborgsNum = cyborgsNum - 1
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
  HideHedge(cyborg)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   511
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   513
function SetupAmmo()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
  AddAmmo(cyborgs[1], amBazooka, 100)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  AddAmmo(cyborgs[1], amGrenade, 100)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
  AddAmmo(cyborgs[1], amClusterBomb, 100)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
  AddAmmo(cyborgs[1], amSniperRifle, 1)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
  AddAmmo(cyborgs[1], amDynamite, 100)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
  AddAmmo(cyborgs[1], amBaseballBat, 100)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
  AddAmmo(cyborgs[1], amMolotov, 100)
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   521
  AddAmmo(cyborgs[1], amWatermelon, 1)
11038
5a9dde74127e Fix weapon name - bug #967
nemo
parents: 10423
diff changeset
   522
  AddAmmo(cyborgs[1], amAirAttack, 2)
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   523
  AddAmmo(cyborgs[1], amDrillStrike, 1)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
function AddHogs()
14508
d72fb761aa59 ACF: Consistent cannibals flag/voice, change Princess flag
Wuzzy <Wuzzy2@mail.ru>
parents: 14507
diff changeset
   527
  princessTeamName = AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_female")
14633
bd15c8551318 Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14508
diff changeset
   528
  SetTeamPassive(princessTeamName, true)
13479
bc5a086a91dc ACF7: Fix princess being in wrong clan
Wuzzy <Wuzzy2@mail.ru>
parents: 13169
diff changeset
   529
  princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
bc5a086a91dc ACF7: Fix princess being in wrong clan
Wuzzy <Wuzzy2@mail.ru>
parents: 13169
diff changeset
   530
  SetGearAIHints(princess, aihDoesntMatter)
bc5a086a91dc ACF7: Fix princess being in wrong clan
Wuzzy <Wuzzy2@mail.ru>
parents: 13169
diff changeset
   531
  gearDead[princess] = false
bc5a086a91dc ACF7: Fix princess being in wrong clan
Wuzzy <Wuzzy2@mail.ru>
parents: 13169
diff changeset
   532
14507
f8c2b995c009 Use player team name in ACF campaign
Wuzzy <Wuzzy2@mail.ru>
parents: 14506
diff changeset
   533
  nativesTeamName = AddMissionTeam(-2)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
  for i = 7, 9 do
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
    natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
    gearDead[natives[i-6]] = false
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   538
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   539
  cyborgTeamName = AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   540
  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   541
  gearDead[cyborg] = false
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   543
  biomechanicTeamName = AddTeam(loc("Biomechanic Team"), -1, "ring", "UFO", "Robot", "cm_cyborg")
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
  for i = 1, cyborgsNum do
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
    cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
    gearDead[cyborgs[i]] = false
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
  cyborgsLeft = cyborgsNum
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   549
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550
  for i = 1, 3 do
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7436
diff changeset
   551
    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   552
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   553
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7436
diff changeset
   554
  AnimSetGearPosition(cyborg, unpack(cyborgPos))
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7436
diff changeset
   555
  AnimSetGearPosition(princess, unpack(princessPos))
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   556
  AnimTurn(princess, "Left")
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   557
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   558
  for i = 1, cyborgsNum do
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7436
diff changeset
   559
    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   560
    AnimTurn(cyborgs[i], cyborgsDir[i])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   563
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
function CondNeedToTurn(hog1, hog2)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   565
  xl, xd = GetX(hog1), GetX(hog2)
7675
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   566
  if xl == nil or xd == nil then
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   567
    return
58620e9e5ed5 Fixed grammar/vocabulary and improved balance
belphegorr <szabibibi@gmail.com>
parents: 7520
diff changeset
   568
  end
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
  if xl > xd then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   571
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
  elseif xl < xd then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   573
    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   577
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   578
-----------------------------Main Functions----------------------------
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   579
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
function onGameInit()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
	Seed = 0
14633
bd15c8551318 Make use of passive teams in various campaign missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14508
diff changeset
   582
	GameFlags = gfSolidLand + gfDisableLandObjects + gfDisableGirders
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
	TurnTime = 60000 
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   584
	CaseFreq = 0
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   585
	MinesNum = 0
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   586
	MinesTime = 3000
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
	Explosives = 0
10423
b9d6463cf2ca fix mapgen of other scripts too
sheepluva
parents: 10290
diff changeset
   588
  MapGen = mgDrawn
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
	Theme = "Hell"
7472
cd747aefcba1 Fixed a few bugs in mission 7
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   590
  SuddenDeathTurns = 35
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   591
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   592
	for i = 1, #map do
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
		ParseCommand('draw ' .. map[i])
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   594
	end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   595
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   596
  AddHogs()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   597
  AnimInit()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   598
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   599
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   600
function onGameStart()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   601
  GetVariables()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   602
  SetupAmmo()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   603
  SetupPlace()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
  AnimationSetup()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
  AddAnim(startAnim)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
  AddFunction({func = AfterStartAnim, args = {}})
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   607
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   608
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
function onGameTick()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
  AnimUnWait()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
  if ShowAnimation() == false then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   612
    return
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   613
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   614
  ExecuteAfterAnimations()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   615
  CheckEvents()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   616
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   617
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   618
function onGearDelete(gear)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   619
  gearDead[gear] = true
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   620
  if GetGearType(gear) == gtHedgehog then
14506
f37910a73c19 Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents: 14422
diff changeset
   621
    if GetHogTeamName(gear) == biomechanicTeamName then
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   622
      cyborgsLeft = cyborgsLeft - 1
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   623
    end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   624
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   625
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   626
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   627
function onAmmoStoreInit()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   628
  SetAmmo(amSkip, 9, 0, 0, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   629
  SetAmmo(amSwitch, 9, 0, 0, 0)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   630
	SetAmmo(amBazooka, 0, 0, 0, 8)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
	SetAmmo(amClusterBomb,0, 0, 0, 8)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
	SetAmmo(amBee, 0, 0, 0, 3)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   633
	SetAmmo(amGrenade, 0, 0, 0, 8)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   634
	SetAmmo(amWatermelon, 0, 0, 0, 2)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   635
	SetAmmo(amSniperRifle, 0, 0, 0, 3)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   636
	SetAmmo(amPickHammer, 0, 0, 0, 1)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   637
	SetAmmo(amGirder, 0, 0, 0, 3)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
	SetAmmo(amPortalGun, 0, 0, 0, 1)
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   639
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   640
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   641
function onNewTurn()
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   642
  if AnimInProgress() then
13752
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13742
diff changeset
   643
    SetTurnTimeLeft(MAX_TURN_TIME)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
    return
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
  end
13479
bc5a086a91dc ACF7: Fix princess being in wrong clan
Wuzzy <Wuzzy2@mail.ru>
parents: 13169
diff changeset
   646
  if CurrentHedgehog == cyborg then
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   647
    if CheckCyborgsDead() ~= true then
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   648
      for i = 1, 3 do
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   649
        if gearDead[natives[i]] ~= true then
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   650
          HideHedge(natives[i])
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   651
        end
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   652
      end
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   653
    end
12364
5857936921ec Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents: 12263
diff changeset
   654
    EndTurn(true)
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   655
  else
7484
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   656
    for i = 1, 3 do
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   657
      if gearDead[natives[i]] ~= true then
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   658
        RestoreHedge(natives[i])
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   659
      end
f3a7c4e75815 Mission 7: changed enemy health, ammos, fixed crashes, princess no longer hidden
belphegorr <szabibibi@gmail.com>
parents: 7472
diff changeset
   660
    end
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
14919
4596357d002d Fix cut scenes not being skipped when pressing precise in enemy turn (bug 280)
Wuzzy <Wuzzy2@mail.ru>
parents: 14633
diff changeset
   664
function onPreciseLocal()
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
  if GameTime > 2500 and AnimInProgress() then
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   666
    SetAnimSkip(true)
7436
4802191f6a09 Removed gfOneClanMode from Mission 7
belphegorr <szabibibi@gmail.com>
parents: 7434
diff changeset
   667
    return
7434
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
  end
3daea8c9a770 Added Mission 7: Family Reunion
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
end