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