author | Wuzzy <Wuzzy2@mail.ru> |
Sat, 04 May 2019 19:07:58 +0200 | |
changeset 14897 | 543729d313f5 |
parent 14682 | 0bba06a05d52 |
child 14919 | 4596357d002d |
permissions | -rw-r--r-- |
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:
12364
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:
12364
diff
changeset
|
2 |
A Classic Fairytale: The enemy of my enemy |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
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:
12364
diff
changeset
|
4 |
= SUMMARY = |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
5 |
Simple deathmatch on the Islands map. |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
6 |
|
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
7 |
= 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:
12364
diff
changeset
|
8 |
Wipe out the Hedge-cogs and Leader teams |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
9 |
|
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
10 |
= 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:
12364
diff
changeset
|
11 |
- Cut scene: startAnim |
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
12 |
- Player starts with 3-4 natives and 4 cannibals |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
13 |
- Player plays with 4 natives if m5DeployedNum ~= leaksNum and m8DeployedLeader == 0 |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
14 |
- Enemy starts with 5 cyborgs |
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:
12364
diff
changeset
|
15 |
- TBS |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
16 |
- 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:
12364
diff
changeset
|
17 |
- Cut scene: finalAnim |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
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:
12364
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:
12364
diff
changeset
|
20 |
]] |
bca911f8e804
Add comments for all A Classic Fairytale missions to summarize the story in a flow chart-like fashion
Wuzzy <Wuzzy2@mail.ru>
parents:
12364
diff
changeset
|
21 |
|
8043 | 22 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
23 |
HedgewarsScriptLoad("/Scripts/Animate.lua") |
|
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
24 |
HedgewarsScriptLoad("/Scripts/Utils.lua") |
7460 | 25 |
|
26 |
||
27 |
--------------------------------------------Constants------------------------------------ |
|
28 |
choiceAccepted = 1 |
|
29 |
choiceRefused = 2 |
|
30 |
choiceAttacked = 3 |
|
31 |
||
32 |
choiceEliminate = 1 |
|
33 |
choiceSpare = 2 |
|
34 |
||
35 |
leaksNum = 1 |
|
36 |
denseNum = 2 |
|
37 |
waterNum = 3 |
|
38 |
buffaloNum = 4 |
|
39 |
chiefNum = 5 |
|
40 |
girlNum = 6 |
|
41 |
wiseNum = 7 |
|
42 |
ramonNum = 8 |
|
43 |
spikyNum = 9 |
|
44 |
||
45 |
denseScene = 1 |
|
46 |
princessScene = 2 |
|
47 |
waterScene = 3 |
|
48 |
cyborgScene = 4 |
|
49 |
||
50 |
nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), |
|
51 |
loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"), |
|
52 |
loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese") |
|
53 |
} |
|
54 |
||
55 |
nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief", |
|
56 |
"tiara", "AkuAku", "rasta", "hair_yellow"} |
|
57 |
||
58 |
nativePos = {{1259, 120}, {2378, 796}, {424, 1299}, {3322, 260}, {1022, 1550}} |
|
59 |
nativeDir = {"Right", "Left", "Right", "Left", "Right"} |
|
60 |
||
61 |
cannibalNames = {loc("Honest Lee"), loc("Vegan Jack"), loc("Sirius Lee"), |
|
62 |
loc("Brutal Lily")} |
|
63 |
cannibalPos = {{162, 266}, {2159, 1517}, {3311, 1621}, {1180, 1560}} |
|
64 |
cannibalDir = {"Right", "Left", "Left", "Right"} |
|
65 |
cannibalsNum = 4 |
|
66 |
||
67 |
playersDir = {"Right", "Left", "Right", "Left", "Right", "Right", "Left", "Left", "Right"} |
|
68 |
playersAntiDir = {"Left", "Right", "Left", "Right", "Left", "Left", "Right", "Right", "Left"} |
|
69 |
||
70 |
cyborgNames = {loc("Smith 0.97"), loc("Smith 0.98"), loc("Smith 0.99a"), |
|
71 |
loc("Smith 0.99b"), loc("Smith 0.99f"), loc("Smith 1.0")} |
|
72 |
cyborgPos = {{2162, 20}, {2458, 564}, {542, 1133}, {3334, 1427}} |
|
73 |
cyborgDir = "Right" |
|
74 |
cyborgsNum = 6 |
|
75 |
cyborgsPos = {{1490, 330}, {1737, 1005}, {2972, 922}, {1341, 1571}, |
|
76 |
{751, 543}, {3889, 907}} |
|
77 |
cyborgsDir = {"Right", "Right", "Left", "Right", "Right", "Left"} |
|
78 |
||
79 |
leaderPos = {3474, 151} |
|
80 |
leaderDir = "Left" |
|
81 |
||
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
82 |
cyborgTeamName = nil |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
83 |
nativesTeamName = nil |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
84 |
cannibalsTeamName = nil |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
85 |
hedgecogsTeamName = nil |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
86 |
leaderTeamName = nil |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
87 |
|
7460 | 88 |
-----------------------------Variables--------------------------------- |
89 |
natives = {} |
|
90 |
origNatives = {} |
|
91 |
||
92 |
cyborgs = {} |
|
93 |
cyborg = nil |
|
94 |
||
95 |
cannibals = {} |
|
96 |
players = {} |
|
97 |
leader = nil |
|
98 |
||
99 |
gearDead = {} |
|
100 |
hedgeHidden = {} |
|
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
101 |
trackedMines = {} |
7460 | 102 |
|
103 |
startAnim = {} |
|
104 |
finalAnim = {} |
|
105 |
-----------------------------Animations-------------------------------- |
|
106 |
function CondNeedToTurn(hog1, hog2) |
|
107 |
xl, xd = GetX(hog1), GetX(hog2) |
|
108 |
if xl > xd then |
|
109 |
AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}}) |
|
110 |
AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}}) |
|
111 |
elseif xl < xd then |
|
112 |
AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}}) |
|
113 |
AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}}) |
|
114 |
end |
|
115 |
end |
|
116 |
||
117 |
function CondNeedToTurn2(hog1, hog2) |
|
118 |
xl, xd = GetX(hog1), GetX(hog2) |
|
119 |
if xl > xd then |
|
120 |
AnimTurn(hog1, "Left") |
|
121 |
AnimTurn(hog2, "Right") |
|
122 |
elseif xl < xd then |
|
123 |
AnimTurn(hog2, "Left") |
|
124 |
AnimTurn(hog1, "Right") |
|
125 |
end |
|
126 |
end |
|
127 |
||
128 |
function EmitDenseClouds(dir) |
|
129 |
local dif |
|
130 |
if dir == "Left" then |
|
131 |
dif = 10 |
|
132 |
else |
|
133 |
dif = -10 |
|
134 |
end |
|
135 |
if dir == nil then |
|
136 |
dx, dy = GetGearVelocity(dense) |
|
137 |
if dx < 0 then |
|
138 |
dif = 10 |
|
139 |
else |
|
140 |
dif = -10 |
|
141 |
end |
|
142 |
end |
|
143 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
144 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
145 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
146 |
AnimInsertStepNext({func = AnimWait, args = {dense, 800}}) |
|
147 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
148 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
149 |
AnimInsertStepNext({func = AnimWait, args = {dense, 800}}) |
|
150 |
AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false}) |
|
151 |
end |
|
152 |
||
153 |
function RestoreNatives(cgi) |
|
154 |
for i = 1, playersNum do |
|
155 |
RestoreHedge(players[i]) |
|
156 |
AnimOutOfNowhere(players[i], GetGearPosition(players[i])) |
|
157 |
end |
|
158 |
end |
|
159 |
||
160 |
function AnimationSetup() |
|
161 |
SetupCyborgStartAnim() |
|
162 |
SetupPeopleStartAnim() |
|
163 |
SetupEnemyStartAnim() |
|
164 |
AddSkipFunction(startAnim, SkipStartAnim, {}) |
|
165 |
end |
|
166 |
||
167 |
function SetupCyborgStartAnim() |
|
168 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 3000}}) |
|
169 |
table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}}) |
|
170 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
171 |
table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}}) |
|
172 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
173 |
table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}}) |
|
174 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
175 |
table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[2])}}) |
|
176 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
177 |
table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}}) |
|
178 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
179 |
table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}}) |
|
180 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
181 |
table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[3])}}) |
|
182 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 1800}}) |
|
183 |
table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[4])}}) |
|
184 |
table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}}) |
|
185 |
table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Everything looks OK..."), SAY_THINK, 2500}}) |
|
186 |
table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("This will be fun!"), SAY_THINK, 2500}}) |
|
187 |
table.insert(startAnim, {func = AnimJump, args = {cyborg, "high"}}) |
|
188 |
table.insert(startAnim, {func = AnimCustomFunction, args = {cyborg, RestoreNatives, {true}}}) |
|
189 |
table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("HAHA!"), SAY_SHOUT, 2000}}) |
|
190 |
table.insert(startAnim, {func = AnimSwitchHog, args = {players[1]}}) |
|
191 |
table.insert(startAnim, {func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}}) |
|
192 |
table.insert(startAnim, {func = HideHedge, swh = false, args = {cyborg}}) |
|
193 |
end |
|
194 |
||
195 |
function SetupPeopleStartAnim() |
|
196 |
for i = 1, playersNum do |
|
197 |
table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersAntiDir[i]}}) |
|
198 |
end |
|
199 |
table.insert(startAnim, {func = AnimWait, args = {players[1], 800}}) |
|
200 |
for i = 1, playersNum do |
|
201 |
table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersDir[i]}}) |
|
202 |
end |
|
203 |
table.insert(startAnim, {func = AnimWait, args = {players[1], 800}}) |
|
204 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("What is this place?"), SAY_SHOUT, 2500}}) |
|
205 |
if m5LeaksDead == 1 then |
|
206 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("And how am I alive?!"), SAY_SAY, 3000}}) |
|
207 |
end |
|
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
208 |
local playerTalker |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
209 |
-- There are 3 or 4 natives in this mission. The last one takes part in the dialog |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
210 |
if nativesNum >= 4 then |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
211 |
playerTalker = players[4] |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
212 |
else |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
213 |
playerTalker = players[3] |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
214 |
end |
7460 | 215 |
table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], players[2]}}}) |
216 |
table.insert(startAnim, {func = AnimSay, args = {players[2], loc("It must be the cyborgs again!"), SAY_SAY, 4000}}) |
|
217 |
table.insert(startAnim, {func = AnimSay, args = {players[3], loc("Looks like the whole world is falling apart!"), SAY_SAY, 6000}}) |
|
218 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Look out! We're surrounded by cannibals!"), SAY_SHOUT, 6000}}) |
|
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
219 |
table.insert(startAnim, {func = AnimCustomFunction, args = {playerTalker, CondNeedToTurn, {playerTalker, cannibals[1]}}}) |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
220 |
table.insert(startAnim, {func = AnimCustomFunction, args = {playerTalker, CondNeedToTurn, {players[1], cannibals[1]}}}) |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
221 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Cannibals?! You're the cannibals!"), SAY_SHOUT, 4000}}) |
7460 | 222 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("WHAT?! You're the ones attacking us!"), SAY_SHOUT, 5000}}) |
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
223 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("You have kidnapped our whole tribe!"), SAY_SHOUT, 4000}}) |
7460 | 224 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("You've been assaulting us, we have been just defending ourselves!"), SAY_SHOUT, 8000}}) |
225 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("I can't believe this!"), SAY_SHOUT, 3000}}) |
|
226 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Have we ever attacked you first?"), SAY_SHOUT, 5000}}) |
|
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
227 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Yes!"), SAY_SHOUT, 2000}}) |
7460 | 228 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("When?"), SAY_SHOUT, 2000}}) |
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
229 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Uhmm...ok no."), SAY_SHOUT, 2000}}) |
7460 | 230 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("But you're cannibals. It's what you do."), SAY_SHOUT, 5000}}) |
231 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Again with the 'cannibals' thing!"), SAY_SHOUT, 4000}}) |
|
232 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Where do you get that?!"), SAY_SHOUT, 3000}}) |
|
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
233 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Everyone knows this."), SAY_SHOUT, 2500}}) |
7460 | 234 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("I didn't until about a month ago."), SAY_SHOUT, 4000}}) |
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
235 |
table.insert(startAnim, {func = AnimSay, args = {playerTalker, loc("Hmmm...actually...I didn't either."), SAY_SHOUT, 4000}}) |
7460 | 236 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("About a month ago, a cyborg came and told us that you're the cannibals!"), SAY_SHOUT, 8000}}) |
237 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("A cy-what?"), SAY_SHOUT, 2000}}) |
|
238 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Cyborg. It's what the aliens call themselves."), SAY_SHOUT, 5000}}) |
|
239 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They told us to wear these clothes. They said that this is the newest trend."), SAY_SHOUT, 8000}}) |
|
240 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("They've been manipulating us all this time!"), SAY_SHOUT, 5000}}) |
|
241 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They must be trying to weaken us!"), SAY_SHOUT, 5000}}) |
|
242 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have to unite and defeat those cylergs!"), SAY_SHOUT, 5000}}) |
|
243 |
table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("We can't let them take over our little island!"), SAY_SHOUT, 5000}}) |
|
244 |
end |
|
245 |
||
246 |
function RestoreCyborgs(cgi) |
|
247 |
if cyborgsRestored == true then |
|
248 |
return |
|
249 |
end |
|
250 |
for i = 1, cyborgsNum do |
|
251 |
RestoreHedge(cyborgs[i]) |
|
252 |
if cgi == true then |
|
253 |
AnimOutOfNowhere(cyborgs[i], unpack(cyborgsPos[i])) |
|
254 |
end |
|
255 |
end |
|
256 |
RestoreHedge(leader) |
|
257 |
AnimOutOfNowhere(leader, unpack(leaderPos)) |
|
258 |
cyborgsRestored = true |
|
259 |
end |
|
260 |
||
261 |
function SetupEnemyStartAnim() |
|
262 |
local gear |
|
263 |
table.insert(startAnim, {func = AnimCustomFunction, args = {cannibals[1], RestoreCyborgs, {true}}}) |
|
264 |
if m8EnemyFled == 1 then |
|
265 |
gear = leader |
|
266 |
else |
|
267 |
gear = cyborgs[2] |
|
268 |
end |
|
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
269 |
local turnPlayer |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
270 |
if nativesNum >= 4 then |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
271 |
turnPlayer = players[4] |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
272 |
else |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
273 |
turnPlayer = players[3] |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
274 |
end |
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
275 |
table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {turnPlayer, gear}}}) |
7460 | 276 |
table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], gear}}}) |
277 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("You have finally figured it out!"), SAY_SHOUT, 4500}}) |
|
7527
35d154745d7a
All missions: switched blood needers with meatbags in dialogues
belphegorr <szabibibi@gmail.com>
parents:
7512
diff
changeset
|
278 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("You meatbags are pretty slow, you know!"), SAY_SHOUT, 5500}}) |
7460 | 279 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("Why do you want to take over our island?"), SAY_SHOUT, 5500}}) |
280 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("Do you have any idea how valuable grass is?"), SAY_SHOUT, 5500}}) |
|
281 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("This island is the only place left on Earth with grass on it!"), SAY_SHOUT, 7000}}) |
|
282 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("It's worth more than wood!"), SAY_SHOUT, 4000}}) |
|
283 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("That makes it almost invaluable!"), SAY_SHOUT, 4500}}) |
|
284 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have nowhere else to live!"), SAY_SHOUT, 4500}}) |
|
285 |
table.insert(startAnim, {func = AnimSay, args = {gear, loc("That's not our problem!"), SAY_SHOUT, 4500}}) |
|
286 |
table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We'll give you a problem then!"), SAY_SHOUT, 5000}}) |
|
287 |
table.insert(startAnim, {func = AnimSwitchHog, args = {gear}}) |
|
288 |
end |
|
289 |
||
290 |
function SetupFinalAnim() |
|
291 |
finalAnim = { |
|
292 |
{func = AnimGearWait, args = {cyborg, 1000}}, |
|
7530 | 293 |
{func = AnimSay, args = {cyborg, loc("Nicely done, meatbags!"), SAY_SAY, 3000}}, |
7460 | 294 |
{func = AnimSay, args = {cyborg, loc("You have won the game by proving true cooperative skills!"), SAY_SAY, 7000}}, |
295 |
{func = AnimSay, args = {cyborg, loc("You have proven yourselves worthy!"), SAY_SAY, 4000}}, |
|
296 |
{func = AnimSay, args = {players[1], loc("Game? Was this a game to you?!"), SAY_SAY, 4000}}, |
|
297 |
{func = AnimSay, args = {cyborg, loc("Well, yes. This was a cyborg television show."), SAY_SAY, 5500}}, |
|
298 |
{func = AnimSay, args = {cyborg, loc("It is called 'Hogs of Steel'."), SAY_SAY, 4000}}, |
|
299 |
{func = AnimSay, args = {players[1], loc("Are you saying that many of us have died for your entertainment?"), SAY_SAY, 8000}}, |
|
300 |
{func = AnimSay, args = {players[1], loc("Our tribe, our beautiful island!"), SAY_SAY, 4000}}, |
|
301 |
{func = AnimSay, args = {players[1], loc("All gone...everything!"), SAY_SAY, 3000}}, |
|
302 |
{func = AnimSay, args = {cyborg, loc("But the ones alive are stronger in their heart!"), SAY_SAY, 6000}}, |
|
303 |
{func = AnimSay, args = {cyborg, loc("Just kidding, none of you have died!"), SAY_SAY, 5000}}, |
|
304 |
{func = AnimSay, args = {cyborg, loc("I mean, none of you ceased to live."), SAY_SAY, 5000}}, |
|
305 |
{func = AnimSay, args = {cyborg, loc("You'll see what I mean!"), SAY_SAY, 4000}}, |
|
306 |
{func = AnimSay, args = {cyborg, loc("They are all waiting back in the village, haha."), SAY_SAY, 7000}}, |
|
307 |
{func = AnimSay, args = {players[1], loc("You are playing with our lives here!"), SAY_SAY, 6000}}, |
|
308 |
{func = AnimSay, args = {players[1], loc("Do you think you're some kind of god?"), SAY_SAY, 6000}}, |
|
309 |
{func = AnimSay, args = {cyborg, loc("Interesting idea, haha!"), SAY_SAY, 2000}}, |
|
310 |
{func = AnimSwitchHog, args = {players[1]}}, |
|
311 |
{func = AnimWait, args = {players[1], 1}}, |
|
312 |
{func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}}, |
|
313 |
{func = HideHedge, swh = false, args = {cyborg}}, |
|
314 |
{func = AnimSay, args = {players[1], loc("What a douche!"), SAY_SAY, 2000}}, |
|
315 |
} |
|
316 |
end |
|
317 |
--------------------------Anim skip functions-------------------------- |
|
318 |
function SkipStartAnim() |
|
319 |
RestoreNatives() |
|
320 |
RestoreCyborgs() |
|
321 |
SetGearMessage(CurrentHedgehog, 0) |
|
322 |
AnimSwitchHog(cyborgs[1]) |
|
323 |
AnimWait(cyborg, 1) |
|
324 |
AddFunction({func = HideHedge, args = {cyborg}}) |
|
325 |
end |
|
326 |
||
327 |
function AfterStartAnim() |
|
328 |
ShowMission(loc("The Enemy Of My Enemy"), loc("The Union"), loc("Defeat the cyborgs!"), 1, 0) |
|
329 |
PutWeaponCrates() |
|
330 |
PutHealthCrates() |
|
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
331 |
EndTurn(true) |
7460 | 332 |
end |
333 |
||
334 |
function PutHealthCrates() |
|
335 |
for i = 1, 10 do |
|
336 |
SpawnHealthCrate(0, 0) |
|
337 |
end |
|
338 |
end |
|
339 |
||
340 |
function PutWeaponCrates() |
|
12933
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
341 |
SpawnSupplyCrate(2399, 622, amNapalm, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
342 |
SpawnSupplyCrate(2199, -18, amBee, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
343 |
SpawnSupplyCrate(2088, 430, amBee, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
344 |
SpawnSupplyCrate(237, 20, amMortar, 4) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
345 |
SpawnSupplyCrate(312, 1107, amMolotov, 3) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
346 |
SpawnSupplyCrate(531, 1123, amWatermelon, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
347 |
SpawnSupplyCrate(1253, 1444, amFlamethrower, 5) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
348 |
SpawnSupplyCrate(994, 1364, amBaseballBat, 3) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
349 |
SpawnSupplyCrate(1104, 1553, amMine, 6) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
350 |
SpawnSupplyCrate(2277, 803, amDynamite, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
351 |
SpawnSupplyCrate(1106, 184, amRCPlane, 3) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
352 |
SpawnSupplyCrate(1333, 28, amSMine, 4) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
353 |
SpawnSupplyCrate(90, 279, amAirAttack, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
354 |
SpawnSupplyCrate(288, 269, amBee, 2) |
e65aa3c3d4e6
Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents:
12794
diff
changeset
|
355 |
SpawnSupplyCrate(818, 1633, amBaseballBat, 2) |
7460 | 356 |
end |
357 |
-----------------------------Events------------------------------------ |
|
358 |
function CheckNativesDead() |
|
359 |
return nativesLeft == 0 |
|
360 |
end |
|
361 |
||
362 |
function CheckCannibalsDead() |
|
363 |
return cannibalsLeft == 0 |
|
364 |
end |
|
365 |
||
366 |
function CheckPlayersDead() |
|
367 |
return playersLeft == 0 |
|
368 |
end |
|
369 |
||
370 |
function CheckCyborgsDead() |
|
371 |
return (cyborgsLeft == 0 and (leader == nil or gearDead[leader] == true)) |
|
372 |
end |
|
373 |
||
374 |
function DoNativesDead() |
|
375 |
nativesDeadFresh = true |
|
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
376 |
EndTurn(true) |
7460 | 377 |
end |
378 |
||
379 |
function DoCannibalsDead() |
|
380 |
cannibalsDeadFresh = true |
|
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
381 |
EndTurn(true) |
7460 | 382 |
end |
383 |
||
384 |
function DoPlayersDead() |
|
385 |
RemoveEventFunc(CheckNativesDead) |
|
386 |
RemoveEventFunc(CheckCannibalsDead) |
|
387 |
RemoveEventFunc(CheckCyborgsDead) |
|
388 |
playersDeadFresh = true |
|
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
389 |
EndTurn(true) |
7460 | 390 |
end |
391 |
||
392 |
function DoCyborgsDead() |
|
393 |
-- RemoveEventFunc(CheckNativesDead) |
|
394 |
-- RemoveEventFunc(CheckCannibalsDead) |
|
395 |
cyborgsDeadFresh= true |
|
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
396 |
EndTurn(true) |
7460 | 397 |
end |
398 |
||
399 |
function CheckGearsDead(gearList) |
|
400 |
for i = 1, # gearList do |
|
401 |
if gearDead[gearList[i]] ~= true then |
|
402 |
return false |
|
403 |
end |
|
404 |
end |
|
405 |
return true |
|
406 |
end |
|
407 |
||
408 |
function CheckGearDead(gear) |
|
409 |
return gearDead[gear] |
|
410 |
end |
|
411 |
||
412 |
function FailedMission() |
|
413 |
RestoreHedge(cyborg) |
|
414 |
AnimOutOfNowhere(cyborg, unpack(cyborgPos[1])) |
|
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
415 |
ClearMinesAroundCyborg() |
7460 | 416 |
if CheckCyborgsDead() then |
417 |
AnimSay(cyborg, loc("Hmmm...it's a draw. How unfortunate!"), SAY_THINK, 6000) |
|
418 |
elseif leader ~= nil then |
|
419 |
CondNeedToTurn2(cyborg, leader) |
|
420 |
AddAnim({{func = AnimSay, args = {leader, loc("Yay, we won!"), SAY_SAY, 2000}}, |
|
421 |
{func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}}) |
|
422 |
else |
|
423 |
CondNeedToTurn2(cyborg, cyborgs[1]) |
|
424 |
AddAnim({{func = AnimSay, args = {cyborgs[1], loc("Yay, we won!"), SAY_SAY, 2000}}, |
|
425 |
{func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}}) |
|
426 |
end |
|
427 |
AddFunction({func = LoseMission, args = {}}) |
|
428 |
end |
|
429 |
||
430 |
function LoseMission() |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
431 |
DismissTeam(nativesTeamName) |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
432 |
DismissTeam(cannibalsTeamName) |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
433 |
DismissTeam(cyborgTeamName) |
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
434 |
EndTurn(true) |
7460 | 435 |
end |
436 |
||
437 |
function WonMission() |
|
438 |
RestoreHedge(cyborg) |
|
439 |
CondNeedToTurn2(cyborg, players[1]) |
|
440 |
SetupFinalAnim() |
|
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
441 |
ClearMinesAroundCyborg() |
7460 | 442 |
AddAnim(finalAnim) |
443 |
AddFunction({func = WinMission, args = {}}) |
|
444 |
end |
|
445 |
||
446 |
function WinMission() |
|
8944
ed2509832311
fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents:
8043
diff
changeset
|
447 |
if progress and progress<9 then |
ed2509832311
fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents:
8043
diff
changeset
|
448 |
SaveCampaignVar("Progress", "9") |
ed2509832311
fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents:
8043
diff
changeset
|
449 |
end |
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
450 |
DismissTeam(cyborgTeamName) |
12364
5857936921ec
Get rid of some incorrect timeout messages in ACF, by using EndTurn(true)
Wuzzy <almikes@aol.com>
parents:
12263
diff
changeset
|
451 |
EndTurn(true) |
7460 | 452 |
end |
453 |
-----------------------------Misc-------------------------------------- |
|
454 |
function HideHedge(hedge) |
|
455 |
if hedgeHidden[hedge] ~= true then |
|
456 |
HideHog(hedge) |
|
457 |
hedgeHidden[hedge] = true |
|
458 |
end |
|
459 |
end |
|
460 |
||
461 |
function RestoreHedge(hedge) |
|
462 |
if hedgeHidden[hedge] == true then |
|
463 |
RestoreHog(hedge) |
|
464 |
hedgeHidden[hedge] = false |
|
465 |
end |
|
466 |
end |
|
467 |
||
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
468 |
function ClearMinesAroundCyborg() |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
469 |
if GetHealth(cyborg) then |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
470 |
local vaporized = 0 |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
471 |
for mine, _ in pairs(trackedMines) do |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
472 |
if GetHealth(mine) and GetHealth(cyborg) and gearIsInBox(mine, GetX(cyborg) - 50, GetY(cyborg) - 50, 100, 100) == true then |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
473 |
AddVisualGear(GetX(mine), GetY(mine), vgtSmoke, 0, false) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
474 |
DeleteGear(mine) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
475 |
vaporized = vaporized + 1 |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
476 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
477 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
478 |
if vaporized > 0 then |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
479 |
PlaySound(sndVaporize) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
480 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
481 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
482 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
483 |
|
7460 | 484 |
function GetVariables() |
8944
ed2509832311
fix bug that locked unlocked campaign missions, see issue 452
Periklis Ntanasis <pntanasis@gmail.com>
parents:
8043
diff
changeset
|
485 |
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:
13144
diff
changeset
|
486 |
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:
13144
diff
changeset
|
487 |
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:
13144
diff
changeset
|
488 |
m5Choice = tonumber(GetCampaignVar("M5Choice")) or choiceEliminate |
14682
0bba06a05d52
ACF: Dump unused campaign vars, use fallback values
Wuzzy <Wuzzy2@mail.ru>
parents:
14508
diff
changeset
|
489 |
m5LeaksDead = tonumber(GetCampaignVar("M5LeaksDead")) or 0 |
13145
5083fb0a2992
A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents:
13144
diff
changeset
|
490 |
m8DeployedLeader = tonumber(GetCampaignVar("M8DeployedLeader")) or 0 |
5083fb0a2992
A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents:
13144
diff
changeset
|
491 |
m8PrincessLeader = tonumber(GetCampaignVar("M8PrincessLeader")) or 1 |
14682
0bba06a05d52
ACF: Dump unused campaign vars, use fallback values
Wuzzy <Wuzzy2@mail.ru>
parents:
14508
diff
changeset
|
492 |
m8EnemyFled = tonumber(GetCampaignVar("M8EnemyFled")) or 0 |
13145
5083fb0a2992
A Classic Fairytale: Harden all missions against missing campaign variables in team file and assume default values
Wuzzy <Wuzzy2@mail.ru>
parents:
13144
diff
changeset
|
493 |
m8Scene = tonumber(GetCampaignVar("M8Scene")) or princessScene |
7460 | 494 |
end |
495 |
||
496 |
function SetupPlace() |
|
497 |
for i = 1, playersNum do |
|
498 |
HideHedge(players[i]) |
|
499 |
end |
|
500 |
for i = 1, cyborgsNum do |
|
501 |
HideHedge(cyborgs[i]) |
|
502 |
end |
|
503 |
if leader ~= nil then |
|
504 |
HideHedge(leader) |
|
505 |
end |
|
506 |
end |
|
507 |
||
508 |
function SetupEvents() |
|
509 |
AddNewEvent(CheckPlayersDead, {}, DoPlayersDead, {}, 0) |
|
510 |
AddNewEvent(CheckNativesDead, {}, DoNativesDead, {}, 0) |
|
511 |
AddNewEvent(CheckCannibalsDead, {}, DoCannibalsDead, {}, 0) |
|
512 |
AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0) |
|
513 |
end |
|
514 |
||
515 |
function SetupAmmo() |
|
516 |
AddAmmo(cyborgs[1], amClusterBomb, 100) |
|
517 |
AddAmmo(cyborgs[1], amMortar, 100) |
|
518 |
AddAmmo(cyborgs[1], amDynamite, 2) |
|
519 |
AddAmmo(cyborgs[1], amAirAttack, 2) |
|
520 |
AddAmmo(cyborgs[1], amTeleport, 100) |
|
521 |
||
522 |
if leader ~= nil then |
|
523 |
AddAmmo(leader, amClusterBomb, 100) |
|
524 |
AddAmmo(leader, amMortar, 100) |
|
525 |
AddAmmo(leader, amDynamite, 100) |
|
526 |
AddAmmo(leader, amAirAttack, 3) |
|
527 |
AddAmmo(leader, amTeleport, 100) |
|
528 |
end |
|
529 |
end |
|
530 |
||
531 |
function AddHogs() |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
532 |
cyborgTeamName = AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary") |
7460 | 533 |
cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1") |
534 |
||
14507
f8c2b995c009
Use player team name in ACF campaign
Wuzzy <Wuzzy2@mail.ru>
parents:
14506
diff
changeset
|
535 |
nativesTeamName = AddMissionTeam(-2) |
13144
9a0b1288315e
ACF9: Fix cannibal talking to himself in cut scene if playing with 3 natives instead of 4
Wuzzy <Wuzzy2@mail.ru>
parents:
13139
diff
changeset
|
536 |
-- There are 3-4 natives in this mission |
7460 | 537 |
natives[1] = AddHog(nativeNames[leaksNum], 0, 100, nativeHats[leaksNum]) |
538 |
if m5DeployedNum ~= leaksNum and m8DeployedLeader == 0 then |
|
539 |
natives[2] = AddHog(nativeNames[m5DeployedNum], 0, 100, nativeHats[m5DeployedNum]) |
|
540 |
end |
|
541 |
table.insert(natives, AddHog(nativeNames[ramonNum], 0, 100, nativeHats[ramonNum])) |
|
542 |
table.insert(natives, AddHog(nativeNames[spikyNum], 0, 100, nativeHats[spikyNum])) |
|
543 |
if m8PrincessLeader == 0 then |
|
544 |
table.insert(natives, AddHog(loc("Fell From Heaven"), 0, 100, "tiara")) |
|
545 |
end |
|
546 |
nativesNum = #natives |
|
547 |
nativesLeft = nativesNum |
|
548 |
cannibalsLeft = cannibalsNum |
|
549 |
for i = 1, nativesNum do |
|
550 |
table.insert(players, natives[i]) |
|
551 |
end |
|
552 |
||
14508
d72fb761aa59
ACF: Consistent cannibals flag/voice, change Princess flag
Wuzzy <Wuzzy2@mail.ru>
parents:
14507
diff
changeset
|
553 |
cannibalsTeamName = AddTeam(loc("Cannibals"), -2, "skull", "Island", "Pirate", "cm_vampire") |
7460 | 554 |
for i = 1, cannibalsNum do |
555 |
cannibals[i] = AddHog(cannibalNames[i], 0, 100, "Zombi") |
|
556 |
table.insert(players, cannibals[i]) |
|
557 |
end |
|
558 |
playersNum = #players |
|
559 |
playersLeft = playersNum |
|
560 |
||
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
561 |
hedgecogsTeamName = AddTeam(loc("Hedge-cogs"), -9, "ring", "UFO", "Robot", "cm_cyborg") |
7460 | 562 |
for i = 1, cyborgsNum do |
563 |
cyborgs[i] = AddHog(cyborgNames[i], 2, 80, "cyborg2") |
|
564 |
end |
|
565 |
||
566 |
if m8EnemyFled == 1 then |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
567 |
leaderTeamName = AddTeam(loc("Leader"), -9, "ring", "UFO", "Robot", "cm_cyborg") |
7460 | 568 |
if m8Scene == denseScene then |
569 |
leader = AddHog(loc("Dense Cloud"), 2, 200, nativeHats[denseNum]) |
|
570 |
elseif m8Scene == waterScene then |
|
571 |
leader = AddHog(loc("Fiery Water"), 2, 200, nativeHats[waterNum]) |
|
572 |
elseif m8Scene == princessScene then |
|
573 |
leader = AddHog(loc("Fell From Heaven"), 2, 200, "tiara") |
|
574 |
else |
|
575 |
leader = AddHog(loc("Nancy Screw"), 2, 200, "cyborg2") |
|
576 |
end |
|
577 |
end |
|
578 |
||
579 |
cyborgsLeft = cyborgsNum |
|
580 |
||
581 |
for i = 1, nativesNum do |
|
582 |
AnimSetGearPosition(natives[i], unpack(nativePos[i])) |
|
583 |
AnimTurn(natives[i], nativeDir[i]) |
|
584 |
end |
|
585 |
for i = 1, cannibalsNum do |
|
586 |
AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i])) |
|
587 |
AnimTurn(cannibals[i], cannibalDir[i]) |
|
588 |
end |
|
589 |
for i = 1, cyborgsNum do |
|
590 |
AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i])) |
|
591 |
AnimTurn(cyborgs[i], cyborgsDir[i]) |
|
592 |
end |
|
593 |
AnimSetGearPosition(cyborg, unpack(cyborgPos[1])) |
|
594 |
AnimTurn(cyborg, cyborgDir) |
|
595 |
if leader ~= nil then |
|
596 |
AnimSetGearPosition(leader, unpack(leaderPos)) |
|
597 |
AnimTurn(leader, leaderDir[i]) |
|
598 |
end |
|
599 |
end |
|
600 |
||
601 |
-----------------------------Main Functions---------------------------- |
|
602 |
||
603 |
function onGameInit() |
|
604 |
Seed = 0 |
|
605 |
GameFlags = gfSolidLand |
|
606 |
TurnTime = 60000 |
|
607 |
CaseFreq = 0 |
|
608 |
MinesNum = 0 |
|
609 |
MinesTime = 3000 |
|
610 |
Explosives = 0 |
|
611 |
Map = "Islands" |
|
612 |
Theme = "EarthRise" |
|
613 |
SuddenDeathTurns = 20 |
|
614 |
||
615 |
GetVariables() |
|
616 |
AnimInit() |
|
617 |
AddHogs() |
|
618 |
end |
|
619 |
||
620 |
function onGameStart() |
|
621 |
SetupAmmo() |
|
622 |
SetupPlace() |
|
623 |
AnimationSetup() |
|
624 |
SetupEvents() |
|
625 |
AddAnim(startAnim) |
|
626 |
AddFunction({func = AfterStartAnim, args = {}}) |
|
627 |
end |
|
628 |
||
629 |
function onGameTick() |
|
630 |
AnimUnWait() |
|
631 |
if ShowAnimation() == false then |
|
632 |
return |
|
633 |
end |
|
634 |
ExecuteAfterAnimations() |
|
635 |
CheckEvents() |
|
636 |
end |
|
637 |
||
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
638 |
function onGearAdd(gear) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
639 |
local gt = GetGearType(gear) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
640 |
if gt == gtMine or gt == gtSMine or gt == gtAirMine then |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
641 |
trackedMines[gear] = true |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
642 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
643 |
end |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
644 |
|
7460 | 645 |
function onGearDelete(gear) |
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
646 |
local gt = GetGearType(gear) |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
647 |
if gt == gtMine or gt == gtSMine or gt == gtAirMine then |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
648 |
trackedMines[gear] = nil |
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
649 |
end |
7460 | 650 |
gearDead[gear] = true |
14897
543729d313f5
ACF5, ACF9: Clear mines around cyborg when it appears
Wuzzy <Wuzzy2@mail.ru>
parents:
14682
diff
changeset
|
651 |
if gt == gtHedgehog then |
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
652 |
if GetHogTeamName(gear) == nativesTeamName then |
7460 | 653 |
for i = 1, nativesLeft do |
654 |
if natives[i] == gear then |
|
655 |
table.remove(natives, i) |
|
656 |
table.remove(players, i) |
|
657 |
nativesLeft = nativesLeft - 1 |
|
658 |
playersLeft = playersLeft - 1 |
|
659 |
end |
|
660 |
end |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
661 |
elseif GetHogTeamName(gear) == cannibalsTeamName then |
7460 | 662 |
for i = 1, cannibalsLeft do |
663 |
if cannibals[i] == gear then |
|
664 |
table.remove(cannibals, i) |
|
665 |
table.remove(players, nativesLeft + i) |
|
666 |
cannibalsLeft = cannibalsLeft - 1 |
|
667 |
playersLeft = playersLeft - 1 |
|
668 |
end |
|
669 |
end |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
670 |
elseif GetHogTeamName(gear) == hedgecogsTeamName then |
7460 | 671 |
for i = 1, cyborgsLeft do |
672 |
if cyborgs[i] == gear then |
|
673 |
table.remove(cyborgs, i) |
|
674 |
end |
|
675 |
end |
|
676 |
cyborgsLeft = cyborgsLeft - 1 |
|
677 |
end |
|
678 |
end |
|
679 |
end |
|
680 |
||
681 |
function onAmmoStoreInit() |
|
682 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
683 |
SetAmmo(amSwitch, 9, 0, 0, 0) |
|
684 |
SetAmmo(amDEagle, 9, 0, 0, 0) |
|
685 |
SetAmmo(amSniperRifle, 9, 0, 0, 0) |
|
686 |
SetAmmo(amBazooka, 8, 0, 0, 0) |
|
687 |
SetAmmo(amGrenade, 7, 0, 0, 0) |
|
688 |
SetAmmo(amFirePunch, 9, 0, 0, 0) |
|
689 |
SetAmmo(amShotgun, 9, 0, 0, 0) |
|
690 |
||
691 |
SetAmmo(amParachute, 9, 0, 0, 0) |
|
692 |
SetAmmo(amRope, 9, 0, 0, 0) |
|
693 |
SetAmmo(amPickHammer, 9, 0, 0, 0) |
|
694 |
SetAmmo(amBlowTorch, 9, 0, 0, 0) |
|
695 |
end |
|
696 |
||
697 |
function onNewTurn() |
|
698 |
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
|
699 |
SetTurnTimeLeft(MAX_TURN_TIME) |
7460 | 700 |
return |
701 |
end |
|
702 |
if playersDeadFresh then |
|
703 |
playersDeadFresh = false |
|
704 |
FailedMission() |
|
705 |
elseif cyborgsDeadFresh then |
|
706 |
cyborgsDeadFresh = false |
|
707 |
WonMission() |
|
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
708 |
elseif nativesDeadFresh and GetHogTeamName(CurrentHedgehog) == cannibalsTeamName then |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
709 |
AnimSay(CurrentHedgehog, string.format(loc("Your deaths will be avenged, %s!"), nativesTeamName), SAY_SHOUT, 0) |
7460 | 710 |
nativesDeadFresh = false |
14506
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
711 |
elseif cannibalsDeadFresh and GetHogTeamName(CurrentHedgehog) == nativesTeamName then |
f37910a73c19
Refactor ACF missions, store team names in variables
Wuzzy <Wuzzy2@mail.ru>
parents:
14422
diff
changeset
|
712 |
AnimSay(CurrentHedgehog, string.format(loc("Your deaths will be avenged, %s!"), cannibalsTeamName), SAY_SHOUT, 0) |
7460 | 713 |
cannibalsDeadFresh = false |
714 |
end |
|
715 |
end |
|
716 |
||
717 |
function onPrecise() |
|
718 |
if GameTime > 3000 and AnimInProgress() then |
|
719 |
SetAnimSkip(true) |
|
720 |
end |
|
721 |
end |