share/hedgewars/Data/Missions/Training/Basic_Training_-_Movement.lua
changeset 13070 53cbf7aea5f0
child 13072 1ff4671066d2
equal deleted inserted replaced
13069:ba7ac61c7668 13070:53cbf7aea5f0
       
     1 -- Basic Movement Training
       
     2 -- Teaches the basic movement controls.
       
     3 
       
     4 --[[ Lessons:
       
     5 * Walking
       
     6 * Collecting crates
       
     7 * Health basics
       
     8 * How to show the mission panel again
       
     9 * Jumping
       
    10 * Fall damage
       
    11 * Walking and staying on ice
       
    12 * Switching hedgehogs
       
    13 * Bouncing on rubber
       
    14 ]]
       
    15 
       
    16 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
    17 HedgewarsScriptLoad("/Scripts/Tracker.lua")
       
    18 
       
    19 local hhs = {}
       
    20 local hog_greenhorn, hog_cappy
       
    21 local crates = {}
       
    22 local switcherGear
       
    23 local tookDamage = false
       
    24 local switchTicks = -1
       
    25 local walkingText = false
       
    26 
       
    27 local map = {
       
    28 "\1\74\7\29\135\1\74\8\11\0\1\83\7\135\135",
       
    29 "\1\250\7\135\0\1\204\7\137\135\1\238\7\135\0",
       
    30 "\2\17\7\130\0\2\42\7\110\0\2\74\7\94\0",
       
    31 "\2\106\7\89\0\2\99\7\121\0\2\76\7\128\0",
       
    32 "\2\115\7\98\135\2\147\7\98\0\2\179\7\94\0",
       
    33 "\2\147\7\96\0\2\174\7\89\0\2\145\7\91\135",
       
    34 "\2\115\7\87\0\2\122\7\89\135\2\154\7\89\0",
       
    35 "\2\170\7\89\0\2\179\7\105\135\2\179\7\107\135",
       
    36 "\2\177\7\142\135\2\177\8\105\0\3\74\7\94\135",
       
    37 "\3\74\8\50\0\3\88\7\89\135\3\129\7\89\0",
       
    38 "\3\161\7\91\0\3\193\7\98\0\3\225\7\100\0",
       
    39 "\4\1\7\91\0\4\33\7\89\0\4\65\7\98\0",
       
    40 "\4\97\7\100\0\4\134\7\103\0\4\166\7\100\0",
       
    41 "\4\200\7\98\0\4\232\7\96\0\5\8\7\96\0",
       
    42 "\5\40\7\98\0\5\72\7\98\0\5\107\7\100\0",
       
    43 "\5\139\7\98\0\5\173\7\89\0\5\207\7\94\0",
       
    44 "\5\239\7\100\0\6\15\7\100\0\6\47\7\100\0",
       
    45 "\6\86\7\100\0\6\118\7\100\0\6\153\7\94\0",
       
    46 "\6\185\7\91\0\6\219\7\91\0\6\251\7\98\0",
       
    47 "\7\27\7\103\0\7\61\7\100\0\7\94\7\96\0",
       
    48 "\7\126\7\91\0\7\160\7\94\0\7\192\7\105\0",
       
    49 "\7\224\7\116\0\7\254\7\126\0\8\34\7\123\0",
       
    50 "\8\66\7\119\0\8\98\7\114\0\8\133\7\119\0",
       
    51 "\8\165\7\132\0\8\195\7\142\0\8\229\7\146\0",
       
    52 "\9\5\7\151\0\9\37\7\155\0\9\69\7\164\0",
       
    53 "\9\101\7\174\0\9\131\7\190\0\9\160\7\208\0",
       
    54 "\9\186\7\226\0\9\215\7\240\0\9\250\7\238\0",
       
    55 "\10\26\7\233\0\10\58\7\233\0\10\90\7\235\0",
       
    56 "\10\122\7\238\0\10\154\7\238\0\10\186\7\249\0",
       
    57 "\10\213\8\14\0\10\245\8\9\0\11\3\8\39\0",
       
    58 "\11\24\8\66\0\11\10\8\62\0\10\213\8\5\135",
       
    59 "\10\245\8\7\0\11\21\8\14\0\11\56\8\25\0",
       
    60 "\11\92\8\37\0\11\106\8\43\0\9\85\8\0\147",
       
    61 "\9\83\8\0\0\8\208\7\233\147\3\168\7\197\147",
       
    62 "\8\94\7\197\0\2\83\7\210\147\1\179\7\238\0",
       
    63 "\1\44\7\84\139\1\12\7\87\0\0\238\7\98\0",
       
    64 "\0\211\7\119\0\0\190\7\144\0\0\165\7\164\0",
       
    65 "\0\146\7\190\0\0\140\7\222\0\0\142\7\254\0",
       
    66 "\0\153\8\30\0\0\156\8\37\0\1\7\7\178\139",
       
    67 "\0\247\7\210\0\0\224\7\238\0\0\215\8\14\0",
       
    68 "\0\215\8\18\0\1\5\7\238\139\1\19\8\11\0",
       
    69 "\1\32\8\43\0\1\39\8\62\0\1\67\7\32\136",
       
    70 "\1\69\6\253\0\1\69\6\219\0\1\69\6\187\0",
       
    71 "\1\74\6\155\0\1\80\6\123\0\1\51\6\109\0",
       
    72 "\1\35\6\80\0\1\12\6\105\0\0\243\6\132\0",
       
    73 "\0\233\6\176\0\0\252\6\212\0\1\14\6\240\0",
       
    74 "\0\252\7\13\0\0\233\6\219\0\0\238\6\182\0",
       
    75 "\0\238\6\148\0\1\12\6\164\0\1\9\6\201\0",
       
    76 "\0\236\6\224\0\0\206\6\251\0\0\165\7\32\0",
       
    77 "\0\144\7\57\0\0\124\7\82\0\0\103\7\107\0",
       
    78 "\0\96\7\144\0\0\92\7\176\0\0\112\7\139\0",
       
    79 "\0\121\7\105\0\0\130\7\61\0\0\142\7\25\0",
       
    80 "\0\156\6\251\0\0\188\6\247\0\0\201\6\217\0",
       
    81 "\0\167\6\224\0\0\146\6\251\0\0\130\7\25\0",
       
    82 "\0\112\7\66\0\0\98\7\110\0\0\98\7\142\0",
       
    83 "\0\98\7\174\0\0\101\7\206\0\0\101\7\238\0",
       
    84 "\0\126\8\7\0\0\137\8\14\0\10\46\7\245\136",
       
    85 "\10\14\7\247\0\9\241\7\229\0\9\209\7\222\0",
       
    86 "\9\176\7\226\0\9\138\7\233\0\9\94\7\233\0",
       
    87 "\9\62\7\233\0\9\46\7\235\0\2\53\7\139\136",
       
    88 "\2\21\7\137\0\1\250\7\119\0\1\218\7\116\0",
       
    89 "\1\186\7\119\0\1\151\7\119\0\1\119\7\114\0",
       
    90 "\1\92\7\135\0\1\78\7\132\0" }
       
    91 
       
    92 local function drawMap()
       
    93 	for m=1, #map do
       
    94 		ParseCommand("draw "..map[m])
       
    95 	end
       
    96 end
       
    97 
       
    98 function onGameInit()
       
    99 	GameFlags = gfDisableWind + gfDisableGirders + gfDisableLandObjects + gfOneClanMode + gfInfAttack
       
   100 	Map = ""
       
   101 	Seed = 0
       
   102 	Theme = "Brick"
       
   103 	MapGen = mgDrawn
       
   104 	TurnTime = 9999000
       
   105 	Explosives = 0
       
   106 	MinesNum = 0
       
   107 	CaseFreq = 0
       
   108 	WaterRise = 0
       
   109 	HealthDecrease = 0
       
   110 
       
   111 	-- DRAW MAP --
       
   112 	drawMap()
       
   113 
       
   114 	------ HOG LIST ------
       
   115 	AddTeam(loc("Training Team"), 0xFF0204, "deadhog", "SteelTower", "Default", "hedgewars")
       
   116 	
       
   117 	hhs[1] = AddHog(loc("Greenhorn"), 0, 100, "NoHat")
       
   118 	SetGearPosition(hhs[1], 404, 1714)
       
   119 	--SetGearPosition(hhs[1], 1368, 1400)
       
   120 	SetEffect(hhs[1], heResurrectable, 1)
       
   121 
       
   122 	hhs[2] = AddHog(loc("Rhombus"), 0, 100, "NoHat")
       
   123 	SetGearPosition(hhs[2], 620, 1538)
       
   124 	SetEffect(hhs[2], heResurrectable, 1)
       
   125 	HogTurnLeft(hhs[2], true)
       
   126 
       
   127 	hhs[3] = AddHog(loc("Trapped"), 0, 100, "NoHat")
       
   128 	SetGearPosition(hhs[3], 1573, 1824)
       
   129 	SetEffect(hhs[3], heResurrectable, 1)
       
   130 	
       
   131 	hhs[4] = AddHog(loc("Cappy"), 0, 100, "cap_red")
       
   132 	SetGearPosition(hhs[4], 2114, 1411)
       
   133 	SetEffect(hhs[4], heResurrectable, 1)
       
   134 	HogTurnLeft(hhs[4], true)
       
   135 	
       
   136 	hhs[5] = AddHog(loc("Ice"), 0, 100, "NoHat")
       
   137 	SetGearPosition(hhs[5], 1813, 1285)
       
   138 	SetEffect(hhs[5], heResurrectable, 1)
       
   139 
       
   140 	hog_greenhorn = hhs[1]
       
   141 	hog_cappy = hhs[4]
       
   142 	
       
   143 	SendHealthStatsOff()
       
   144 end
       
   145 
       
   146 local function LoadGearData()
       
   147 
       
   148 	--BEGIN CORE DATA--
       
   149 
       
   150 	------ GIRDER LIST ------
       
   151 	PlaceSprite(292, 1488, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   152 	PlaceSprite(454, 1731, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   153 	PlaceSprite(467, 1653, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   154 	PlaceSprite(611, 1702, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   155 	PlaceSprite(426, 1558, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   156 	PlaceSprite(555, 1558, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   157 	PlaceSprite(649, 1600, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   158 	PlaceSprite(1072, 1809, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   159 	PlaceSprite(1040, 1831, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   160 	PlaceSprite(1124, 1805, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   161 	PlaceSprite(1175, 1772, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   162 	PlaceSprite(1226, 1738, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   163 	PlaceSprite(1275, 1705, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   164 	PlaceSprite(1325, 1683, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   165 	PlaceSprite(1368, 1560, sprAmGirder, 3, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   166 	PlaceSprite(1390, 1665, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   167 	PlaceSprite(1481, 1716, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   168 	PlaceSprite(1625, 1652, sprAmGirder, 7, 16448250, nil, nil, nil, lfIce)
       
   169 	PlaceSprite(1729, 1596, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   170 	PlaceSprite(1762, 1545, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   171 	PlaceSprite(1563, 1536, sprAmGirder, 5, 16448250, nil, nil, nil, lfIce)
       
   172 	PlaceSprite(1506, 1392, sprAmGirder, 6, 16448250, nil, nil, nil, lfIce)
       
   173 	PlaceSprite(1591, 1450, sprAmGirder, 3, 16448250, nil, nil, nil, lfIce)
       
   174 	PlaceSprite(1650, 1463, sprAmGirder, 1, 16448250, nil, nil, nil, lfIce)
       
   175 	PlaceSprite(1766, 1492, sprAmGirder, 4, 16448250, nil, nil, nil, lfIce)
       
   176 	PlaceSprite(1925, 1492, sprAmGirder, 4, 16448250, nil, nil, nil, lfIce)
       
   177 	PlaceSprite(2114, 1428, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   178 	PlaceSprite(2187, 1435, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   179 	PlaceSprite(2135, 1478, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   180 	PlaceSprite(2284, 1650, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   181 	PlaceSprite(2005, 1724, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   182 	PlaceSprite(1885, 1562, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   183 	PlaceSprite(2252, 1700, sprAmGirder, 2, 16448250, nil, nil, nil, lfIce)
       
   184 	PlaceSprite(2308, 1803, sprAmGirder, 5, 16448250, nil, nil, nil, lfIce)
       
   185 	PlaceSprite(2394, 1893, sprAmGirder, 1, 16448250, nil, nil, nil, lfIce)
       
   186 	PlaceSprite(605, 1761, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   187 	--PlaceSprite(2429, 1817, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   188 	PlaceSprite(1813, 1312, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   189 	PlaceSprite(1742, 1260, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   190 	PlaceSprite(1812, 1210, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   191 	PlaceSprite(1884, 1260, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   192 	PlaceSprite(1545, 1811, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   193 	PlaceSprite(1577, 1761, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   194 	PlaceSprite(1610, 1811, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   195 	PlaceSprite(1440, 1531, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   196 	PlaceSprite(2082, 1337, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   197 	PlaceSprite(2187, 1273, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   198 	PlaceSprite(2097, 1246, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   199 	PlaceSprite(593, 1465, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   200 	PlaceSprite(684, 1505, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   201 	PlaceSprite(2046, 1492, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   202 	PlaceSprite(2064, 1442, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   203 	PlaceSprite(1849, 1426, sprAmGirder, 4, 16448250, nil, nil, nil, lfIce)
       
   204 	PlaceSprite(3051, 1957, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   205 	PlaceSprite(3101, 1956, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   206 	PlaceSprite(3150, 1954, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   207 	PlaceSprite(3233, 1962, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   208 	PlaceSprite(3322, 2004, sprAmGirder, 3, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   209 	PlaceSprite(3391, 2001, sprAmGirder, 1, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   210 	PlaceSprite(3483, 1982, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   211 	PlaceSprite(2770, 1980, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   212 	PlaceSprite(2886, 2005, sprAmGirder, 1, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   213 	PlaceSprite(2698, 1891, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   214 	PlaceSprite(2843, 1891, sprAmGirder, 6, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   215 	PlaceSprite(2834, 1771, sprAmGirder, 5, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   216 	PlaceSprite(2706, 1771, sprAmGirder, 7, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   217 	PlaceSprite(2768, 1818, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   218 	PlaceSprite(2768, 1899, sprAmGirder, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   219 	PlaceSprite(1760, 1393, sprAmGirder, 2, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   220 	PlaceSprite(516, 1795, sprAmGirder, 4, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   221 
       
   222 	------ RUBBER LIST ------
       
   223 	PlaceSprite(2151, 1659, sprAmRubber, 3, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   224 	PlaceSprite(2399, 1698, sprAmRubber, 3, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   225 	PlaceSprite(2467, 1553, sprAmRubber, 2, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   226 	PlaceSprite(2279, 1497, sprAmRubber, 0, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   227 	PlaceSprite(2414, 1452, sprAmRubber, 0, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   228 	PlaceSprite(1860, 1687, sprAmRubber, 1, 0xFFFFFFFF, nil, nil, nil, lfBouncy)
       
   229 
       
   230 	------ SPRITE LIST ------
       
   231 	PlaceSprite(2115, 1295, 140, 0, 0xFFFFFFFF, nil, nil, nil, lfNormal)
       
   232 
       
   233 	------ CRATE LIST ------
       
   234 	crates[1] = SpawnHealthCrate(401, 1850)			-- Jumping
       
   235 	crates[2] = SpawnHealthCrate(2639, 1973)		-- Final crate
       
   236 	crates[3] = SpawnHealthCrate(1969, 1698)		-- Rubber
       
   237 	crates[4] = SpawnHealthCrate(889, 1829)			-- Back Jumping
       
   238 	crates[5] = SpawnHealthCrate(1486, 1694)		-- Walking on Ice
       
   239 	crates[6] = SpawnHealthCrate(2033, 1470)		-- Walking on Ice completed
       
   240 	crates[7] = SpawnHealthCrate(1297, 1683)		-- Back Jumping 2
       
   241 	crates[8] = SpawnSupplyCrate(1851, 1402, amSwitch, 100)	-- Switch Hedgehog
       
   242 	crates[9] = SpawnHealthCrate(564, 1772)			-- Mission Panel
       
   243 end
       
   244 
       
   245 local function victory()
       
   246 	ShowMission(loc("Basic Movement Training"), loc("Training complete!"),loc("Congratulations! You have completed the obstacle course!"), 0, 0)
       
   247 	SendStat(siGameResult, loc("You have completed the Basic Movement Training!"))
       
   248 	SendStat(siCustomAchievement, loc("Congratulations!"))
       
   249 	SendStat(siPlayerKills, "0", loc("Training Team"))
       
   250 	PlaySound(sndVictory, CurrentHedgehog)
       
   251 	-- Disable controls, end game
       
   252 	SetInputMask(0)
       
   253 	SetWeapon(amNothing)
       
   254 	SetGearMessage(CurrentHedgehog, band(GetGearMessage(CurrentHedgehog), bnot(gmAllStoppable)))
       
   255 	EndGame()
       
   256 end
       
   257 
       
   258 function onGearAdd(gear)
       
   259 	if GetGearType(gear) == gtSwitcher then
       
   260 		switcherGear = gear
       
   261 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (2/3)"),
       
   262 		loc("You have activated Switch Hedgehog!").."|"..
       
   263 		loc("The spinning arrows above your hedgehog show|which hedgehog is selected right now.").."|"..
       
   264 		loc("Hit the “Switch Hedgehog” key until you have|selected Cappy, the hedgehog with the cap!").."|"..
       
   265 		loc("Switch hedgehog: [Tabulator]"), 2, 20000)
       
   266 	end
       
   267 end
       
   268 
       
   269 function onGearDelete(gear)
       
   270 	-- Switching done
       
   271 	if GetGearType(gear) == gtSwitcher then
       
   272 		switcherGear = nil
       
   273 		if CurrentHedgehog == hog_cappy then
       
   274 			ShowMission(loc("Basic Movement Training"), loc("Leap of Faith"),
       
   275 			loc("Good! You now control Cappy.").."|"..
       
   276 			loc("Collect the remaining crates to complete the training."),
       
   277 			2, 0)
       
   278 		else
       
   279 			ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (Failed!)"),
       
   280 			loc("Oops! You have selected the wrong hedgehog! Just try again.").."|"..
       
   281 			loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key to proceed.").."|"..
       
   282 			loc("Open ammo menu: [Right click]").."|"..
       
   283 			loc("Attack: [Space]"), 2, 0)
       
   284 		end
       
   285 
       
   286 	-- Crate collected (or destroyed, but this should not be possible)
       
   287 	elseif gear == crates[1] then
       
   288 		ShowMission(loc("Basic Movement Training"), loc("Jumping"), 
       
   289 		loc("Get the next crate by jumping over the abyss.").."|"..
       
   290 		loc("Careful, hedgehogs can't swim!").."|"..
       
   291 		loc("Long Jump: [Enter]"), 2, 5000)
       
   292 	elseif gear == crates[2] then
       
   293 		victory()
       
   294 	elseif gear == crates[4] then
       
   295 		ShowMission(loc("Basic Movement Training"), loc("Back Jumping (1/2)"),
       
   296 		loc("Now just proceed to the next crates.").."|"..
       
   297 		loc("To get over the next obstacles, you have to do back jumps.") .. "|" ..
       
   298 		loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2"), 2, 5000)
       
   299 	elseif gear == crates[7] then
       
   300 		ShowMission(loc("Basic Movement Training"), loc("Back Jumping (2/2)"),
       
   301 		loc("To get over the next obstacle, you need to perform your back jump precisely.").."|"..
       
   302 		loc("Hint: Hit “High Jump” again when you're close to the highest point of a high jump.").."|"..
       
   303 		loc("Hint: Don't stand too close at the wall before you jump!").."|"..
       
   304 		loc("High Jump: [Backspace]").."|"..loc("Back Jump: [Backspace] ×2"), 2, 15000)
       
   305 	elseif gear == crates[5] then
       
   306 		ShowMission(loc("Basic Movement Training"), loc("Walking on Ice"),
       
   307 		loc("These girders are slippery, like ice.").."|"..
       
   308 		loc("And you need to move to the top!").."|"..
       
   309 		loc("If you don't want to slip away, you have to keep moving!").."|"..
       
   310 		loc("You can also hold down the key for “Precise Aim” to prevent slipping.").."|"..
       
   311 		loc("Precise Aim: [Left Shift]"), 2, 9000)
       
   312 	elseif gear == crates[6] then
       
   313 		ShowMission(loc("Basic Movement Training"), loc("A mysterious Box"),
       
   314 		loc("The next crate is an utility crate.").."|"..		loc("What's in the box, you ask? Let's find out!").."|"..
       
   315 		loc("Remember: Hold down Left Shift to prevent slipping"), 2, 6000)
       
   316 	elseif gear == crates[8] then
       
   317 		ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (1/3)"),
       
   318 		loc("You have collected the “Switch Hedgehog” utility!").."|"..
       
   319 		loc("This allows to select any hedgehog in your team!").."|"..
       
   320 		loc("Select “Switch Hedgehog” from the ammo menu and|hit the “Attack” key.").."|"..
       
   321 		loc("Open ammo menu: [Right click]").."|"..
       
   322 		loc("Attack: [Space]"), 2, 30000)
       
   323 	elseif gear == crates[3] then
       
   324 		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.").."|"..
       
   325 		loc("Now try to get out of this bounce house|and collect the final crate to the right."), 2, 8000)
       
   326 	elseif gear == crates[9] then
       
   327 		ShowMission(loc("Basic Movement Training"), loc("Health and Mission Panel"), loc("You just got yourself some extra health.|The more health your hedgehogs have, the better!").."|"..
       
   328 		loc("Now go to the next crate.").."|"..
       
   329 		-- This part is CRITICALLY important for all future missions
       
   330 		loc("Hint: If this mission panel disappears, you can|see it again by hitting the Pause or Quit key.").."|"..
       
   331 		loc("Quit: [Esc]").."|"..
       
   332 		loc("Pause: [P]")
       
   333 		, 2, 900000)
       
   334 	end
       
   335 end
       
   336 
       
   337 function onGearDamage(gear)
       
   338 	if GetGearType(gear) == gtHedgehog and tookDamage == false then
       
   339 		ShowMission(loc("Basic Movement Training"), loc("Fall Damage"), loc("Ouch! You just took fall damage.").."|"..
       
   340 		loc("Better get yourself another health crate to heal your wounds."), 2, 5000)
       
   341 		tookDamage = true
       
   342 	end
       
   343 end
       
   344 
       
   345 function onSwitch()
       
   346 	-- Update help while switching hogs
       
   347 	if switcherGear then
       
   348 		-- Delay by one tick for CurrentHedgehog to update
       
   349 		switchTicks = 1
       
   350 	end
       
   351 end
       
   352 
       
   353 function onGameTick()
       
   354 	--AddCaption(GetX(CurrentHedgehog)..":"..GetY(CurrentHedgehog))
       
   355 	if switchTicks > 0 then
       
   356 		switchTicks = switchTicks - 1
       
   357 	elseif switchTicks == 0 then
       
   358 		if CurrentHedgehog == hog_cappy then
       
   359 			ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (3/3)"),
       
   360 			loc("This is Cappy.").."|"..
       
   361 			loc("To finish hedgehog selection, just do anything|with him, like walking."),
       
   362 			2, 20000)
       
   363 		else
       
   364 			ShowMission(loc("Basic Movement Training"), loc("Switch Hedgehog (2/3)"),
       
   365 			loc("You have activated Switch Hedgehog!").."|"..
       
   366 			loc("The spinning arrows above your hedgehog show|which hedgehog is selected right now.").."|"..
       
   367 			loc("Hit the “Switch Hedgehog” key until you have|selected Cappy, the hedgehog with the cap!").."|"..
       
   368 			loc("Switch hedgehog: [Tabulator]"), 2, 20000)
       
   369 		end
       
   370 		switchTicks = -1
       
   371 	end
       
   372 end
       
   373 
       
   374 function onGearResurrect(gear)
       
   375 	AddCaption(loc("Your hedgehog has been revived!"))
       
   376 	if gear == hog_cappy then
       
   377 		SetGearPosition(gear, 404, 1714)
       
   378 	elseif gear == hog_greenhorn then
       
   379 		SetGearPosition(gear, 401, 1850)
       
   380 	else
       
   381 		-- Generic teleport to Rhombus' cage
       
   382 		SetGearPosition(gear, 619, 1559)
       
   383 	end
       
   384 	FollowGear(gear)
       
   385 end
       
   386 
       
   387 function onNewTurn()
       
   388 	SwitchHog(hog_greenhorn)
       
   389 	if not walkingText then
       
   390 		ShowMission(loc("Basic Movement Training"), loc("First Steps"), loc("Complete the obstacle course.") .."|"..
       
   391 		loc("To begin, walk to the crate to the right.").."|"..
       
   392 		loc("Walk: [Left] and [Right]") .."|"..
       
   393 		-- TODO: Remove this note when it's no longer needed.
       
   394 		-- Hardcoding control names is not good.
       
   395 		loc("Note: This basic training assumes default controls."), 2, 900000)
       
   396 		walkingText = true
       
   397 	end
       
   398 end
       
   399 
       
   400 function onGameStart()
       
   401 	LoadGearData()
       
   402 	ShowMission(loc("Basic Movement Training"), loc("Basic Training"), loc("Complete the obstacle course."), 1, 0)
       
   403 	FollowGear(hog_greenhorn)
       
   404 end
       
   405