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