author | Wuzzy <almikes@aol.com> |
Tue, 11 Apr 2017 02:44:59 +0200 | |
changeset 12224 | d62d6f8ebef1 |
parent 12077 | ce3860c82c8b |
child 12225 | 93079fecbc77 |
permissions | -rw-r--r-- |
11015 | 1 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
2 |
||
3 |
local player = nil |
|
4 |
local RCGear = nil |
|
5 |
local planesUsed = 0 |
|
6 |
local planeTimer = 0 |
|
7 |
local planeUhOh = false |
|
8 |
local cratesLeft = 0 |
|
9 |
local crateStreak = 0 |
|
10 |
local longestCrateStreak = 0 |
|
11 |
local commentTimer = 0 |
|
12 |
local missiles = 0 |
|
13 |
local totalMissiles = 0 |
|
14 |
local missileScanTimer = 0 |
|
15 |
local nextComment = sndNone |
|
16 |
||
17 |
function onGameInit() |
|
18 |
||
19 |
Seed = 1 |
|
20 |
GameFlags = gfInfAttack + gfInvulnerable + gfOneClanMode + gfSolidLand |
|
21 |
||
22 |
TurnTime = 90 * 1000 |
|
23 |
||
24 |
Map = "Ropes" |
|
25 |
Theme = "Eyes" |
|
26 |
||
12224
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
27 |
-- Disable Sudden Death |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
28 |
WaterRise = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
29 |
HealthDecrease = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
12077
diff
changeset
|
30 |
|
11015 | 31 |
CaseFreq = 0 |
32 |
MinesNum = 0 |
|
33 |
Explosives = 0 |
|
34 |
||
12049
030464f34d47
Tweak flags used in all missions to fit more to the theme
Wuzzy <almikes@aol.com>
parents:
11968
diff
changeset
|
35 |
AddTeam(loc("Wannabe Flyboys"), 14483456, "Simple", "Island", "Default", "cm_scout") |
11015 | 36 |
player = AddHog(loc("Ace"), 0, 80, "Gasmask") |
37 |
SetGearPosition(player, 1380, 1500) |
|
38 |
||
39 |
end |
|
40 |
||
41 |
||
42 |
||
43 |
function onGameStart() |
|
44 |
||
45 |
SendHealthStatsOff() |
|
46 |
||
47 |
ShowMission ( |
|
12077
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
12049
diff
changeset
|
48 |
loc("RC Plane Challenge"), |
ce3860c82c8b
Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents:
12049
diff
changeset
|
49 |
loc("Challenge"), |
11015 | 50 |
|
51 |
loc("Collect or destroy all the health crates.") .. "|" .. |
|
52 |
loc("Compete to use as few planes as possible!") .. "|" .. |
|
53 |
"", -amRCPlane, 4000 |
|
54 |
) |
|
55 |
||
56 |
PlaceGirder(2192, 508, 6) |
|
57 |
PlaceGirder(2192, 670, 6) |
|
58 |
PlaceGirder(2193, 792, 2) |
|
59 |
PlaceGirder(2100, 825, 4) |
|
60 |
PlaceGirder(2009, 899, 6) |
|
61 |
PlaceGirder(2084, 992, 4) |
|
62 |
PlaceGirder(2145, 1087, 6) |
|
63 |
PlaceGirder(2199, 1235, 5) |
|
64 |
PlaceGirder(2308, 1296, 0) |
|
65 |
PlaceGirder(2424, 1234, 7) |
|
66 |
PlaceGirder(2473, 1129, 2) |
|
67 |
PlaceGirder(2437, 1046, 1) |
|
68 |
PlaceGirder(2409, 927, 6) |
|
69 |
PlaceGirder(2408, 763, 6) |
|
70 |
PlaceGirder(2404, 540, 6) |
|
71 |
PlaceGirder(2426, 423, 3) |
|
72 |
PlaceGirder(2550, 400, 4) |
|
73 |
PlaceGirder(2668, 425, 1) |
|
74 |
PlaceGirder(2707, 541, 6) |
|
75 |
PlaceGirder(2706, 703, 6) |
|
76 |
PlaceGirder(2705, 867, 6) |
|
77 |
PlaceGirder(2779, 962, 4) |
|
78 |
PlaceGirder(2894, 924, 3) |
|
79 |
PlaceGirder(2908, 802, 6) |
|
80 |
PlaceGirder(2907, 639, 6) |
|
81 |
PlaceGirder(3052, 566, 4) |
|
82 |
PlaceGirder(2971, 394, 4) |
|
83 |
PlaceGirder(3103, 448, 7) |
|
84 |
PlaceGirder(3047, 654, 0) |
|
85 |
PlaceGirder(3043, 746, 6) |
|
86 |
PlaceGirder(3265, 1583, 6) |
|
87 |
PlaceGirder(3256, 1491, 4) |
|
88 |
PlaceGirder(3187, 1401, 6) |
|
89 |
PlaceGirder(3326, 1400, 6) |
|
90 |
PlaceGirder(774, 530, 5) |
|
91 |
PlaceGirder(922, 595, 4) |
|
92 |
PlaceGirder(1079, 533, 7) |
|
93 |
PlaceGirder(1139, 386, 6) |
|
94 |
PlaceGirder(1074, 237, 5) |
|
95 |
PlaceGirder(723, 381, 6) |
|
96 |
PlaceGirder(781, 229, 7) |
|
97 |
PlaceGirder(927, 746, 6) |
|
98 |
PlaceGirder(874, 736, 0) |
|
99 |
PlaceGirder(982, 737, 0) |
|
100 |
PlaceGirder(2430, 1730, 4) |
|
101 |
||
102 |
PlaceGirder(1613, 1104, 7) |
|
103 |
PlaceGirder(1564, 1256, 6) |
|
104 |
PlaceGirder(1643, 1341, 5) |
|
105 |
PlaceGirder(1780, 1372, 4) |
|
106 |
PlaceGirder(1869, 1296, 7) |
|
107 |
PlaceGirder(1858, 1163, 5) |
|
108 |
PlaceGirder(1739, 1044, 5) |
|
109 |
PlaceGirder(1621, 926, 5) |
|
110 |
PlaceGirder(1597, 985, 5) |
|
111 |
PlaceGirder(1449, 939, 4) |
|
112 |
PlaceGirder(1473, 874, 4) |
|
113 |
PlaceGirder(2092, 1352, 7) |
|
114 |
PlaceGirder(2145, 1444, 7) |
|
115 |
PlaceGirder(2004, 1443, 3) |
|
116 |
PlaceGirder(1978, 1523, 2) |
|
117 |
PlaceGirder(2021, 1596, 1) |
|
118 |
PlaceGirder(2103, 1625, 0) |
|
119 |
PlaceGirder(2208, 1551, 7) |
|
120 |
PlaceGirder(2327, 1431, 7) |
|
121 |
PlaceGirder(2395, 1478, 6) |
|
122 |
PlaceGirder(2396, 1600, 2) |
|
123 |
PlaceGirder(2495, 1285, 6) |
|
124 |
PlaceGirder(2494, 1408, 2) |
|
125 |
PlaceGirder(2547, 530, 0) |
|
126 |
||
127 |
PlaceGirder(2451, 1551, 0) |
|
128 |
PlaceGirder(2551, 706, 6) |
|
129 |
PlaceGirder(2551, 869, 6) |
|
130 |
PlaceGirder(2623, 1016, 5) |
|
131 |
PlaceGirder(2773, 1083, 4) |
|
132 |
PlaceGirder(2924, 1019, 7) |
|
133 |
PlaceGirder(2568, 1491, 7) |
|
134 |
PlaceGirder(2618, 1346, 6) |
|
135 |
PlaceGirder(2674, 1195, 7) |
|
136 |
PlaceGirder(2822, 1142, 4) |
|
137 |
PlaceGirder(2963, 1069, 7) |
|
138 |
PlaceGirder(3067, 938, 5) |
|
139 |
PlaceGirder(2803, 1373, 2) |
|
140 |
PlaceGirder(2811, 1559, 2) |
|
141 |
||
142 |
tempG = SpawnHealthCrate(930, 557) |
|
143 |
SetHealth(tempG, 25) |
|
144 |
tempG = SpawnHealthCrate(979, 692) |
|
145 |
SetHealth(tempG, 25) |
|
146 |
tempG = SpawnHealthCrate(876, 703) |
|
147 |
SetHealth(tempG, 25) |
|
148 |
tempG = SpawnHealthCrate(2309, 1260) |
|
149 |
SetHealth(tempG, 25) |
|
150 |
tempG = SpawnHealthCrate(1733, 1127) |
|
151 |
SetHealth(tempG, 25) |
|
152 |
tempG = SpawnHealthCrate(1738, 1320) |
|
153 |
SetHealth(tempG, 25) |
|
154 |
tempG = SpawnHealthCrate(3249, 1460) |
|
155 |
SetHealth(tempG, 25) |
|
156 |
tempG = SpawnHealthCrate(3051, 617) |
|
157 |
SetHealth(tempG, 25) |
|
158 |
tempG = SpawnHealthCrate(2972, 353) |
|
159 |
SetHealth(tempG, 25) |
|
160 |
tempG = SpawnHealthCrate(2548, 358) |
|
161 |
||
162 |
SetHealth(tempG, 25) |
|
163 |
tempG = SpawnHealthCrate(2090, 1580) |
|
164 |
SetHealth(tempG, 25) |
|
165 |
tempG = SpawnHealthCrate(1752, 1753) |
|
166 |
SetHealth(tempG, 25) |
|
167 |
tempG = SpawnHealthCrate(1865, 1758) |
|
168 |
SetHealth(tempG, 25) |
|
169 |
tempG = SpawnHealthCrate(1985, 1760) |
|
170 |
SetHealth(tempG, 25) |
|
171 |
tempG = SpawnHealthCrate(2429, 1760) |
|
172 |
SetHealth(tempG, 25) |
|
173 |
tempG = SpawnHealthCrate(2810, 1480) |
|
174 |
SetHealth(tempG, 25) |
|
175 |
tempG = SpawnHealthCrate(2800, 1277) |
|
176 |
SetHealth(tempG, 25) |
|
177 |
tempG = SpawnHealthCrate(2806, 1107) |
|
178 |
SetHealth(tempG, 25) |
|
179 |
||
180 |
PlaceGirder(1897, 903, 6) |
|
181 |
PlaceGirder(1916, 784, 3) |
|
182 |
PlaceGirder(2010, 732, 4) |
|
183 |
PlaceGirder(2082, 639, 6) |
|
184 |
PlaceGirder(2081, 516, 2) |
|
185 |
PlaceGirder(1985, 487, 4) |
|
186 |
PlaceGirder(1862, 407, 5) |
|
187 |
PlaceGirder(1855, 224, 7) |
|
188 |
PlaceGirder(2006, 163, 4) |
|
189 |
PlaceGirder(2128, 187, 1) |
|
190 |
PlaceGirder(2251, 213, 4) |
|
191 |
PlaceGirder(2413, 213, 4) |
|
192 |
PlaceGirder(1952, 618, 0) |
|
193 |
PlaceGirder(957, 1068, 4) |
|
194 |
PlaceGirder(794, 1069, 4) |
|
195 |
PlaceGirder(728, 1163, 6) |
|
196 |
PlaceGirder(728, 1287, 2) |
|
197 |
PlaceGirder(802, 1342, 4) |
|
198 |
PlaceGirder(966, 1342, 4) |
|
199 |
PlaceGirder(674, 1032, 1) |
|
200 |
PlaceGirder(554, 1011, 4) |
|
201 |
PlaceGirder(445, 1056, 3) |
|
202 |
PlaceGirder(422, 1174, 6) |
|
203 |
PlaceGirder(369, 1341, 5) |
|
204 |
PlaceGirder(495, 1313, 5) |
|
205 |
PlaceGirder(568, 1379, 3) |
|
206 |
PlaceGirder(577, 1202, 2) |
|
207 |
PlaceGirder(744, 1490, 5) |
|
208 |
PlaceGirder(760, 1617, 7) |
|
209 |
PlaceGirder(622, 1693, 4) |
|
210 |
PlaceGirder(476, 1623, 5) |
|
211 |
PlaceGirder(376, 1697, 1) |
|
212 |
PlaceGirder(955, 1746, 2) |
|
213 |
PlaceGirder(1025, 1746, 2) |
|
214 |
PlaceGirder(1090, 1745, 2) |
|
215 |
PlaceGirder(1156, 1746, 2) |
|
216 |
PlaceGirder(3806, 1530, 2) |
|
217 |
PlaceGirder(3880, 1464, 2) |
|
218 |
PlaceGirder(3738, 1458, 2) |
|
219 |
PlaceGirder(3806, 1390, 2) |
|
220 |
PlaceGirder(3805, 1588, 0) |
|
221 |
PlaceGirder(3676, 1609, 3) |
|
222 |
PlaceGirder(3930, 1615, 1) |
|
223 |
PlaceGirder(3719, 1295, 0) |
|
224 |
PlaceGirder(3888, 1294, 0) |
|
225 |
PlaceGirder(3661, 1385, 2) |
|
226 |
PlaceGirder(3955, 1377, 2) |
|
227 |
PlaceGirder(3982, 1518, 0) |
|
228 |
PlaceGirder(3378, 440, 2) |
|
229 |
PlaceGirder(3447, 492, 4) |
|
230 |
PlaceGirder(3564, 529, 1) |
|
231 |
PlaceGirder(3596, 647, 6) |
|
232 |
PlaceGirder(3521, 740, 4) |
|
233 |
PlaceGirder(3524, 838, 4) |
|
234 |
PlaceGirder(3644, 819, 3) |
|
235 |
PlaceGirder(3691, 708, 6) |
|
236 |
PlaceGirder(3690, 545, 6) |
|
237 |
PlaceGirder(3612, 433, 5) |
|
238 |
PlaceGirder(3463, 383, 4) |
|
239 |
PlaceGirder(2815, 122, 7) |
|
240 |
PlaceGirder(2960, 72, 4) |
|
241 |
PlaceGirder(3032, 123, 2) |
|
242 |
PlaceGirder(3063, 174, 0) |
|
243 |
PlaceGirder(3095, 124, 2) |
|
244 |
PlaceGirder(3169, 71, 4) |
|
245 |
PlaceGirder(3320, 124, 5) |
|
246 |
PlaceGirder(3210, 179, 2) |
|
247 |
PlaceGirder(2932, 181, 2) |
|
248 |
||
249 |
tempG = SpawnHealthCrate(3804, 1461) |
|
250 |
SetHealth(tempG, 25) |
|
251 |
tempG = SpawnHealthCrate(3269, 1742) |
|
252 |
SetHealth(tempG, 25) |
|
253 |
tempG = SpawnHealthCrate(3066, 121) |
|
254 |
SetHealth(tempG, 25) |
|
255 |
tempG = SpawnHealthCrate(3207, 104) |
|
256 |
SetHealth(tempG, 25) |
|
257 |
tempG = SpawnHealthCrate(2928, 103) |
|
258 |
SetHealth(tempG, 25) |
|
259 |
tempG = SpawnHealthCrate(1997, 202) |
|
260 |
SetHealth(tempG, 25) |
|
261 |
tempG = SpawnHealthCrate(2253, 159) |
|
262 |
SetHealth(tempG, 25) |
|
263 |
tempG = SpawnHealthCrate(2132, 774) |
|
264 |
SetHealth(tempG, 25) |
|
265 |
tempG = SpawnHealthCrate(2549, 490) |
|
266 |
SetHealth(tempG, 25) |
|
267 |
tempG = SpawnHealthCrate(3527, 694) |
|
268 |
SetHealth(tempG, 25) |
|
269 |
tempG = SpawnHealthCrate(3777, 78) |
|
270 |
SetHealth(tempG, 25) |
|
271 |
tempG = SpawnHealthCrate(1124, 1746) |
|
272 |
SetHealth(tempG, 25) |
|
273 |
tempG = SpawnHealthCrate(1056, 1740) |
|
274 |
SetHealth(tempG, 25) |
|
275 |
tempG = SpawnHealthCrate(993, 1742) |
|
276 |
SetHealth(tempG, 25) |
|
277 |
tempG = SpawnHealthCrate(799, 1298) |
|
278 |
SetHealth(tempG, 25) |
|
279 |
tempG = SpawnHealthCrate(577, 1126) |
|
280 |
SetHealth(tempG, 25) |
|
281 |
tempG = SpawnHealthCrate(596, 1463) |
|
282 |
SetHealth(tempG, 25) |
|
283 |
tempG = SpawnHealthCrate(3854, 1043) |
|
284 |
SetHealth(tempG, 25) |
|
285 |
tempG = SpawnHealthCrate(1944, 567) |
|
286 |
SetHealth(tempG, 25) |
|
287 |
tempG = SpawnHealthCrate(338, 1748) |
|
288 |
SetHealth(tempG, 25) |
|
289 |
||
290 |
||
291 |
end |
|
292 |
||
293 |
--function onGameTick() |
|
294 |
||
295 |
--if RCGear ~= nil then |
|
296 |
-- AddCaption(GetTimer(RCGear)) |
|
297 |
--end |
|
298 |
||
299 |
--end |
|
300 |
||
301 |
function onGameTick20() |
|
302 |
if RCGear ~= nil then |
|
303 |
if(GetTimer(RCGear) < 3000 and planeUhOh == false) then |
|
304 |
PlaySound(sndUhOh, player) |
|
305 |
planeUhOh = true |
|
306 |
end |
|
307 |
planeTimer = planeTimer + 20 |
|
308 |
end |
|
309 |
if commentTimer > 0 then |
|
310 |
commentTimer = commentTimer - 20 |
|
311 |
elseif(nextComment ~= sndNone) then |
|
312 |
PlaySound(nextComment, player) |
|
313 |
nextComment = sndNone |
|
314 |
end |
|
315 |
if missileScanTimer > 0 then |
|
316 |
missileScanTimer = missileScanTimer - 20 |
|
317 |
else |
|
318 |
if crateStreak == 0 and missiles == 3 then |
|
319 |
PlaySound(sndMissed, player) |
|
320 |
missiles = 4 |
|
321 |
end |
|
322 |
end |
|
323 |
end |
|
324 |
||
325 |
function onNewTurn() |
|
326 |
TurnTimeLeft = -1 |
|
327 |
end |
|
328 |
||
329 |
function onGearAdd(gear) |
|
330 |
||
331 |
if GetGearType(gear) == gtRCPlane then |
|
332 |
RCGear = gear |
|
333 |
planesUsed = planesUsed + 1 |
|
334 |
planeTimer = 0 |
|
335 |
missiles = 0 |
|
336 |
end |
|
337 |
||
338 |
if GetGearType(gear) == gtCase then |
|
339 |
cratesLeft = cratesLeft + 1 |
|
340 |
end |
|
341 |
||
342 |
if GetGearType(gear) == gtAirBomb then |
|
343 |
totalMissiles = totalMissiles + 1 |
|
344 |
end |
|
345 |
end |
|
346 |
||
347 |
function onGearDelete(gear) |
|
348 |
||
349 |
if GetGearType(gear) == gtRCPlane then |
|
350 |
||
351 |
RCGear = nil |
|
352 |
planeUhOh = false |
|
353 |
missiles = 0 |
|
354 |
AddCaption(string.format(loc("Planes used: %d"), planesUsed)) |
|
355 |
||
356 |
if(planeTimer < 2000 and crateStreak == 0) then |
|
357 |
nextComment = sndStupid |
|
358 |
commentTimer = math.min(2000-planeTimer, 800) |
|
359 |
elseif(planeTimer < 5000 and crateStreak == 0) then |
|
360 |
PlaySound(sndOops, player) |
|
361 |
elseif(planesUsed == 72) then |
|
362 |
PlaySound(sndStupid, player) |
|
363 |
elseif(planesUsed == 50) then |
|
364 |
PlaySound(sndNutter, player) |
|
365 |
elseif(planesUsed == 30) then |
|
366 |
PlaySound(sndOops, player) |
|
367 |
end |
|
368 |
||
369 |
crateStreak = 0 |
|
370 |
||
371 |
elseif GetGearType(gear) == gtAirBomb then |
|
372 |
missiles = missiles + 1 |
|
373 |
missileScanTimer = 500 |
|
374 |
||
375 |
elseif GetGearType(gear) == gtCase then |
|
376 |
||
377 |
cratesLeft = cratesLeft - 1 |
|
378 |
crateStreak = crateStreak + 1 |
|
379 |
if(crateStreak > longestCrateStreak) then |
|
380 |
longestCrateStreak = crateStreak |
|
381 |
end |
|
382 |
||
383 |
AddCaption(string.format(loc("Crates left: %d"), cratesLeft)) |
|
384 |
||
385 |
if cratesLeft == 0 then |
|
386 |
||
387 |
local rank = "unknown" |
|
388 |
local color = 0xFFFFFFFF |
|
389 |
local sound = sndVictory |
|
390 |
if planesUsed >= 156 then |
|
391 |
rank = loc("Destroyer of planes") |
|
392 |
color = 0xD06700FF |
|
393 |
sound = sndLaugh |
|
394 |
elseif planesUsed >= 98 then |
|
395 |
rank = loc("Hopeless case") |
|
396 |
color = 0xFF0000FF |
|
397 |
elseif planesUsed >= 72 then |
|
398 |
rank = loc("Drunk greenhorn") |
|
399 |
color = 0xFF0040FF |
|
400 |
elseif planesUsed >= 50 then |
|
401 |
rank = loc("Greenhorn") -- a.k.a. "absolute beginner" |
|
402 |
color = 0xFF0080FF |
|
403 |
elseif planesUsed >= 39 then |
|
404 |
rank = loc("Beginner") |
|
405 |
color = 0xFF00BFFF |
|
406 |
elseif planesUsed >= 30 then |
|
407 |
rank = loc("Experienced beginner") |
|
408 |
color = 0xFF00CCFF |
|
409 |
elseif planesUsed >= 21 then |
|
410 |
rank = loc("Below-average pilot") |
|
411 |
color = 0xFF00FFFF |
|
412 |
elseif planesUsed >= 17 then |
|
413 |
rank = loc("Average pilot") |
|
414 |
color = 0xBF00FFFF |
|
415 |
elseif planesUsed >= 13 then |
|
416 |
rank = loc("Above-average pilot") |
|
417 |
color = 0x8000FFFF |
|
418 |
elseif planesUsed >= 8 then |
|
419 |
rank = loc("Professional pilot") |
|
420 |
color = 0x4000FFFF |
|
421 |
elseif planesUsed >= 5 then |
|
422 |
rank = loc("Professional stunt pilot") |
|
423 |
color = 0x0000FFFF |
|
424 |
elseif planesUsed >= 3 then |
|
425 |
rank = loc("Elite pilot") |
|
426 |
color = 0x0040FFFF |
|
427 |
elseif planesUsed == 2 then |
|
428 |
rank = loc("Upper-class elite pilot") |
|
429 |
color = 0x0080FFFF |
|
430 |
elseif planesUsed == 1 then |
|
431 |
rank = loc("Top-class elite pilot") |
|
432 |
color = 0x00FFFFFF |
|
433 |
sound = sndFlawless |
|
434 |
else |
|
435 |
rank = loc("Cheater") |
|
436 |
color = 0xFF0000FF |
|
437 |
sound = sndCoward |
|
438 |
end |
|
439 |
AddCaption(string.format(loc("Rank: %s"), rank), color, capgrpMessage2) |
|
440 |
SendStat(siCustomAchievement, string.format(loc("Your rank: %s"), rank)) |
|
441 |
if planesUsed == 1 then |
|
442 |
AddCaption(loc("Flawless victory!")) |
|
443 |
SendStat(siGameResult, loc("You have perfectly beaten the challenge!")) |
|
444 |
SendStat(siCustomAchievement, loc("You have used only 1 RC plane. Outstanding!")) |
|
445 |
else |
|
446 |
AddCaption(loc("Victory!")) |
|
447 |
SendStat(siGameResult, loc("You have finished the challenge!")) |
|
448 |
SendStat(siCustomAchievement, string.format(loc("You have used %d RC planes."), planesUsed)) |
|
449 |
end |
|
450 |
||
451 |
if(totalMissiles > 1) then |
|
452 |
SendStat(siCustomAchievement, string.format(loc("You have dropped %d missiles."), totalMissiles)) |
|
453 |
end |
|
454 |
||
455 |
if(longestCrateStreak > 5) then |
|
456 |
if(planesUsed == 1) then |
|
457 |
SendStat(siCustomAchievement, string.format(loc("In your best (and only) flight you took out %d crates with one RC plane!"), longestCrateStreak)) |
|
458 |
else |
|
459 |
SendStat(siCustomAchievement, string.format(loc("In your best flight you took out %d crates with one RC plane."), longestCrateStreak)) |
|
460 |
end |
|
461 |
end |
|
462 |
||
463 |
if(planesUsed == 2) then |
|
464 |
SendStat(siCustomAchievement, loc("This was an awesome performance! But this challenge can be finished with even just one RC plane. Can you figure out how?")) |
|
465 |
end |
|
466 |
if(planesUsed == 1) then |
|
467 |
SendStat(siCustomAchievement, loc("Congratulations! You have truly mastered this challenge! Don't forget to save the demo.")) |
|
468 |
SendStat(siCustomAchievement, string.format(loc("You have gained an achievement: %s"), loc("Prestigious Pilot"))) |
|
469 |
end |
|
470 |
||
471 |
ShowMission ( |
|
472 |
loc("CHALLENGE COMPLETE"), |
|
473 |
loc("Congratulations!"), |
|
474 |
string.format(loc("Planes used: %d"), planesUsed) .. "|" .. |
|
475 |
"", 0, 0 |
|
476 |
) |
|
477 |
SetState(player, gstWinner) |
|
478 |
PlaySound(sound, player) |
|
479 |
||
480 |
||
481 |
DismissTeam(loc("Wannabe Flyboys")) |
|
482 |
EndGame() |
|
483 |
end |
|
484 |
||
485 |
if RCGear ~= nil then |
|
486 |
SetTimer(RCGear, GetTimer(RCGear) + 10000) |
|
487 |
end |
|
488 |
end |
|
489 |
||
490 |
end |
|
491 |
||
492 |
function onAmmoStoreInit() |
|
493 |
SetAmmo(amRCPlane, 9, 0, 0, 0) |
|
11689 | 494 |
end |
495 |
||
496 |
function onNewTurn() |
|
497 |
SetWeapon(amRCPlane) |
|
498 |
end |