Debian Codegraph @

data/storyline/act1/dialogs/TutorialTom.lua

raw
1 ---------------------------------------------------------------------
2 -- This file is part of Freedroid
3 --
4 -- Freedroid is free software; you can redistribute it and/or modify
5 -- it under the terms of the GNU General Public License as published by
6 -- the Free Software Foundation; either version 2 of the License, or
7 -- (at your option) any later version.
8 --
9 -- Freedroid is distributed in the hope that it will be useful,
10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- GNU General Public License for more details.
13 --
14 -- You should have received a copy of the GNU General Public License
15 -- along with Freedroid; see the file COPYING. If not, write to the
16 -- Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 -- MA 02111-1307 USA
18 ----------------------------------------------------------------------
19 --[[WIKI
20 PERSONALITY = { "Helpful" },
21 PURPOSE = "$$NAME$$ guides the player through the various aspects of playing the game."
22 WIKI]]--
23
24 local Npc = FDrpg.get_npc()
25 local Tux = FDrpg.get_tux()
26
27 -- helper functions for the quickmenu thingy
28
29 local function tutorial_chests_and_armor_and_shops()
30 tut_tux_items_entered = true
31 TutorialTom_Tux_found_all_items = true -- we could open all doors too...
32 tut_tux_chest_entered = true
33 end
34
35 local function tutorial_melee_combat()
36 tutorial_chests_and_armor_and_shops()
37
38 tut_tux_melee_entered = true
39 Tux:add_item("Normal Jacket")
40 Tux:add_item("Improvised Buckler")
41 Tux:add_item("Shoes")
42 Tux:add_item("Worker Helmet")
43 end
44
45 local function tutorial_abilities()
46 tutorial_melee_combat()
47
48 tut_tux_terminal_entered = true
49 end
50
51 local function tutorial_upgrade_items_and_terminal()
52 tutorial_abilities()
53 end
54
55 local function tutorial_hacking()
56 tutorial_upgrade_items_and_terminal()
57
58 tut_tux_takeover_entered = true
59 end
60
61 local function tutorial_ranged_combat()
62 tutorial_hacking()
63
64 tut_tux_glass_entered = true
65 end
66
67 local items_up = {"Entropy Inverter", "Tachyon Condensator", "Antimatter-Matter Converter", "Superconducting Relay Unit", "Plasma Transistor"}
68 local TutorialTom_doors = {"TutorialEntry", "TutorialZigzag1", "TutorialZigzag2", "TutorialZigzag3", "TutorialZigzag4"}
69 local ranged_combat = {"Normal Jacket", "Big kitchen knife", "Shoes", "Standard Shield", "Worker Helmet"}
70
71 -- actual dialog
72
73 return {
74 FirstTime = function()
75 -- initialize
76 TutorialTom_doors2 = {TutorialTom_doors[1], TutorialTom_doors[2], TutorialTom_doors[3], TutorialTom_doors[4], TutorialTom_doors[5], "TutorialEquipOut", "TutorialMeleeOut", "TutorialDoor", "TutorialGlasswallDoor", "TutorialStorage", "TutorialTakeover", "TutorialExit1"}
77 -- to avoid excessive map validator waypoint errors, map starts with all relevant doors open, so we need to close them here
78 for var in ipairs(TutorialTom_doors2) do
79 change_obstacle_state(TutorialTom_doors2[var], "closed")
80 end
81 -- we also need remove all tux skills, except use weapon
82 Tux:downgrade_program("Hacking")
83 Tux:downgrade_program("Repair equipment")
84 Tux:downgrade_program("Emergency shutdown")
85 tut_hack_time=0
86 -- done initializing
87 Npc:set_name("Tutorial Tom")
88 display_console_message(string.format(_"Met [b]%s[/b]!", Npc:get_translated_name()))
89 end,
90
91 EveryTime = function()
92 if (TutorialTom_start_chat) then --initiated by TutorialTerminal.dialog
93 Npc:says(_"Well done.")
94 Npc:says(_"Now follow me to the next section. You will learn how to hack bots.")
95 TutorialTom_start_chat = false -- don't show this again
96 Npc:teleport("TutorialTomPostTerminalTeleportTarget")
97 Npc:set_destination("TutorialTom-Takeover")
98 change_obstacle_state("TutorialTakeover", "opened") --door
99 end_dialog()
100 end
101
102 if (partner_started()) and
103 (TutorialTom_glasswall_smashed) and
104 (cmp_obstacle_state("TutorialWall", "broken")) and
105 (not TutorialTom_glasswall_done) then
106 -- wall section, shown if tux destroyed the wall by hand
107 Npc:says(_"Great, you figured out how deal with this obstacle.")
108 Npc:says(_"Let's proceed.")
109 TutorialTom_glasswall_done = true
110 if (not TutorialTom_Tux_PastWall) then
111 TutorialTom_Tux_PastWall = true
112 Npc:set_destination("TutorialTom-Ranged")
113 end
114 end_dialog()
115 end
116
117 if (not cmp_obstacle_state("TutorialWall", "broken")) then
118 --to avoid regressions with code above
119 if (partner_started()) then
120 Npc:says(_"Hi Linarian, I've been expecting you. My name is Tutorial Tom.")
121 Npc:says(_"Long stasis sleep unfortunately has the side effect of temporary memory loss, sometimes even for simple ordinary every day things.")
122 Npc:says(_"So let's start with the basics, shall we?")
123 show("node1", "node7", "node80")
124 Npc:set_rush_tux(false)
125 elseif (Tux:has_quest("Tutorial Movement")) and
126 (not TutorialTom_talk_to_tom_EveryTime) then
127 -- only once
128 TutorialTom_talk_to_tom_EveryTime = true
129 Npc:says(_"Glad to see you figured out the quest log!")
130 elseif (Tux:has_quest("Tutorial Movement")) and
131 (TutorialTom_move_black) and
132 (not TutorialTom_sprinting) then
133 TutorialTom_sprinting = true
134 Npc:says(_"Speaking of moment, you can also [b]sprint[/b] by holding the [b]control key[/b].")
135 Tux:update_quest("Tutorial Movement", _"Apparently I can sprint if I hold down the control key as I move. This might help if I get in a tight spot.")
136 Npc:says(_"This distance is determined by your yellow stamina bar; the more you have, the farther you can run without becoming winded.")
137 end
138 end
139
140 if (tut_tux_items_entered) and
141 (not TutorialTom_Tux_found_all_items) then
142 show("node5")
143 end
144
145 if (not tut_tux_melee_entered ) then
146
147 if (tut_tux_chest_entered) and
148 (not tut_item_chest_opened) then
149 show("node10")
150 elseif (tut_item_chest_opened) then
151 hide("node10")
152 show("node11")
153 end
154
155 if (Tux:has_item("Normal Jacket")) or
156 (Tux:has_item("Improvised Buckler")) or
157 (Tux:has_item("Shoes")) or
158 (Tux:has_item("Worker Helmet")) then
159 hide("node11")
160 Npc:says(_"Excellent, I see you already took on the armor that was in the box.")
161 if (not armor_node_one) then
162 show("node12")
163 end
164 if (not armor_node_two) then
165 show("node13")
166 end
167 end
168 end
169
170 if (tut_tux_melee_entered) and
171 (not tut_tux_glass_entered) then
172 -- tux is still in bot melee area
173 show("node24")
174 end
175
176 if (tut_tux_terminal_entered) then
177 hide("node24")
178 end
179
180 if (cmp_obstacle_state("TutorialDoor", "opened")) and
181 (tut_tux_takeover_entered) and
182 (not TutorialTom_node50_done) then
183 show("node50")
184 end
185
186 if (tut_tux_glass_entered) then
187 show("node70")
188 end
189
190 if (TutorialTom_Tux_PastWall) then
191 hide("node70") show("node30")
192 end
193
194 if (Tux:done_quest("Tutorial Hacking")) and
195 (not tut_tux_glass_entered) and
196 (not TutorialTom_hide_71) then
197 show("node71")
198 else
199 hide("node71")
200 end
201
202 if (tut_tux_glass_entered) then
203 hide("node55", "node57")
204 end
205
206 if (tut_tux_ranged_entered) and
207 (not tux_node38_done) then
208 show("node38")
209 end
210
211 if (Tux:has_quest("Tutorial Shooting")) then
212 hide("node30") --avoid assigning the quest twice etc..
213 end
214
215 show("node99")
216 end,
217
218 {
219 id = "node1",
220 text = _"Yes, it would be most kind of you. I don't remember anything.",
221 code = function()
222 Npc:says(_"You Linarians keep a quest [b]Log[/b] where you write down key bits of information.")
223 Npc:says(_"When you aren't speaking with someone, you can open it up or close it by pressing the [b]q key[/b].")
224 Npc:says(_"I'll assign you a new quest, so you can try it out. Once you are done, [b]left click[/b] on me.")
225 if (not Tux:has_quest("Tutorial Movement")) then
226 Tux:add_quest("Tutorial Movement", _"To talk to someone, left click on them. You can talk to any friendly bot or person. Friendly people and bots have a green bar above them. Press the 'q' key to open or close the quest log. Left click back on Tutorial Tom to learn more!")
227 end
228 display_big_message(_"Press 'q' for Quests!")
229 hide("node1", "node7", "node80") show("node2", "node3", "node4", "node8")
230 if (tut_tux_items_entered) and
231 (not TutorialTom_Tux_found_all_items) then
232 show("node5")
233 end
234 end_dialog()
235 end,
236 },
237 {
238 id = "node2",
239 text = _"What can you tell me about finding my way in the world?",
240 code = function()
241 Npc:says(_"You Linarians see the world similar to the Heads Up Displays, or [b]HUD[/b], used in computer games.")
242 Npc:says(_"Linarians, like all birds, have a remarkable internal sense of direction. Apparently your HUD has a [b]compass[/b], represented by four red arrows in the upper right corner with North marked on it.")
243 Npc:says(_"You can temporarily disable this compass by pressing the 'tab' key.")
244 Tux:update_quest("Tutorial Movement", _"I learned the four red arrows in the upper-right of my HUD is a compass with north marked on it. I can toggle it using the 'tab' key.")
245 Npc:says(_"Rumor is there was a device Linarians used to remember every place they had been, called an [b]automap[/b].")
246 Npc:says(_"Although, you don't currently have such a device, you might find someone with nanotechnology skills to make one.")
247 Tux:says(_"I'll keep that in mind.")
248 hide("node2")
249 end,
250 },
251 {
252 id = "node3",
253 text = _"My limbs don't seem to want to work properly. Can you help me with that?",
254 code = function()
255 Npc:says(_"Ah yes, movement. It's second nature to us humans, but our research with you in the past showed that your brain seems to work more like a computer.")
256 Npc:says(_"To move somewhere, you have to [b]left click[/b] on the destination on your HUD.")
257 Npc:says(_"If you can go there, you will do so.")
258 Npc:says(_"Now try to move to the red dot to the north. Then to the black grating to the east, and then talk to me again.")
259 Tux:update_quest("Tutorial Movement", _"I'm supposed to left click anywhere to move to a location. If I can figure out a way, I will move there automatically. Tom wants me to first try to move to the red dot to the North.")
260 TutorialTom_learn_to_walk = true
261 hide("node3")
262 end_dialog()
263 end,
264 },
265 {
266 id = "node4",
267 text = _"What else makes me different as a Linarian?",
268 code = function()
269 Npc:says(_"As a Linarian, you have some special abilities that no human does: Linarians can translate programming source code into something like magic.")
270 Npc:says(_"However, using these [b]Programs[/b], adversely affect your body temperature, which you must regulate.")
271 Npc:says(_"But you normally have a special program called [b]Emergency Shutdown[/b], which freezes your motions for several seconds but significantly cools your body.")
272 Npc:says(_"This, and the ability to hack bots will soon return once your mind recovers from the stasis.")
273 Npc:says(_"Once it does, we'll talk more about programs. You can toggle the [b]Skills/Program menu[/b] by pressing the [b]s key[/b].")
274 Tux:update_quest("Tutorial Movement", _"View the Skills/Program menu by pressing the 's' key.")
275 hide("node4")
276 end,
277 },
278 {
279 id = "node5",
280 text = _"I'm sensing some sort of strange presence in the vicinity.",
281 code = function()
282 Npc:says(_"Ah, yes.", "NO_WAIT")
283 Npc:says(_"Linarians seem to [b]detect items[/b] - even through walls - in an augmented reality.")
284 Npc:says(_"The [b]z key[/b] will toggle this augmentation, while the [b]x key[/b] momentarily flashes it.")
285 Npc:says(_"Moving your pointer over an item will tell you more about that item.")
286 Npc:says(_"On our way to the next stopping point, we'll pass some items on the floor.")
287 Npc:says(_"Feel free to stop and examine them to get practice.")
288 Npc:says(_"[b]Left clicking[/b] on an item will pick it up and put it in your inventory, toggled by the [b]i key[/b], where you can examine it further.")
289 if (not TutorialTom_TutMovement_ToggleDetectItems) and
290 Tux:has_quest("Tutorial Movement") then
291 Tux:update_quest("Tutorial Movement", _"Toggle detect items by pressing the 'z' key, and press 'x' to flash the ability. To pick up an item, left click on it. To view an item you've picked up, open the inventory by pressing 'i'.")
292 TutorialTom_TutMovement_ToggleDetectItems = true
293 end
294 if (Tux:has_item("Mug")) and
295 (Tux:has_item("Anti-grav Pod for Droids")) and
296 (Tux:has_item("Plasma Transistor")) then
297 -- these are the items in the room item
298 Npc:says(_"Oh great, I see you found all the items hidden in the room. Good job!")
299 TutorialTom_Tux_found_all_items = true
300 end
301 hide("node5")
302 end,
303 },
304 {
305 id = "node7",
306 text = _"No, thanks, I still remember how to walk, run, navigate, and pick things up.",
307 code = function()
308 hide("node1", "node7", "node80") next("node9")
309 end,
310 },
311 {
312 id = "node8",
313 text = _"Thank you, that was very informative. I think I got how to move around. Can we proceed now?",
314 code = function()
315 Tux:end_quest("Tutorial Movement")
316 Npc:says(_"I just closed your first quest. You can still see what you learned by clicking on the 'done quests' tab in the quest screen.", "NO_WAIT")
317 hide("node8") next("node9")
318 end,
319 },
320 {
321 id = "node9",
322 text = _"I'm eager to learn more.",
323 code = function()
324 Npc:says(_"Ok, follow me into the next area.")
325 for var in ipairs(TutorialTom_doors) do
326 change_obstacle_state(TutorialTom_doors[var], "opened")
327 end
328 hide("node1", "node2", "node3", "node4", "node5")
329 end_dialog()
330 end,
331 },
332 {
333 id = "node10",
334 text = _"What is in that chest?",
335 code = function()
336 Npc:says(_"Well, you can interact with several types of objects by simply [b]left clicking[/b] on them.")
337 Npc:says(_"Left click on the chest to open it up and see what is inside.")
338 if (not Tux:has_quest("Tutorial Melee")) then
339 Tux:add_quest("Tutorial Melee", _"I'm supposed to left click on chests to open them up.")
340 end
341 hide("node10") show("node19")
342 end_dialog()
343 end,
344 },
345 {
346 id = "node11",
347 text = _"Some items came out.",
348 code = function()
349 Npc:says(_"Well, you've discovered a great secret: chests sometimes contain items.")
350 Npc:says(_"We humans have a fascination with hiding our treasures. What comprises a treasure means different things to different people.")
351 Npc:says(_"For some, it's valuable metals in robotic circuitry. That's the current monetary standard on our world.")
352 Npc:says(_"For others, it may be weapons, or even just items that may be used as weapons in a pinch.")
353 Npc:says(_"Still others, odd as it may sound, keep dishes hidden away.")
354 Npc:says(_"Perhaps the best thing you can find, though, is armor. At least, given the current situation with the bots, that is.")
355 hide("node11") show("node12", "node13")
356 end,
357 },
358 {
359 -- armor_node_one
360 id = "node12",
361 text = _"Armor? I should know more about this.",
362 code = function()
363 Npc:says(_"In the years since you entered stasis, mankind has done much research in the field of robotics.")
364 Npc:says(_"One branch in particular that has served us well is the realm of nanotechnology.")
365 Npc:says(_"Because they run a very simple operating system, nanobots were not affected by whatever caused the Great Assault.")
366 Npc:says(_"To this day, our armor and clothing are made out of nanobots. This enables many different sizes of people to wear the same clothing.")
367 Npc:says(_"The nanobots reshape the garment for a comfortable fit, so even you should be able to wear them without problem.")
368 hide("node12") show("node14")
369 end,
370 },
371 {
372 -- armor_node_two
373 id = "node13",
374 text = _"How does wearing clothes and holding shields help me?",
375 code = function()
376 Npc:says(_"Well, it can help you avoid indecent exposure charges.")
377 Tux:says(_"...")
378 Npc:says(_"But all jokes aside, the bots will not mess around.")
379 Npc:says(_"Even the best of fighters sometimes get hit by enemy blows. If I were you, I would seriously consider wearing some sort of armor before mixing it up with those bots.")
380 Npc:says(_"They will help to mitigate some of the damage you take from melee or ranged combat.")
381 Npc:says(_"Keep in mind, though, that there is a chance that your armor will take damage whenever you get hit. Keep an eye on it, or you'll lose it.")
382 hide("node13") show("node15")
383 end,
384 },
385 {
386 id = "node14",
387 text = _"That sounds useful. How do I use armor?",
388 code = function()
389 Npc:says(_"Well, let me start by saying that there are four classes of armor: headgear, shoes, body armor, and shields.")
390 Npc:says(_"When you pick up a piece of armor of a particular class, and you don't already have one equipped, you will automatically equip it if you can.")
391 Npc:says(_"Picking up armor and items can be accomplished by [b]left clicking[/b] on the item. If your inventory has space, you will pick the item up.")
392 Npc:says(_"If you currently have one piece of armor equipped that you would like to swap out for another, simply drag the new armor piece to the current armor piece and left click.")
393 Npc:says(_"They will swap places, and you can put the other piece of armor back into your inventory.")
394 Npc:says(_"Alternatively, you can drag it into your field of view and drop it on the ground.")
395 hide("node14") show("node16")
396 end,
397 },
398 {
399 id = "node15",
400 text = _"I wouldn't want to lose any armor. What can I do about that?",
401 code = function()
402 Npc:says(_"Well, there are several ways to keep that from happening.")
403 Npc:says(_"Equipped items in poor condition will show up yellow and should turn red if in critical condition.")
404 Npc:says(_"If you don't unequip an item in poor or critical condition it may be ruined!")
405 Npc:says(_"There are three things you can do when an item reaches critical condition:")
406 Npc:says(_"First, you can sell or discard the item.")
407 Npc:says(_"Second, you can use your [b]repair equipment[/b] program on the item, which will repair the item at the cost of some of its durability.")
408 Npc:says(_"Or third, you can have the item repaired at a shop, which maintains the item's durability at a price.")
409 hide("node15") show("node17", "node61")
410 end,
411 },
412 {
413 id = "node16",
414 text = _"You mentioned discarding an item. Why would I want to do that?",
415 code = function()
416 Npc:says(_"Well, I can think of a few reasons.")
417 Npc:says(_"You might not have enough room in your inventory for an item you need more, or can sell for more.")
418 Npc:says(_"If an item is close to being destroyed, you might also consider dropping it.")
419 Npc:says(_"And finally some items give negative status effects, and aren't worth selling.")
420 Npc:says(_"Armor or weapons may affect you in different ways.")
421 Npc:says(_"Some will help you out, for example by increasing your cooling rate or increasing your dexterity. This is the work of specialized nanobots, but the reverse can happen too.")
422 hide("node16")
423 armor_node_two = true
424 if (armor_node_one) then
425 show("node19")
426 end
427 end,
428 },
429 {
430 id = "node17",
431 text = _"Repair equipment program? How do I use that?",
432 code = function()
433 Npc:says(_"Perhaps I should start by explaining programs in general.")
434 Npc:says(_"To use a program, select it through your HUD (remember the [b]s key[/b] toggles your [b]Skills/Program menu[/b]).")
435 Npc:says(_"After you've selected a program, run the program by right clicking. Depending on the program you can target an enemy, an item, or just the world.")
436 Npc:says(_"You can also assign quick-select keys to programs. Simply hover over the program in the Skills/Program menu and press one of the keys [b]F5[/b] to [b]F12[/b]. Then, whenever you press this button, you will select the corresponding program.")
437 Npc:says(_"If you're curious what a program does, you can find out by clicking the question mark in the Skills/Program menu.")
438 Npc:says(_"Now, to answer your question, you use your repair equipment program by selecting it in the Skills/Program menu, then right clicking on the item you wish to repair.")
439 Tux:improve_program("Repair equipment")
440 TutorialTom_has_repair = true
441 if (not Tux:has_quest("Tutorial Melee")) then -- this might be tricky
442 Tux:add_quest("Tutorial Melee", _"Run a program by right clicking after it has been selected from the Skills/Program menu. My shoes are damaged, so I might try the repair equipment program on them to slightly repair them.")
443 else
444 Tux:update_quest("Tutorial Melee", _"Run a program by right clicking after it has been selected from the Skills/Program menu. My shoes are damaged, so I might try the repair equipment program on them to slightly repair them.")
445 end
446 hide("node17")
447 end,
448 },
449 {
450 id = "node19",
451 text = _"I think I'm ready for the next section of the tutorial.",
452 code = function()
453 Npc:says(_"Ok, I'll open the next door then. But prepare yourself, soon you will learn how to fight against bots in hand-to-hand combat.")
454 if (not TutorialTom_has_repair) then
455 Tux:improve_program("Repair equipment")
456 end
457 change_obstacle_state("TutorialEquipOut", "opened")
458 end_dialog()
459 hide("node10", "node11", "node12", "node13", "node14", "node15", "node16", "node17", "node61", "node62", "node63", "node64", "node65", "node19") show("node20")
460 end,
461 },
462 {
463 id = "node20",
464 text = _"Can you tell me how to fight the bots?",
465 code = function()
466 Npc:says(_"I will certainly try my best.")
467 Npc:says(_"It's odd to think that a flightless bird would be such a scrapper, but you Linarians have been surprising us since the beginning.")
468 Npc:says(_"We prefer to fight the blamed droids at a distance. They're less likely to rend us limb from limb that way.")
469 Npc:says(_"Unfortunately, guns and other ranged weaponry are hard to come by these days.")
470 Npc:says(_"That goes double for ammunition. Because these are bots, you really can't effectively keep them at bay by just waving around an empty gun.")
471 Npc:says(_"With that in mind, your most reliable weapons are your fists. They never run out of ammo or wear down, but of course they don't do much damage against a metal body, either.")
472 hide("node20") show("node21", "node23")
473 end,
474 },
475 {
476 id = "node21",
477 text = _"So I'm supposed to fight bots with my fists?",
478 code = function()
479 Npc:says(_"There may be times when you have no choice.")
480 Npc:says(_"Melee combat, armed or unarmed, can be initiated by [b]left clicking[/b] on an enemy.")
481 Npc:says(_"You will then walk over to the enemy and start hitting them.")
482 Npc:says(_"Now, I understand you may have some concerns over your safety during this...")
483 Tux:says(_"CONCERNS? Erm... Yes, this doesn't sound like a particularly healthy endeavor.")
484 Npc:says(_"Fred, if you're afraid, you'll have to overlook it. Besides, you knew the job was dangerous when you took it.")
485 Tux:says(_"I beg your pardon? Who is Fred?")
486 Npc:says(_"Never mind, just an old song.")
487 Npc:says(_"Fighting the bots hand-to-hand has risks, there is no question. However, there are things you can do to even the odds.")
488 Npc:says(_"We already discussed armor. Another useful type of item is medical supplies.")
489 Npc:says(_"There are a few different types of restorative items. The most common are health drinks.")
490 hide("node21") show("node22")
491 end,
492 },
493 {
494 id = "node22",
495 text = _"Tell me about health drinks.",
496 code = function()
497 Npc:says(_"Man has practised medicine in one form or another for hundreds of years.")
498 Npc:says(_"Using some of the same nanotechnology that makes up your armor, we've perfected drinks that instantaneously restore your health.")
499 Npc:says(_"There are many kinds, but all accomplish the same thing, to varying degrees.")
500 Npc:says(_"Certain items, like health drinks, can be used directly without clicking on them.")
501 Npc:says(_"At the bottom of your HUD, you'll notice your item access belt. Small items can go here and be used by pressing the numbers [b]0[/b] through [b]9[/b].")
502 Npc:says(_"Unlike armor or weapons, multiple of these items will group together in your inventory slots.")
503 Npc:says(_"If you have Diet Supplements equipped in item slot 1, you can press 1 to use one.")
504 Npc:says(_"This will restore your health, and will be invaluable in the heat of battle.")
505 Tux:update_quest("Tutorial Melee", _"Small one-time-use items, like diet supplements, can be placed in inventory spots labels 1 to 0, and can be used by pressing the corresponding key.")
506 hide("node22")
507 end,
508 },
509 {
510 id = "node23",
511 text = _"I'm ready to fight my first bot.",
512 code = function()
513 Npc:says(_"We keep two bots captive for melee practice.")
514 Npc:says(_"I've unlocked the door leading to the first bot. Take care of it, then come back and talk to me.")
515 Npc:says(_"I'm also giving you some health drinks. Feel free to use them, though I can heal you if you need it.")
516 Npc:says(_"Your health will also regenerate over time. I wish it were so easy for us humans.")
517 Npc:says(_"The first bot is carrying an [b]Entropy Inverter[/b]. Bring it to me to prove you've beaten it.")
518 Npc:says(_"Come back and talk to me when you have the Entropy Inverter.")
519 change_obstacle_state("TutorialMelee1", "opened")
520 Tux:add_item("Doc-in-a-can", 3)
521 Tux:update_quest("Tutorial Melee", _"I'm going to fight my first bot! To start melee combat left click on the bot. Tom wants the Entropy Inverter from the bot after I've defeated it, so I should pick that up.")
522 hide("node23") show("node24", "node25")
523 end_dialog()
524 end,
525 },
526 {
527 id = "node24",
528 text = _"Can you heal me?",
529 code = function()
530 if (Tux:get_hp_ratio() == 1) then
531 Npc:says(_"You are fine, there is nothing that I can do.")
532 hide("node24")
533 else
534 Npc:says(_"You should be more careful, Linarian. But yes, I can heal you.")
535 Npc:says(_"There, all better.")
536 Tux:heal()
537 end
538 end,
539 },
540 {
541 id = "node25",
542 text = _"I've beaten the first bot.",
543 code = function()
544 if (Tux:has_item_backpack("Entropy Inverter")) then
545 Npc:says(_"So you have. Well done.")
546 Npc:says(_"I'll exchange this wrench for it. I think you'll find it handy.")
547 Npc:says(_"Now would be an appropriate time to mention bot parts, I guess.")
548 Npc:says(_"Certain parts in the bots are extra valuable. You can sell them at stores for cash.")
549 Npc:says(_"If you can learn to extract these parts, it can help improve your lot in the world.")
550 Npc:says(_"Hopefully, you can find someone to teach you.")
551 Tux:del_item_backpack("Entropy Inverter", 1)
552 Tux:add_item("Big wrench", 1)
553 Tux:update_quest("Tutorial Melee", _"I brought the entropy inverter to Tom and he gave me my first weapon: a Big wrench. I should equip it.")
554 hide("node25") show("node26")
555 else
556 Npc:says(_"Trying to cheat your way through the tutorial doesn't bode well for your chances in the real world.")
557 Npc:says(_"I'll need proof that you've beaten the first bot.")
558 Npc:says(_"Don't come back without the [b]Entropy Inverter[/b] it was carrying.")
559 end_dialog()
560 end
561 end,
562 },
563 {
564 id = "node26",
565 text = _"You mentioned another bot?",
566 code = function()
567 Npc:says(_"That's correct. The second bot is a lot more dangerous, and you're not likely to make much headway against it with your fists.")
568 Npc:says(_"Lucky for you, there's another dimension to melee combat.")
569 Npc:says(_"Fighting bots with your fists is fine, but there are a number of items you can use for melee.")
570 Npc:says(_"There are several traditional weapons in the world such as swords or light sabers that can be used against the bots.")
571 Npc:says(_"However, more common items you encounter every day can often be used to bash or pry at droid armor.")
572 Npc:says(_"For example, that wrench I just gave you will increase the damage you do, and should let you best the next bot.")
573 hide("node26") show("node27")
574 end,
575 },
576 {
577 id = "node27",
578 text = _"I'm ready to take the next bot on.",
579 code = function()
580 Npc:says(_"I certainly hope so. I will heal you before you go to the next room.")
581 Npc:says(_"I'm also giving you another healing drink, just in case.")
582 Npc:says(_"A 247 is nothing to trifle with, so I'm giving you a shield in the hopes that it'll help keep you alive.")
583 Npc:says(_"Finally, I'm giving you couple of somewhat experimental pills that will temporarily increase your strength and dexterity, respectively.")
584 Npc:says(_"Use them in the same way you would use a health drink.")
585 Npc:says(_"If I were you, I would think about using your repair equipment program on your armor and that wrench before you go into the room.")
586 Npc:says(_"You'll also need to equip them. I won't do that for you.")
587 Npc:says(_"Like the last bot, this one will be carrying an item. Bring me the [b]Tachyon Condensator[/b] it is carrying to continue.")
588 Npc:says(_"I've unlocked the door. Good luck, and talk to me when you have the Tachyon Condensator.")
589 change_obstacle_state("TutorialMelee2", "opened")
590 Tux:heal()
591 Tux:add_item("Doc-in-a-can", 1)
592 Tux:add_item("Strength Capsule", 1)
593 Tux:add_item("Dexterity Capsule", 1)
594 Tux:add_item("Standard Shield", 1)
595 hide("node27") show("node28")
596 end_dialog()
597 end,
598 },
599 {
600 id = "node28",
601 text = _"I've beaten the second bot.",
602 code = function()
603 if (Tux:has_item_backpack("Tachyon Condensator")) then
604 Npc:says(_"Very good! You've completed your melee training.")
605 Npc:says(_"These skills will serve you well in the future.")
606 Npc:says(_"Talk to me when you're ready to move on to the next part of the tutorial.")
607 Tux:del_item_backpack("Tachyon Condensator", 1)
608 hide("node28") show("node29")
609 else
610 Npc:says(_"You didn't bring back the Tachyon Condensator. You'll need to bring it back before we can continue.")
611 Npc:says(_"I'll go ahead and heal you. If your weapon or armor are in bad shape, perhaps you should repair them before going back in there.")
612 Npc:says(_"Don't come back without the [b]Tachyon Condensator[/b].")
613 end_dialog()
614 end
615 Tux:heal()
616 end,
617 },
618 {
619 id = "node29",
620 text = _"I'm ready to move on.",
621 code = function()
622 if (not Tux:done_quest("Tutorial Melee")) then
623 Tux:end_quest("Tutorial Melee", _"I decided to move on and go to next unit of the tutorial.")
624 end
625 --[[ if (TutorialTom_has_gun) then
626 Npc:says(_"I'll bet you're itching to try that pistol out on some bots.")
627 Npc:says(_"Our next destination is the ranged combat training area, so you're in luck.")
628 end ]]--
629 Npc:says(_"I'll unlock the door to the south. Follow the corridor east.")
630 change_obstacle_state("TutorialMeleeOut", "opened")
631 Npc:set_destination("TutorialTom-Terminal")
632 hide("node20", "node21", "node22", "node23", "node24", "node25", "node26", "node27", "node28", "node29")
633 show("node40")
634 end_dialog()
635 end,
636 },
637 {
638 id = "node30",
639 text = _"Ranged weaponry seems safer than getting up close and personal.",
640 code = function()
641 Npc:says(_"Well, Linarian, most of the time it is.")
642 Npc:says(_"There are some bots with ranged weaponry, but we don't have any of those in captivity.")
643 Tux:add_quest("Tutorial Shooting", _"I am learning about how to use ranged weapons.")
644 hide("node30") show("node31", "node38")
645 end,
646 },
647 {
648 id = "node31",
649 text = _"So what can you tell me about guns?",
650 code = function()
651 Npc:says(_"The basic idea behind ranged weaponry is to hurt or kill an enemy without having to come within swinging range.")
652 Npc:says(_"There are three basic ways to do this: traditional firearms, lasers, and plasma weapons.")
653 Npc:says(_"Traditional firearms are things that go bang. A small explosion accelerates the ammunition towards the target at a high velocity, causing injury.")
654 Npc:says(_"Lasers use an intensified beam of light to burn through the intended victim. These operate on replaceable charge packs.")
655 Npc:says(_"Plasma weapons use superheated ionized gas to burn the target. The gas comes in loadable canisters.")
656 Npc:says(_"Most other ranged weapons are variations of these three. We have a few in storage for training purposes.")
657 hide("node31") show("node32")
658 end,
659 },
660 {
661 id = "node32",
662 text = _"So how do I use guns?",
663 code = function()
664 Npc:says(_"Well, firing is pretty simple. First, equip a ranged weapon that you have ammunition for.")
665 Npc:says(_"Next, simply [b]left click[/b] on your target, and you'll begin firing.")
666 Npc:says(_"Alternatively, you can fire a single shot using the [b]Fire Weapon[/b] program, and [b]right clicking[/b] on the enemy.", "NO_WAIT")
667 Npc:says(_"That is the best way if you are trying to conserve precious ammo with high rate of fire guns.")
668 Npc:says(_"There are a couple of new tricks with ranged weapons. If you want to [b]move while firing[/b]: hold [b]shift[/b] and [b]left click[/b] your desired position.")
669 Npc:says(_"If you'd rather stay in place: Hold [b]A[/b], then [b]left click[/b] your target.")
670 Npc:says(_"When your weapon runs out of ammo during combat, it will try to automatically reload if you have extra ammunition for it.")
671 Npc:says(_"Sometimes, you will need or want to manually reload. You can do this by pressing the [b]r key[/b].")
672 Npc:says(_"If you are reloading, or you are out of ammo, the small message screen at the bottom of your HUD will tell you what type of ammo to get.")
673 if (not TutorialTom_guns_how_to) then
674 TutorialTom_guns_how_to = true
675 Tux:update_quest("Tutorial Shooting", _"If I have equipped a ranged weapon and I left click on an enemy, I will begin firing upon it until my gun is empty, and automatically reload. But if I want to fire a single shot, I need to also equip the Fire Weapon program, and then right click. To move while firing, I have to shift + left click to where I want to go. Also, if I want to manually reload I have to press the 'r' key. The small message screen at the bottom of my HUD will tell me if I'm reloading or out of ammunition.")
676 end
677 if (not TutorialTom_opened_door) then
678 show("node33")
679 end
680 hide("node32")
681 end,
682 },
683 {
684 id = "node33",
685 text = _"I think I understand how to use guns now.",
686 code = function()
687 Npc:says(_"In that case, I'll let you in to the armory. There are some crates and chests in there with weapons and ammunition.")
688 Npc:says(_"Be careful though, smashing open crates and barrels could hurt you.")
689 if (TutorialTom_has_gun) then
690 Npc:says(_"You already got the .22 pistol I gave you earlier? It's not much as guns go, but it can do the trick.")
691 else
692 Npc:says(_"Here's my personal .22 Automatic pistol. It's not much as guns go, but it can do the trick.")
693 Tux:add_item(".22 Automatic", 1)
694 Tux:add_item(".22 LR Ammunition", 10)
695 end
696 Npc:says(_"Here is some more ammunition for it.")
697 Npc:says(_"You'll no doubt get more mileage out of the plasma pistol, though. Or any other gun, for that matter.")
698 Npc:says(_"Practice switching weapons and reloading.")
699 Npc:says(_"On the other side of that fence are some bots. Practice killing them off with various ranged weapons.")
700 Npc:says(_"Once you've gotten rid of them all, we can move on.")
701 Tux:update_quest("Tutorial Shooting", _"Tutorial Tom wants me to shoot those bots.")
702 -- TODO probably explain leveling as well as balancing changes to XP always risk causing leveling here. Or somehow make sure Tux can't level
703 TutorialTom_opened_door = true
704 change_obstacle_state("TutorialStorage", "opened")
705 change_obstacle_state("TutorialShootCage", "opened")
706 Tux:add_item(".22 LR Ammunition", 50)
707 hide("node33") show("node34", "node35")
708 end_dialog()
709 end,
710 },
711 {
712 id = "node34",
713 text = _"I ran out of ammo. Can I have some more?",
714 code = function()
715 if (cmp_obstacle_state("37-ammo-chest", "unlocked")) then -- check if tux has opened the ammo chest already : yes
716 if (Tux:has_item_backpack("Laser power pack")) or (Tux:has_item_backpack("Plasma energy container")) or (Tux:has_item_backpack(".22 LR Ammunition")) then
717 -- check if tux still has ammo left
718 Npc:says(_"Looks like you still have some ammo left in your inventory...")
719 Npc:says(_"Why don't you use this first?")
720 Npc:says(_"Try to switch to another gun maybe...")
721 else -- chest opened but no ammo left in inventory...
722 Npc:says(_"Ok, I will give you some more ammo. You seem to be in need, indeed...")
723 Tux:add_item("Laser power pack", 10)
724 Tux:add_item("Plasma energy container", 10)
725 Tux:add_item(".22 LR Ammunition", 10)
726 end
727 else
728 Npc:says(_"Check the storage room to the west for more guns and ammo.")
729 end
730 end,
731 },
732 {
733 id = "node35",
734 text = _"I killed all the bots.",
735 code = function()
736 if (Tux:done_quest("Tutorial Shooting")) then
737 Npc:says(_"Excellent job.")
738 Npc:says(_"Keep shooting like that, and the bots will never stand a chance, as long as you still have ammo.")
739 Tux:update_quest("Tutorial Shooting", _"That was like shooting fish in a barrel. I could use a fish about now.")
740 hide("node35") show("node36", "node37")
741 end_dialog()
742 else
743 Npc:says(_"I don't mind if you don't want to do this, but please don't try to trick me.")
744 Npc:says(_"I don't have verified kills on all those bots.")
745 end
746 end,
747 },
748 {
749 id = "node36",
750 text = _"I would like a few more bots to shoot at.",
751 code = function()
752 Npc:says(_"Ok, I'll create some more droids.")
753 i = 1
754 while (i < 8) do
755 create_droid("shootingrange"..i, 123)
756 i = i + 2
757 end
758 hide("node36")
759 end_dialog()
760 end,
761 },
762 {
763 id = "node37",
764 text = _"So, what's next?",
765 code = function()
766 Npc:says(_"Now, there's one last thing you should know.")
767 Npc:says(_"You Linarians can apparently withdraw from our world temporarily.")
768 Npc:says(_"Time stops, and everything freezes in place.")
769 Npc:says(_"This can be accomplished by using the [b]Esc key[/b].")
770 if (not TutorialTom_hacking_bots) then
771 Npc:says(_"Your final task is to leave us using this menu.")
772 Npc:says(_"I'm afraid there's nothing more I can teach you. I wish you good luck, Linarian.")
773 Npc:says(_"You'll need it if our world is to survive.")
774 end
775 change_obstacle_state("TutorialExit1", "opened")
776 hide("node30", "node31", "node32", "node33", "node34", "node35", "node36", "node38")
777 end,
778 },
779 {
780 id = "node38",
781 text = _"Why can't I hack the bots here, or use programs on them?",
782 code = function()
783 Npc:says(_"Well, that would be cheating, don't you think so?")
784 Npc:says(_"Shooting moving targets needs a bit of practice, yes...")
785 Npc:says(_"...but in the end you will profit a lot from it.")
786 Tux:says(_"Ok, I will try my best.")
787 tux_node38_done = true
788 hide("node38")
789 end,
790 },
791 {
792 id = "node40",
793 text = _"Why are we stopping?",
794 code = function()
795 Npc:says(_"You've done well so far, Linarian. Let's take a little break.")
796 Npc:says(_"Once you get out into the real world, you'll find that your current abilities aren't always enough to survive.")
797 Npc:says(_"As you achieve combat experience, you'll be able to apply it to better yourself.")
798 Npc:says(_"As with most things, you view this as a panel in your HUD. Press the [b]c key[/b] to open the [b]Character panel[/b].")
799 Npc:says(_"Once you've gained enough experience, you'll level up. This will automatically improve some of your statistics.")
800 Npc:says(_"You'll also be given 5 points to spend however you choose in three different areas. Characteristics, Skills and Programs.")
801 Npc:says(_"[b]Strength[/b] governs the amount of damage you do with each hit in melee combat.")
802 Npc:says(_"[b]Dexterity[/b] controls your hit rate, or how likely you are to hit the enemy. It also determines how likely you are to dodge a hit from them.")
803 Npc:says(_"[b]Cooling[/b] is your processors cooling, or heat resilience, and determines how much you can process before your system starts overheating.")
804 Npc:says(_"Finally, among your main characteristics, [b]Physique[/b] determines how much health you have.")
805 Npc:says(_"There are general [b]Melee[/b] and [b]Ranged[/b] fighting skills, both of which increase the damage you inflict and how fast you attack as you improve them.")
806 Npc:says(_"You also have the [b]Programming[/b] skill, which essentially is about programming in an energy-efficient manner so programs cause less heat.")
807 Npc:says(_"Apart from this, a few programs require a teacher and training points to improve.")
808 Npc:says(_"[b]Extract Bot Parts[/b] is a special passive skill that will allow you to salvage parts from bots you 'retire', which you can trade for money in the town.")
809 Npc:says(_"There may be other passive skills, but I know nothing about those.")
810 Npc:says(_"A good technician is able to make use of those parts.")
811 Npc:says(_"He can create, let's say, an add-on and, after doing some modifications to the item, attach this add-on.")
812 Npc:says(_"This way an upgraded item is created.")
813 Tux:add_quest("Tutorial Upgrading Items", _"There is a way to upgrade items if I meet a good technician. It sounds useful, maybe I should learn more about this.")
814 Npc:says(_"The [b]Hacking[/b] program we will speak a bit more of in a little while.")
815 hide("node40") show("node41")
816 end,
817 },
818 {
819 id = "node41",
820 text = _"I'll have to keep that in mind.",
821 code = function()
822 Npc:says(_"Well, how about you try it out?")
823 Npc:says(_"I'll give you some points to spend, and you can distribute them as you like.")
824 Npc:says(_"Since you'll be hacking up ahead, you should probably use a few of them on [b]Cooling[/b].")
825 Npc:says(_"But, again, that's your choice.")
826 Tux:add_xp(2000)
827 hide("node41") show("node58")
828 end_dialog()
829 end,
830 },
831 {
832 id = "node42",
833 text = _"Alright, I'm ready to go hack some bots.",
834 code = function()
835 if (not Tux:done_quest("Tutorial Upgrading Items")) then
836 Tux:end_quest("Tutorial Upgrading Items", _"I decided that I don't need to know how to upgrade items.")
837 end
838 Npc:says(_"First, you'll need to unlock the door.")
839 Npc:says(_"See that [b]Terminal[/b] to the left?")
840 Npc:says(_"You will need to login, by left clicking on it, and then select unlock door.")
841 Npc:says(_"Terminals act very similar to hacked bots.")
842 Tux:add_quest("Tutorial Hacking", _"I need to login to the Terminal by left clicking on it. Then I'll unlock the door, so I can go hack some bots!")
843 hide("node42", "node58", "node59", "node60")
844 end_dialog()
845 end,
846 },
847 {
848 id = "node50",
849 text = _"So how does this work?",
850 code = function()
851 Npc:says(_"We talked about programs before. Now, we're going to focus on hacking programs in particular.")
852 Npc:says(_"As I mentioned before, your brain works in a way remarkably similar to a central processing unit.")
853 Npc:says(_"In many ways, you interact with the world around you as a virtual environment.")
854 Npc:says(_"You seem to have access to an API that isn't exposed to humans. You can interact with the environment in ways we only dream of.")
855 Npc:says(_"Because of this, you can run various programs on the bots.")
856 Npc:says(_"You can attempt to take them over, or monkey with their programming, or even cause them to damage themselves.")
857 Npc:says(_"Likewise, there are certain programs that affect you or items around you.")
858 if (not Tux:has_quest("Tutorial Hacking")) then -- quest already added in node 42
859 Tux:add_quest("Tutorial Hacking", _"I need to login to the Terminal by left clicking on it. Then I'll unlock the door, so I can go hack some bots!")
860 end
861 TutorialTom_node50_done = true
862 hide("node50") show("node51")
863 end,
864 },
865 {
866 id = "node51",
867 text = _"Tell me about taking bots over.",
868 code = function()
869 Npc:says(_"I'm afraid that you will have to experience it for yourself to really understand.")
870 -- Npc:says(_"However, you did leave yourself instructions before you went into stasis sleep.")
871 Npc:says(_"Taking over a bot comes in the form of a game or competition placing you against the bot.")
872 Npc:says(_"You initiate it by selecting the [b]Hacking[/b] program, then [b]right-clicking[/b] on a hostile bot.")
873 Npc:says(_"The field of play is split into two sides, one yellow, one purple, representing circuit boards.")
874 Npc:says(_"In the center of the field is a column of boxes known as logic cores. These cores have wires attached to them from both circuit boards.")
875 Npc:says(_"Your objective is to activate as many cores in your chosen color as possible at the end of each round.")
876 Npc:says(_"This is accomplished by selecting a wire with the up or down buttons, then pressing spacebar to activate that core.")
877 Npc:says(_"You will be given about 10 seconds initially to select which color you want with spacebar.")
878 Npc:says(_"At that point, you have 10 more seconds in which to activate more cores than the bot.")
879 Npc:says(_"Each activation of one core will consume one charge and you have a limited number of charges, 3 by default, so choose your targets carefully.")
880 Npc:says(_"I can tell you about some more advanced techniques, if you'd like.")
881 if (not TutorialTom_updated_hacking_quest) then
882 Tux:update_quest("Tutorial Hacking", _"Apparently in order to hack, all I have to do is select the Hacking program, right click a bot, and play a little game. I've got this!")
883 TutorialTom_updated_hacking_quest = true
884 end
885 show("node52", "node53", "node54") hide("node51")
886 end,
887 },
888 {
889 id = "node52",
890 text = _"What was that about activating more cores than the bot?",
891 code = function()
892 Npc:says(_"Ah, yes. While you are busy trying to take the bot over, it will be busy trying to stop you.")
893 Npc:says(_"The truth is, if the bot programming was perfect, it would be almost impossible to defeat.")
894 Npc:says(_"Fortunately for you, software bugs do indeed exist, and therefore some cores will be on your side from the beginning.")
895 Npc:says(_"Likewise, the bots only have a limited number of charges. Occasionally, they will have more than you, but that is a risk you have to take.")
896 Npc:says(_"Because you are initiating the attack, you do get to choose your side, which can let you handicap the bot greatly if used wisely.")
897 hide("node52")
898 end,
899 },
900 {
901 id = "node53",
902 text = _"Tell me about more advanced techniques.",
903 code = function()
904 Npc:says(_"Each charge will activate and remain active for a certain amount of time. This will let you take over a core that a bot just took over.")
905 Npc:says(_"Sometimes, the bots will already have charges on the wires. When you activate one of these, it will increase the time that wire is activated for.")
906 Npc:says(_"The bot can use this trick too, so it may be wise to give up a heavily guarded wire for an easier target.")
907 Npc:says(_"The wiring inside the bots sometimes contain splitters. These can be used in two ways.")
908 Npc:says(_"A 2-to-1 splitter is undesirable. This requires two charges to activate one core, halving your efficiency.")
909 Npc:says(_"A 1-to-2 splitter, however, will activate two nodes for the price of one charge.")
910 Npc:says(_"Sometimes these splitters will be stacked. Tracing the route ahead of time will be crucial to your tactical success.")
911 Npc:says(_"Ideally, you want to stick your opponent with 2-to-1 splitters, while you have 1-to-2 splitters at your disposal.")
912 Npc:says(_"Finally, remember that patience is often a virtue. Taking over all cores early on only to lose them later can be a crushing blow.")
913 hide("node53")
914 end,
915 },
916 {
917 id = "node54",
918 text = _"I'm ready to try hacking bots.",
919 code = function()
920 Npc:says(_"I certainly hope so.")
921 Npc:says(_"I should, however, take the time to tell you a few more things.")
922 Npc:says(_"Hacking, like most other programs, incurs a cost to you.")
923 Npc:says(_"Processing programs seems to heat up your brain.")
924 Npc:says(_"You seem to be able to handle quite a bit of heat, but you have your limits.")
925 Npc:says(_"If you do not use all charges when attempting to take over a bot, you will spare some heat.")
926 Npc:says(_"Not activating all charges or beating the bot with a comfortable winning margin is less exhaustive for you.")
927 Npc:says(_"If you nevertheless accumulate too much heat, you will automatically shut down in order to cool off.")
928 Npc:says(_"Over time, the heat will seep away from your body naturally. However, there are ways to speed up the process.")
929 Npc:says(_"If you can find them, cooling drinks will quickly relieve your thermal discomfort, in much the same way healing drinks help your health.")
930 Npc:says(_"Remember you also have a special program called [b]Emergency Shutdown[/b] that will lower your heat level drastically. Unfortunately using Emergency Shutdown will shut you down and render you paralyzed for several seconds. It makes you a sitting duck... er, penguin.")
931 Tux:says(_"I take it that was a joke also?")
932 Npc:says(_"Quite.", "NO_WAIT")
933 Npc:says(_"In addition to hacking, you have the ability to execute arbitrary code on bots.")
934 Npc:says(_"These scripts and programs can be learned through reading source code books. To read a book, right-click on it in inventory.")
935 Npc:says(_"You should have recovered your hacking ability by now, and I'll give you a couple of source code books as well.")
936 show("node55", "node57") hide("node54")
937 end,
938 },
939 {
940 id = "node55",
941 text = _"Thanks. I'm ready now.",
942 code = function()
943 Npc:says(_"We have several bots behind that fence for you to practice on.")
944 Npc:says(_"Take them over, then talk to me when they're all dead.")
945 Npc:says(_"If you need more help, don't hesitate to ask.")
946 Npc:says(_"Oh, and Linarian... If you fail when hacking, you'll receive an electrical shock.")
947 Npc:says(_"It shouldn't kill you, but you need to be aware of it nonetheless.")
948 if (not TutorialTom_hacking_bots) then
949 Tux:improve_program("Hacking")
950 Tux:improve_program("Emergency shutdown")
951 Tux:add_item("Liquid nitrogen", 1)
952 Tux:add_item("Source Book of Calculate Pi", 1)
953 Tux:add_item("Source Book of Malformed packet", 1)
954 TutorialTom_hacking_bots = true
955 Tux:update_quest("Tutorial Hacking", _"Tutorial Tom wants me to hack those bots. The only thing I need to worry about is overheating. But if I get too hot I can always try the Emergency shutdown program.")
956 change_obstacle_state("TutorialTakeoverCage", "opened")
957 show("hacking_extratime")
958 end
959 hide("node55")
960 end_dialog()
961 end,
962 },
963 {
964 id = "hacking_extratime",
965 text = _"I'm having troubles in taking over a bot within allocated time.",
966 code = function()
967 tut_hack_time=tut_hack_time+2
968 Npc:says(_"In real life you have to finish within the allocated time, and time limit is often more important than charges.")
969 Npc:says(_"As it's your first time hacking, I'll teach you a skill so you get a whooping extra second to take over the bot.")
970 Npc:says(_"Be warned though, that very few people know how to improve this skill. It's called [b]Animal Magnetism[/b].")
971 Npc:says(_"This may be a good time to mention that every program have a revision. It's like a skill level. Higher revision usually means higher effects.") -- TODO This whole part about program revisions should be on node55. "Eating" books should also be explained.
972 Npc:says(_"Naturally, this include heat cost as well. Improving a revision is usually the same process from learning a new program.")
973 Npc:says(_"Well, I guess that's all. Come back to me when all bots are dead.")
974 Tux:improve_program("Animal Magnetism")
975 Tux:improve_program("Animal Magnetism")
976 if (tut_hack_time > 2) then
977 hide("hacking_extratime")
978 else
979 Npc:says(_"Ah, linarian! If you need, I can grant you even another second, but I don't recommend.", "NO_WAIT")
980 Npc:says(_"Come see me if you need it.")
981 end_dialog()
982 end
983 end,
984 },
985 {
986 id = "node57",
987 text = _"Tell me again about take over, I'm not sure I got it all.",
988 code = function()
989 Npc:says(_"Tell me exactly what part you want me to explain again.")
990 Npc:says(_"But things will be much clearer once you try for yourself than when I try to explain.")
991 Npc:says(_"Use your experience as notes, and all should be clear.")
992 show("node51", "node52", "node53") hide("node57")
993 end,
994 },
995 {
996 id = "node58",
997 text = _"Can you tell me more about upgrading items?",
998 code = function()
999 Npc:says(_"You can upgrade most weapons and clothing. First, you'll need some materials to craft add-ons.")
1000 Npc:says(_"Parts needed for this process can be extracted from bots. You'll have to learn how to do it.")
1001 Npc:says(_"When you have enough materials, you can craft an add-on. Make sure the add-on is suitable for your equipment.")
1002 Npc:says(_"After this, you have to make a socket in your equipment so you can plug in the add-on.")
1003 Npc:says(_"That's the theory. Simple, isn't it?")
1004 Npc:says(_"I'll give you some materials now and let you craft an add-on.")
1005 Npc:says(_"Usually you'll do this in some sort of mini-factory.", "NO_WAIT")
1006 Npc:says(_"But I'll do this for you without one or my name is not Tom. Tutorial Tom.")
1007 Npc:says(_"Pay attention to the type of socket the add-on needs.")
1008 Tux:update_quest("Tutorial Upgrading Items", _"Before crafting an add-on I have to get some materials. The best way is to extract them from the bots, using Extract Bot Parts skill. Each add-on requires a socket in the item. When the add-on is ready, I have to create a socket in the item and plug the add-on. Only technicians can craft add-ons or plug them.")
1009 -- TODO decide on what type of upgrade should player make?
1010 for i,v in ipairs(items_up) do
1011 Tux:add_item(v, 20)
1012 end
1013
1014 craft_addons()
1015 Npc:says(_"Now you'll need to pay some more money in order to make a socket and plug in the add-on. Here, take some.")
1016 Tux:add_gold(1200)
1017 Npc:says(_"Choose an item and add an appropriate socket by clicking '+' on the right of the item. Then attach the add-on to this item and confirm your choice.")
1018 upgrade_items()
1019 Tux:end_quest("Tutorial Upgrading Items",_"Maybe I need some time to practice this, but I got the basics.")
1020 hide("node58") show("node59", "node60", "node42")
1021 end,
1022 },
1023 {
1024 id = "node59",
1025 text = _"I wasted my materials on the add-on I didn't need. Can you give more?",
1026 code = function()
1027 Npc:says(_"Yes, but only this time. I'll give you some money too. Just be more careful in the future and make wise choices.")
1028 Npc:says(_"Reality is not as generous as I am.")
1029 for i,v in ipairs(items_up) do
1030 Tux:add_item(v, 20)
1031 end
1032
1033 Tux:add_gold(1200)
1034 Tux:says(_"Thank you.")
1035 Npc:says(_"Think carefully before you make your next add-on.")
1036 hide("node59")
1037 end,
1038 },
1039 {
1040 id = "node60",
1041 text = _"Upgrading items is still too complex for me. Can you explain it again?",
1042 code = function()
1043 Npc:says(_"First step is finding materials. They may be extracted from bots, but you'll have to learn how to do it.")
1044 Npc:says(_"Those materials can be used in crafting add-ons. Make sure the add-on will fit your equipment. Also, remember the type of the socket your add-on needs.")
1045 Npc:says(_"I gave you materials. Let's craft an add-on now.")
1046 craft_addons()
1047 Npc:says(_"All you have to do now is to choose a suitable item and add a socket by clicking ''+'' on the right of the chosen item.")
1048 Npc:says(_"Remember you pay for both adding a socket and plugging an add-on.")
1049 Npc:says(_"Let's try it, shall we?")
1050 upgrade_items()
1051 Npc:says(_"I hope it's clear now.")
1052 end,
1053 },
1054 {
1055 id = "node61",
1056 text = _"Shops?",
1057 code = function()
1058 Npc:says(_"Some people are willing to trade items and circuits with you.")
1059 --Npc:says(_"Although, if you have too many circuits, they will charge you a bit more.") https://rb.freedroid.org/r/1327/
1060 Npc:says(_"Most are willing to buy whatever you have, at a discounted price.")
1061 Npc:says(_"There are also some automated vending machines, that dispense small items.") -- but these cannot buy from you.") -- to be implemented
1062 hide("node61") show("node62")
1063 end,
1064 },
1065 {
1066 id = "node62",
1067 text = _"I would like to practice selling an item.",
1068 code = function()
1069 Npc:says(_"I'm going to give you a Small Axe, which you can't use yet, so you can practice selling it to me.")
1070 Npc:says(_"You will see the Small Axe appear in the lower shop bar. You can sell most of these items.")
1071 Npc:says(_"Items that you have equipped have a hand icon on them.")
1072 Npc:says(_"However, if you sell the items from the chest (which should have been equipped automatically) I won't be giving you replacements.")
1073 Npc:says(_"Select the Small Axe and click the sell button.")
1074 Tux:add_item("Small Tutorial Axe")
1075 i = 1
1076 while (i < 100) do -- this is a ugly hack to get rid of the "Item received: Small Axe" centerprint
1077 display_big_message("")
1078 i = i + 1
1079 end
1080 hide("node62") next("node63")
1081 end,
1082 },
1083 {
1084 id = "node63",
1085 text = _"Let me try that again.",
1086 echo_text = false,
1087 code = function()
1088 trade_with("TutorialTom")
1089 if (Tux:has_item_backpack("Small Tutorial Axe")) then
1090 show("node63")
1091 else
1092 hide("node63")
1093 show("node64")
1094 end
1095 end,
1096 },
1097 {
1098 id = "node64",
1099 text = _"How about buying an item?",
1100 code = function()
1101 Npc:says(_"Well it is much the same procedure, except the items for sale are on the top row.")
1102 Npc:says(_"With the circuits from selling the Small Axe to me, you can afford to buy a unit of Bottled ice.")
1103 Npc:says(_"Since Bottled ice combine together, a slider will pop-up asking how many you'd like to buy.")
1104 Npc:says(_"You have enough circuits for one unit.")
1105 sell_item("Bottled Tutorial ice")
1106 hide("node64") next("node65")
1107 end,
1108 },
1109 {
1110 --hidden
1111 id = "node65",
1112 text = _"Let me try that again.",
1113 echo_text = false,
1114 code = function()
1115 if (Tux:get_gold() < 15) then
1116 Tux:add_gold(15 - Tux:get_gold())
1117 end
1118 trade_with("TutorialTom")
1119 if (Tux:count_item_backpack("Bottled Tutorial ice") < 1) then
1120 show("node65")
1121 else
1122 hide("node65")
1123 next("node66")
1124 end
1125 end,
1126 },
1127 {
1128 --hidden
1129 id = "node66",
1130 code = function()
1131 Npc:says(_"You will occasionally run into items that can't be sold.")
1132 Npc:says(_"This generally means that the shopkeeper can't give you a reasonable deal on it.")
1133 Npc:says(_"Someone else probably wants the item.")
1134 Npc:says(_"You might check your questbook to see if it is mentioned there.")
1135 if (Tux:has_item_backpack("Bottled Tutorial ice")) then --before player notices, swap the "tutorial" item to normal one :P
1136 local Tutorial_ice_amount = Tux:count_item("Bottled Tutorial ice")
1137 Tux:del_item_backpack("Bottled Tutorial ice", Tutorial_ice_amount)
1138 Tux:add_item("Bottled ice", Tutorial_ice_amount)
1139 display_big_message("") -- so that we don't have the Item Received: spam on the screen which might be confusing
1140 display_big_message("")
1141 display_big_message("")
1142 display_big_message("")
1143 display_big_message("")
1144 display_big_message("")
1145 display_big_message("")
1146 display_big_message("")
1147 display_big_message("")
1148 display_big_message("")
1149 display_big_message("")
1150 else
1151 Npc:says("ERROR OCCURRED, TutorialTom node 66, player doesn't have bottled tutorial ice, WTF happened??")
1152 end
1153 armor_node_one = true
1154 if (armor_node_two) then
1155 show("node19")
1156 end
1157 end,
1158 },
1159 {
1160 id = "node70",
1161 text = _"There is a wall in the path! How will we get through?",
1162 code = function()
1163 if (cmp_obstacle_state("TutorialWall", "broken")) then
1164 Npc:says(_"Uhm, looks like the wall is already broken, I'll repair it.")
1165 change_obstacle_state("TutorialWall", "intact")
1166 else
1167 Npc:says(_"Notice that part of it is made of a weak material, glass.")
1168 Npc:says(_"Obstacles you can interact with change color when your cursor is hovering over them.")
1169 Npc:says(_"[b]Left click[/b] on the glass wall to break it.")
1170 Npc:says(_"After you break through the glass wall, walk to the other side so I know you are ready to move on.")
1171 end
1172 end_dialog()
1173 end,
1174 },
1175 {
1176 id = "node71",
1177 text = _"I defeated all the bots in the cage.",
1178 code = function()
1179 Npc:says(_"Well done!")
1180 Npc:says(_"Then let us move towards the next stage of the Tutorial")
1181 change_obstacle_state("TutorialGlasswallDoor", "opened")
1182 Npc:says(_"As a reward, I'm giving you a .22 Automatic pistol.")
1183 if (Tux:has_item("Source Book of Calculate Pi")) and
1184 (Tux:has_item("Source Book of Malformed packet")) then
1185 --plural
1186 Npc:says(_"But I have to take these sourcebooks from you to prevent you from cheating in the next section of the tutorial.")
1187 Npc:says(_"Sorry about that...")
1188 Tux:says(_"Ok...")
1189 elseif (Tux:has_item("Source Book of Calculate Pi")) or
1190 (Tux:has_item("Source Book of Malformed packet")) then
1191 --singular
1192 Npc:says(_"But I have to take this sourcebook from you to prevent you from cheating in the next section of the tutorial.")
1193 Npc:says(_"Sorry about that...")
1194 Tux:says(_"Ok...")
1195 end
1196 if (Tux:has_item("Source Book of Calculate Pi")) then -- ugly, but it shall do
1197 Tux:del_item("Source Book of Calculate Pi")
1198 end
1199 if (Tux:has_item("Source Book of Malformed packet")) then
1200 Tux:del_item("Source Book of Malformed packet")
1201 end
1202 Tux:add_item(".22 Automatic", 1)
1203 Tux:add_item(".22 LR Ammunition", 10)
1204 while (tut_hack_time > 0) do
1205 Tux:downgrade_program("Animal Magnetism") -- Remove extra hacking time
1206 tut_hack_time=tut_hack_time-1
1207 end
1208 TutorialTom_has_gun = true
1209 TutorialTom_hide_71 = true
1210 hide("node42", "node50", "node51", "node52", "node53", "node57", "node71", "hacking_extratime")
1211 end_dialog()
1212 end,
1213 },
1214
1215 -- Quick Menu (to jump to sections)
1216
1217 {
1218 id = "node80",
1219 text = _"I'd like to skip to a later section of the Tutorial.",
1220 code = function()
1221 Npc:says(_"OK, what would you like to learn about?")
1222 show("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1223 hide("node1", "node7", "node80")
1224 end,
1225 },
1226
1227 {
1228 id = "node81",
1229 text = _"Chests and Armor",
1230 code = function()
1231 Npc:says(_"OK, I'll take us to the Chest.")
1232 Npc:teleport("TutorialTom-Chest")
1233 Tux:teleport("TutorialTux-Chest")
1234 tutorial_chests_and_armor_and_shops()
1235 next("node10")
1236 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1237 end,
1238 },
1239
1240 {
1241 id = "node82",
1242 text = _"Shops",
1243 code = function()
1244 Npc:says(_"Remember to pick up the items in the chest.")
1245 Npc:says(_"I'll tell you about the shops.")
1246 Npc:teleport("TutorialTom-Chest")
1247 Tux:teleport("TutorialTux-Chest")
1248 tutorial_chests_and_armor_and_shops()
1249 next("node61")
1250 show("node19")
1251 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1252 end,
1253 },
1254
1255 {
1256 id = "node83",
1257 text = _"Melee Combat",
1258 code = function()
1259 Npc:says(_"OK, I'll take us to the melee arena and give you some armor.")
1260 Npc:teleport("TutorialTom-Melee")
1261 Tux:teleport("TutorialTux-Melee")
1262 Tux:add_quest("Tutorial Melee", _"I skipped ahead to the Melee practice. Tom gave me some armor to use.")
1263 tutorial_melee_combat()
1264 next("node20")
1265 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1266 end,
1267 },
1268
1269 {
1270 id = "node85",
1271 text = _"Abilities",
1272 code = function()
1273 Npc:says(_"OK, I'll take us there and give you some armor and a weapon.")
1274 Npc:teleport("TutorialTom-Terminal")
1275 Tux:teleport("TutorialTux-Terminal")
1276 tutorial_abilities()
1277 next("node40")
1278 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1279 end,
1280 },
1281
1282 {
1283 id = "node86",
1284 text = _"Upgrading Items & Terminals",
1285 code = function()
1286 Npc:says(_"OK, I'll take us there and give you some armor and a weapon to work with.")
1287 Npc:teleport("TutorialTom-Terminal")
1288 Tux:teleport("TutorialTux-Terminal")
1289 tutorial_upgrade_items_and_terminal()
1290 if (not Tux:has_quest("Tutorial Upgrading Items")) then
1291 Tux:add_quest("Tutorial Upgrading Items", "")
1292 end
1293 next("node58")
1294 show("node42")
1295 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1296 end,
1297 },
1298
1299 {
1300 id = "node87",
1301 text = _"Hacking Bots",
1302 code = function()
1303 Npc:says(_"OK, I'll take us to the hacking area. Also, I'll give you some XP so you can improve your cooling.")
1304 Tux:add_xp(2000)
1305 Npc:teleport("TutorialTom-Takeover")
1306 Tux:teleport("TutorialTom-Takeover")
1307 tutorial_hacking()
1308 next("node50")
1309 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1310 end,
1311 },
1312
1313 {
1314 id = "node84",
1315 text = _"Ranged Combat",
1316 code = function()
1317 Npc:says(_"OK, I'll take us to the shooting range and give you some armor and a weapon.")
1318 Npc:teleport("TutorialTom-Ranged")
1319 Tux:teleport("TutorialTux-Ranged")
1320 change_obstacle_state("TutorialShootCage", "opened")
1321 tutorial_ranged_combat()
1322 next("node30")
1323 hide("node81", "node82", "node83", "node84", "node85", "node86", "node87")
1324 end,
1325 },
1326
1327 {
1328 id = "node99",
1329 text = _"Let me take a short break and practice on my own for a while.",
1330 code = function()
1331 Npc:says(_"Ok, I'll be around if you need any more questions answered. Don't hesitate to ask.")
1332 end_dialog()
1333 end,
1334 },
1335 }