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