279 switchHedgehogText() |
288 switchHedgehogText() |
280 end |
289 end |
281 end |
290 end |
282 |
291 |
283 function onGearDelete(gear) |
292 function onGearDelete(gear) |
|
293 local ctrl = "" |
284 -- Switching done |
294 -- Switching done |
285 if GetGearType(gear) == gtSwitcher then |
295 if GetGearType(gear) == gtSwitcher then |
286 switcherGear = nil |
296 switcherGear = nil |
287 if CurrentHedgehog == hog_cappy then |
297 if CurrentHedgehog == hog_cappy then |
288 ShowMission(loc("Basic Movement Training"), loc("Leap of Faith"), |
298 ShowMission(loc("Basic Movement Training"), loc("Leap of Faith"), |
289 loc("Good! You now control Cappy.").."|".. |
299 loc("Good! You now control Cappy.").."|".. |
290 loc("Collect the remaining crates to complete the training."), |
300 loc("Collect the remaining crates to complete the training."), |
291 2, 0) |
301 2, 0) |
292 else |
302 else |
|
303 if INTERFACE == "desktop" then |
|
304 ctrl = loc("Open ammo menu: [Right click]").."|".. |
|
305 loc("Attack: [Space]") |
|
306 elseif INTERFACE == "touch" then |
|
307 ctrl = loc("Open ammo menu: Tap the [suitcase]").."|".. |
|
308 loc("Attack: Tap the [bomb]") |
|
309 end |
293 ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (Failed!)"), |
310 ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (Failed!)"), |
294 loc("Oops! You have selected the wrong hedgehog! Just try again.").."|".. |
311 loc("Oops! You have selected the wrong hedgehog! Just try again.").."|".. |
295 loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key to proceed.").."|".. |
312 loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key to proceed.").."|".. |
296 loc("Open ammo menu: [Right click]").."|".. |
313 ctrl, 2, 0) |
297 loc("Attack: [Space]"), 2, 0) |
|
298 end |
314 end |
299 |
315 |
300 -- Crate collected (or destroyed, but this should not be possible) |
316 -- Crate collected (or destroyed, but this should not be possible) |
301 elseif gear == crates[1] then |
317 elseif gear == crates[1] then |
|
318 if INTERFACE == "desktop" then |
|
319 ctrl = loc("Long Jump: [Enter]") |
|
320 elseif INTERFACE == "touch" then |
|
321 ctrl = loc("Long Jump: Tap the [curvy arrow] for long") |
|
322 end |
302 ShowMission(loc("Basic Movement Training"), loc("Jumping"), |
323 ShowMission(loc("Basic Movement Training"), loc("Jumping"), |
303 loc("Get the next crate by jumping over the abyss.").."|".. |
324 loc("Get the next crate by jumping over the abyss.").."|".. |
304 loc("Careful, hedgehogs can't swim!").."|".. |
325 loc("Careful, hedgehogs can't swim!").."|".. |
305 loc("Long Jump: [Enter]"), 2, 5000) |
326 ctrl, 2, 5000) |
306 elseif gear == crates[2] then |
327 elseif gear == crates[2] then |
307 victory() |
328 victory() |
308 elseif gear == crates[4] then |
329 elseif gear == crates[4] then |
|
330 if INTERFACE == "desktop" then |
|
331 ctrl = loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2") |
|
332 elseif INTERFACE == "touch" then |
|
333 ctrl = loc("High Jump: Tap the [curvy arrow] shortly").."|"..loc("Back Jump: Double-tap the [curvy arrow]") |
|
334 end |
309 ShowMission(loc("Basic Movement Training"), loc("Back Jumping (1/2)"), |
335 ShowMission(loc("Basic Movement Training"), loc("Back Jumping (1/2)"), |
310 loc("For the next crate, you have to do back jumps.") .. "|" .. |
336 loc("For the next crate, you have to do back jumps.") .. "|" .. |
311 loc("To reach higher ground, walk to a ledge, look to the left, then do a back jump.") .. "|" .. |
337 loc("To reach higher ground, walk to a ledge, look to the left, then do a back jump.") .. "|" .. |
312 loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2"), 2, 6600) |
338 ctrl, 2, 6600) |
313 elseif gear == crates[7] then |
339 elseif gear == crates[7] then |
|
340 if INTERFACE == "desktop" then |
|
341 ctrl = loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2") |
|
342 elseif INTERFACE == "touch" then |
|
343 ctrl = loc("High Jump: Tap the [curvy arrow] short").."|"..loc("Back Jump: Double-tap the [curvy arrow]") |
|
344 end |
314 ShowMission(loc("Basic Movement Training"), loc("Back Jumping (2/2)"), |
345 ShowMission(loc("Basic Movement Training"), loc("Back Jumping (2/2)"), |
315 loc("To get over the next obstacles, keep some distance from the wall before you back jump.").."|".. |
346 loc("To get over the next obstacles, keep some distance from the wall before you back jump.").."|".. |
316 loc("Hint: To jump higher, wait a bit before you hit “High Jump” a second time.").."|".. |
347 loc("Hint: To jump higher, wait a bit before you hit “High Jump” a second time.").."|".. |
317 loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2"), 2, 15000) |
348 ctrl, 2, 15000) |
318 elseif gear == crates[5] then |
349 elseif gear == crates[5] then |
|
350 -- FIXME: Touch doesn't have precise aim yet :( |
|
351 if INTERFACE == "desktop" then |
|
352 ctrl = "|" .. |
|
353 loc("You can also hold down the key for “Precise Aim” to prevent slipping.") .. "|" .. |
|
354 loc("Precise Aim: [Left Shift]") |
|
355 end |
319 ShowMission(loc("Basic Movement Training"), loc("Walking on Ice"), |
356 ShowMission(loc("Basic Movement Training"), loc("Walking on Ice"), |
320 loc("These girders are slippery, like ice.").."|".. |
357 loc("These girders are slippery, like ice.").."|".. |
321 loc("And you need to move to the top!").."|".. |
358 loc("And you need to move to the top!").."|".. |
322 loc("If you don't want to slip away, you have to keep moving!").."|".. |
359 loc("If you don't want to slip away, you have to keep moving!").. |
323 loc("You can also hold down the key for “Precise Aim” to prevent slipping.").."|".. |
360 ctrl, 2, 9000) |
324 loc("Precise Aim: [Left Shift]"), 2, 9000) |
|
325 elseif gear == crates[6] then |
361 elseif gear == crates[6] then |
|
362 -- FIXME: Touch doesn't have precise aim yet :( |
|
363 if INTERFACE == "desktop" then |
|
364 ctrl = "|" .. loc("Remember: Hold down [Left Shift] to prevent slipping") |
|
365 end |
326 ShowMission(loc("Basic Movement Training"), loc("A mysterious Box"), |
366 ShowMission(loc("Basic Movement Training"), loc("A mysterious Box"), |
327 loc("The next crate is an utility crate.").."|"..loc("What's in the box, you ask? Let's find out!").."|".. |
367 loc("The next crate is an utility crate.").."|"..loc("What's in the box, you ask? Let's find out!").. |
328 loc("Remember: Hold down [Left Shift] to prevent slipping"), 2, 6000) |
368 ctrl, 2, 6000) |
329 elseif gear == crates[8] then |
369 elseif gear == crates[8] then |
|
370 if INTERFACE == "desktop" then |
|
371 ctrl = loc("Open ammo menu: [Right click]").."|".. |
|
372 loc("Attack: [Space]") |
|
373 elseif INTERFACE == "touch" then |
|
374 ctrl = loc("Open ammo menu: Tap the [suitcase]").."|".. |
|
375 loc("Attack: Tap the [bomb]") |
|
376 end |
330 ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (1/3)"), |
377 ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (1/3)"), |
331 loc("You have collected the “Switch Hedgehog” utility!").."|".. |
378 loc("You have collected the “Switch Hedgehog” utility!").."|".. |
332 loc("This allows to select any hedgehog in your team!").."|".. |
379 loc("This allows to select any hedgehog in your team!").."|".. |
333 loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key.").."|".. |
380 loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key.").."|".. |
334 loc("Open ammo menu: [Right click]").."|".. |
381 ctrl, 2, 30000) |
335 loc("Attack: [Space]"), 2, 30000) |
|
336 elseif gear == crates[3] then |
382 elseif gear == crates[3] then |
337 ShowMission(loc("Basic Movement Training"), loc("Rubber"), loc("As you probably noticed, these rubber bands|are VERY elastic. Hedgehogs and many other|things will bounce off without taking any damage.").."|".. |
383 ShowMission(loc("Basic Movement Training"), loc("Rubber"), loc("As you probably noticed, these rubber bands|are VERY elastic. Hedgehogs and many other|things will bounce off without taking any damage.").."|".. |
338 loc("Now try to get out of this bounce house|and take the next crate."), 2, 8000) |
384 loc("Now try to get out of this bounce house|and take the next crate."), 2, 8000) |
339 elseif gear == crates[9] then |
385 elseif gear == crates[9] then |
|
386 if INTERFACE == "desktop" then |
|
387 ctrl = loc("Look around: [Mouse movement]") |
|
388 elseif INTERFACE == "touch" then |
|
389 ctrl = loc("Look around: [Tap or swipe on the screen]") |
|
390 end |
340 ShowMission(loc("Basic Movement Training"), loc("Health"), loc("You just got yourself some extra health.|The more health your hedgehogs have, the better!").."|".. |
391 ShowMission(loc("Basic Movement Training"), loc("Health"), loc("You just got yourself some extra health.|The more health your hedgehogs have, the better!").."|".. |
341 loc("Now go to the next crate.").."|".. |
392 loc("Now go to the next crate.").."|".. |
342 loc("Look around: [Mouse movement]"), 2, 10000) |
393 ctrl, 2, 10000) |
343 elseif gear == crates[10] then |
394 elseif gear == crates[10] then |
|
395 -- FIXME: This crate is unused in touch atm |
344 ShowMission(loc("Basic Movement Training"), loc("Turning Around"), |
396 ShowMission(loc("Basic Movement Training"), loc("Turning Around"), |
345 loc("By the way, you can turn around without walking|by holding down Precise when you hit a walk control.").."|".. |
397 loc("By the way, you can turn around without walking|by holding down Precise when you hit a walk control.").."|".. |
346 loc("Get the final crate to the right to complete the training.").."|".. |
398 loc("Get the final crate to the right to complete the training.").."|".. |
347 loc("Turn around: [Left Shift] + [Left]/[Right]") |
399 loc("Turn around: [Left Shift] + [Left]/[Right]") |
348 , 2, 8000) |
400 , 2, 8000) |
367 |
419 |
368 local function firstMission() |
420 local function firstMission() |
369 -- This part is CRITICALLY important for all future missions. |
421 -- This part is CRITICALLY important for all future missions. |
370 -- Because the player must know how to show the current mission texts again. |
422 -- Because the player must know how to show the current mission texts again. |
371 -- We force the player to hit Attack before the actual training begins. |
423 -- We force the player to hit Attack before the actual training begins. |
|
424 local ctrl = "" |
|
425 if INTERFACE == "desktop" then |
|
426 ctrl = loc("IMPORTANT: To see the mission panel again, hold the mission panel key.").."| |".. |
|
427 loc("Note: This basic training assumes default controls.").."|".. |
|
428 loc("Mission panel: [M]").."|".. |
|
429 loc("Quit: [Esc]").."|".. |
|
430 loc("Pause: [P]").."| |".. |
|
431 loc("To begin with the training, hit the attack key!").."|".. |
|
432 loc("Attack: [Space]") |
|
433 elseif INTERFACE == "touch" then |
|
434 ctrl = loc("IMPORTANT: To see the mission panel again, pause the game.").."| |".. |
|
435 loc("Pause: Tap the [pause symbol]").."| |".. |
|
436 loc("To begin with the training, tap the attack button!").."|".. |
|
437 loc("Attack: Tap the [bomb]") |
|
438 end |
372 ShowMission(loc("Basic Movement Training"), loc("Mission Panel"), |
439 ShowMission(loc("Basic Movement Training"), loc("Mission Panel"), |
373 loc("This is the mission panel.").."|".. |
440 loc("This is the mission panel.").."|".. |
374 loc("Here you will find the current mission instructions.").."|".. |
441 loc("Here you will find the current mission instructions.").."|".. |
375 loc("Normally, the mission panel disappears after a few seconds.").."|".. |
442 loc("Normally, the mission panel disappears after a few seconds.").."|".. |
376 loc("IMPORTANT: To see the mission panel again, hold the mission panel key.").."| |".. |
443 ctrl, 2, 900000, true) |
377 loc("Note: This basic training assumes default controls.").."|".. |
|
378 loc("Mission panel: [M]").."|".. |
|
379 loc("Quit: [Esc]").."|".. |
|
380 loc("Pause: [P]").."| |".. |
|
381 loc("To begin with the training, hit the attack key!").."|".. |
|
382 loc("Attack: [Space]"), 2, 900000, true) |
|
383 |
444 |
384 -- TODO: This and other training missions are currently hardcoding control names. |
445 -- TODO: This and other training missions are currently hardcoding control names. |
385 -- This should be fixed eventually. |
446 -- This should be fixed eventually. |
386 end |
447 end |
387 |
448 |