12 local missionName = loc("Getting to the device") |
12 local missionName = loc("Getting to the device") |
13 local inBattle = false |
13 local inBattle = false |
14 local tookPartInBattle = false |
14 local tookPartInBattle = false |
15 local previousHog = -1 |
15 local previousHog = -1 |
16 local permitCaptainLimeDeath = false |
16 local permitCaptainLimeDeath = false |
|
17 local fixedWind = false |
17 -- dialogs |
18 -- dialogs |
18 local dialog01 = {} |
19 local dialog01 = {} |
19 local dialog02 = {} |
20 local dialog02 = {} |
20 local dialog03 = {} |
21 local dialog03 = {} |
21 local dialog04 = {} |
22 local dialog04 = {} |
177 -- I wanted to use FindPlace but doesn't accept height values... |
178 -- I wanted to use FindPlace but doesn't accept height values... |
178 local x1 = 950 |
179 local x1 = 950 |
179 local x2 = 1306 |
180 local x2 = 1306 |
180 local y1 = 1210 |
181 local y1 = 1210 |
181 local y2 = 1620 |
182 local y2 = 1620 |
182 while true do |
183 |
183 if y2<y1 then |
184 -- barrel mania in the large hole |
184 break |
185 local barrels = { |
185 end |
186 {1290, 1618}, |
186 if x2<x1 then |
187 {1285, 1587}, |
187 x2 = 1305 |
188 {1287, 1556}, |
188 y2 = y2 - 50 |
189 {1286, 1525}, |
189 end |
190 {1247, 1637}, |
190 if not TestRectForObstacle(x2+25, y2+25, x2-25, y2-25, true) then |
191 {1250, 1606}, |
191 AddGear(x2, y2, gtExplosives, 0, 0, 0, 0) |
192 {1249, 1575}, |
192 end |
193 {1251, 1544}, |
193 x2 = x2 - 25 |
194 {1206, 1646}, |
194 end |
195 {1211, 1615}, |
|
196 {1209, 1584}, |
|
197 {1166, 1646}, |
|
198 {1168, 1615}, |
|
199 {1170, 1584}, |
|
200 {1125, 1637}, |
|
201 {1120, 1606}, |
|
202 {1128, 1575}, |
|
203 {1089, 1622}, |
|
204 {1084, 1591}, |
|
205 {1093, 1560}, |
|
206 {1044, 1596}, |
|
207 {1044, 1565}, |
|
208 {1005, 1554}, |
|
209 {1005, 1523}, |
|
210 {973, 1492}, |
|
211 {1062, 1534}, |
|
212 {1128, 1544}, |
|
213 {1168, 1553}, |
|
214 {1210, 1553}, |
|
215 {1097, 1529}, |
|
216 {1040, 1505}, |
|
217 } |
|
218 for b=1, #barrels do |
|
219 local barrel = AddGear(barrels[b][1], barrels[b][2], gtExplosives, 0, 0, 0, 0) |
|
220 SetHealth(barrel, 21) |
|
221 end |
|
222 |
|
223 -- single barrel at the right corner |
195 AddGear(3128, 1680, gtExplosives, 0, 0, 0, 0) |
224 AddGear(3128, 1680, gtExplosives, 0, 0, 0, 0) |
196 |
225 |
197 --mines |
226 --mines |
198 AddGear(3135, 1680, gtMine, 0, 0, 0, 0) |
227 AddGear(3135, 1680, gtMine, 0, 0, 0, 0) |
199 AddGear(3145, 1680, gtMine, 0, 0, 0, 0) |
228 AddGear(3145, 1680, gtMine, 0, 0, 0, 0) |
271 if not permitCaptainLimeDeath and not GetHealth(green1.gear) then |
300 if not permitCaptainLimeDeath and not GetHealth(green1.gear) then |
272 -- game ends with the according stat messages |
301 -- game ends with the according stat messages |
273 heroDeath() |
302 heroDeath() |
274 permitCaptainLimeDeath = true |
303 permitCaptainLimeDeath = true |
275 end |
304 end |
276 if CurrentHedgehog and GetY(CurrentHedgehog) > 1350 then |
305 if (not fixedWind) and CurrentHedgehog and GetY(CurrentHedgehog) > 1350 then |
277 SetWind(-40) |
306 fixedWind = true |
|
307 wind() |
278 end |
308 end |
279 end |
309 end |
280 |
310 |
281 function onGearAdd(gear) |
311 function onGearAdd(gear) |
282 -- Delete sticky flames to reduce the waiting time after blowing up the barrels |
312 -- Turn sticky flames to normal flames, to reduce the waiting time after blowing up the barrels |
283 if GetGearType(gear) == gtFlame and band(GetState(gear), gsttmpFlag) ~= 0 then |
313 if GetGearType(gear) == gtFlame and band(GetState(gear), gsttmpFlag) ~= 0 then |
284 DeleteGear(gear) |
314 SetState(gear, band(GetState(gear), bnot(gsttmpFlag))) |
285 end |
315 end |
286 end |
316 end |
287 |
317 |
288 function onGearDelete(gear) |
318 function onGearDelete(gear) |
289 if gear == hero.gear then |
319 if gear == hero.gear then |