share/hedgewars/Data/Missions/Training/Basic_Training_-_Movement.lua
changeset 14403 f9d4b8222903
parent 13820 461db56397b4
child 14405 bedbd983653b
equal deleted inserted replaced
14402:32e8c81ca35c 14403:f9d4b8222903
   239 	crates[5] = SpawnHealthCrate(1486, 1694)		-- Walking on Ice
   239 	crates[5] = SpawnHealthCrate(1486, 1694)		-- Walking on Ice
   240 	crates[6] = SpawnHealthCrate(2033, 1470)		-- Walking on Ice completed
   240 	crates[6] = SpawnHealthCrate(2033, 1470)		-- Walking on Ice completed
   241 	crates[7] = SpawnHealthCrate(1198, 1750)		-- Back Jumping 2
   241 	crates[7] = SpawnHealthCrate(1198, 1750)		-- Back Jumping 2
   242 	crates[8] = SpawnSupplyCrate(1851, 1402, amSwitch, 100)	-- Switch Hedgehog
   242 	crates[8] = SpawnSupplyCrate(1851, 1402, amSwitch, 100)	-- Switch Hedgehog
   243 	crates[9] = SpawnHealthCrate(564, 1772)			-- Health
   243 	crates[9] = SpawnHealthCrate(564, 1772)			-- Health
   244 	crates[10] = SpawnHealthCrate(2290, 1622)		-- Turning Around
   244 	-- FIXME: Not available in touch because no “precise” button
       
   245 	if INTERFACE ~= "touch" then
       
   246 		crates[10] = SpawnHealthCrate(2290, 1622)		-- Turning Around
       
   247 	end
   245 end
   248 end
   246 
   249 
   247 local function victory()
   250 local function victory()
   248 	ShowMission(loc("Basic Movement Training"), loc("Training complete!"),loc("Congratulations! You have completed the obstacle course!"), 0, 0)
   251 	ShowMission(loc("Basic Movement Training"), loc("Training complete!"),loc("Congratulations! You have completed the obstacle course!"), 0, 0)
   249 	SendStat(siGameResult, loc("You have completed the Basic Movement Training!"))
   252 	SendStat(siGameResult, loc("You have completed the Basic Movement Training!"))
   263 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (3/3)"),
   266 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (3/3)"),
   264 		loc("This is Cappy.").."|"..
   267 		loc("This is Cappy.").."|"..
   265 		loc("To finish hedgehog selection, just do anything|with him, like walking."),
   268 		loc("To finish hedgehog selection, just do anything|with him, like walking."),
   266 		2, 20000)
   269 		2, 20000)
   267 	else
   270 	else
       
   271 		local ctrl = ""
       
   272 		if INTERFACE == "desktop" then
       
   273 			ctrl = loc("Hit the “Switch Hedgehog” key until you have|selected Cappy, the hedgehog with the cap!").."|"..
       
   274 			loc("Switch hedgehog: [Tabulator]")
       
   275 		else
       
   276 			ctrl = loc("Tap the “rotating arrow” button on the left|until you have selected Cappy, the hedgehog with the cap!")
       
   277 		end
   268 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (2/3)"),
   278 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (2/3)"),
   269 		loc("You have activated Switch Hedgehog!").."|"..
   279 		loc("You have activated Switch Hedgehog!").."|"..
   270 		loc("The spinning arrows above your hedgehog show|which hedgehog is selected right now.").."|"..
   280 		loc("The spinning arrows above your hedgehog show|which hedgehog is selected right now.").."|"..
   271 		loc("Hit the “Switch Hedgehog” key until you have|selected Cappy, the hedgehog with the cap!").."|"..
   281 		ctrl, 2, 20000)
   272 		loc("Switch hedgehog: [Tabulator]"), 2, 20000)
       
   273 	end
   282 	end
   274 end
   283 end
   275 
   284 
   276 function onGearAdd(gear)
   285 function onGearAdd(gear)
   277 	if GetGearType(gear) == gtSwitcher then
   286 	if GetGearType(gear) == gtSwitcher then
   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