Debian Codegraph @

data/storyline/act1/dialogs/Erin.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 = { "Challenging", "Strong", "Extroverted", "Independent", "Arrogant" },
21 MARKERS = { NPCID1 = "Iris", NPCID2 = "Saul" },
22 PURPOSE = "$$NAME$$ teaches Tux melee combat, but only if Tux have prior knowledge on it because she can't stand weak linarians. In future there will be a quest to reunite her with Iris.",
23 BACKSTORY = "$$NAME$$ is part from the Rebel Faction. She worked with $$NPCID1$$ hunting bots and when they were to sleep at barracks, which was rare, they were roommates. On combat, $$NPCID1$$ was more careful to preserve droid drops and she would use brute force to smash and finish the bot \"for once and for all\". They are good friends, despite the contrasts on their personality and fighting style. They usually took solo missions but back home they told stories of their missions to each other. $$NAME$$ usually challenged $$NPCID1$$ to see who had killed more droids and most times than not, won. $$NPCID1$$ believes she is dead because $$NAME$$ went on a special, secret mission, given by $$NPCID2$$ personally, and never came back. She has fought with many robots before, and will not be scared by a mere linarian."
24 WIKI]]--
25
26 local Npc = FDrpg.get_npc()
27 local Tux = FDrpg.get_tux()
28
29 return {
30 FirstTime = function()
31 show("node0")
32 end,
33
34 {
35 id = "node0",
36 text = _"Hi! I'm new here.",
37 code = function()
38 Npc:says(_"Oh great. A greenie. This is no place for you. Come back from where you came.")
39 --; TRANSLATORS: %s = player name
40 Tux:says(_"Well, excuse me?! I am %s, the Linarian who will save the world!", get_player_name())
41 Npc:says(_"Linarian? You're more to some sort of overgrown penguin who forgot where the North Pole is. You're wasting my time, so you better have a reason to be talking to me.")
42 hide("node0") show("node1", "node30")
43 end,
44 },
45
46 {
47 id = "node1",
48 text = _"What's your name?",
49 code = function()
50 Npc:says(_"I am Erin, the bot hunter.")
51 Tux:says(_"Pleased to meet you! I am-", "NO_WAIT")
52 Npc:says(_"Yes, yes, I don't care. Is that all?")
53 Npc:set_name("Erin - bot hunter")
54 hide("node1") show("node2", "node3", "shop")
55 end,
56 },
57 {
58 id = "node2",
59 text = _"Do you hate me?",
60 code = function()
61 Npc:says(_"No, I'm just annoyed with your silly questions.")
62 hide("node2") hide("node30", "node31")
63 end,
64 },
65 {
66 id = "node3",
67 text = _"You hunt bots?",
68 code = function()
69 Npc:says(_"I have to make a living, after all. Food is not free.")
70 Tux:says(_"Even military rations?")
71 Npc:says(_"...are you being serious?")
72 hide("node3") show("node4")
73 end,
74 },
75 {
76 id = "node4",
77 text = _"You're the most annoying person I've ever met.",
78 code = function()
79 Npc:says(_"The same can be said from my part. Now, will you leave me alone?")
80 hide("node4") show("node5")
81 end,
82 },
83 {
84 id = "node5",
85 text = _"I'm serious. You're being rude and mean. What have I done for you?!",
86 code = function()
87 Npc:says(_"You're wasting my time. This is a reason good enough to I be mean.")
88 Npc:says(_"I think I'll ignore you until you say something important.")
89 hide("node5") show("node6", "node10")
90 end,
91 },
92 {
93 id = "node6",
94 text = _"Where did you got your outfit?",
95 code = function()
96 Npc:says("...")
97 hide("node6")
98 end,
99 },
100 {
101 id = "node10",
102 text = _"You look strong.",
103 code = function()
104 Npc:says(_"I don't look strong. I [b]AM[/b] strong. I hunt bots, after all.")
105 Tux:says(_"Well, I hunt bots too.")
106 Npc:says(_"...are you being serious? No, you surely jest.")
107 hide("node10") show("node11")
108 end,
109 },
110 {
111 id = "node11",
112 text = _"Jest?? I am at least so strong as you!",
113 code = function()
114 Npc:says(_"Oh, is this a challenge?")
115 Tux:says(_"...")
116 Tux:says(_"...Yes.")
117 Npc:says(_"Hmm. Good. I like challenges. We shall fight then, Linarian!")
118 Npc:says(_"But I will be fair. Only when you get expertise at melee training, we can spar.")
119 hide("node11") show("training_main")
120 end,
121 },
122 {
123 id = "node30",
124 text = _"How do you dare to call me a penguin?? Face my wrath!",
125 code = function()
126 Npc:says(_"HAHAHA!")
127 Npc:says(_"I've fought with many bots before, and I'll not be scared by a mere linarian.")
128 Npc:says(_"Feel free to try, though. Anytime.")
129 hide("node30") show("node31")
130 end,
131 },
132 {
133 id = "node31",
134 text = _"Prepare to die!",
135 code = function()
136 Npc:says(_"Who, me? Didn't you mean... you?", "NO_WAIT")
137 Npc:says(_"[b]She draws a short sword she kept hidden the whole time, and struck it against your chest.[/b]")
138 Npc:says(_"Now you die.")
139 Tux:del_health(50)
140 Tux:says(_"Not... yet!", "NO_WAIT")
141 Npc:says(_"[b]With visible effort, you manage to get away.[/b]")
142 Npc:says(_"Come back, penguin... I'll make you... SUFFER.")
143 Npc:set_faction("ms") -- She'll ignore robots just... for... YOU.
144 hide("node31")
145 end_dialog()
146 end,
147 },
148 {
149 id = "shop",
150 text = _"I would like to trade with you.",
151 code = function()
152 Npc:says(_"Do I look some sort of vending machine to you? What makes you think I will have anything to trade with you?")
153 Npc:says(_"I said you were overgrown earlier. Forget it. You're just a kid.")
154 hide("shop")
155 end,
156 },
157
158
159 -- This node turned kinda huge. Handles training.
160 {
161 id = "training_main",
162 text = _"Can you train me, so I can get expertise at melee fighting for our promised fight?",
163 code = function()
164 if (Tux:get_skill("melee") == 0) then
165 Npc:says(_"What?? I am not a Linarian babysitter!")
166 Npc:says(_"See in the town if someone is fool enough to want to teach you the BASICS.")
167 Npc:says(_"You better get out of my face!")
168 -- Tux is on learning range, but haven't decided on a payment method yet
169 elseif (Tux:get_skill("melee") > 0 and Tux:get_skill("melee") < 4 and not Erin_payment_method) then
170 Npc:says(_"Oh, so the duck wants a lesson. So, tell me, what would I gain from that?", "NO_WAIT")
171 Npc:says(_"My time is precious, after all.")
172 hide("training_main") show("tm_money", "tm_training", "tm_weapons")
173 elseif (Tux:get_skill("melee") == 1) then -- Novice -> Apprentice (Mace)
174 Npc:says(_"You want me to train you, then? Have you already look on the mirror?", "NO_WAIT")
175 Npc:says(_"You're more green than the color green. In fact, calling you a newbie would be a offense to the term itself.")
176 Npc:says(_"But, maybe, with my training, you can improve. Assuming you can improve, that is. But it'll be hard, I warn you.")
177 Npc:says(_"It's take or leave.")
178 hide("training_main")
179 if Erin_payment_method == "money" then
180 show("apprentice_money")
181 elseif Erin_payment_method == "training" then
182 show("apprentice_training")
183 elseif Erin_payment_method == "weapons" then
184 show("apprentice_weapons")
185 else -- (Something deemed impossible went wrong, silently fix it...)
186 Erin_payment_method = false
187 next("training_main")
188 end
189 elseif (Tux:get_skill("melee") == 2) then -- Apprentice -> Professional (Sword)
190 Npc:says(_"Look who is back asking for more training. I'm amused.", "NO_WAIT")
191 Npc:says(_"It seems like you've been doing your homework, uhm?")
192 Tux:says(_"Of course I've improved. I have an excellent teacher, after all.")
193 Npc:says(_"You...! Okay, maybe I took too easy previously! I will train you so hard this time, that you'll sweat blood!")
194 Npc:says(_"Are you up for the challenge?!")
195 hide("training_main")
196 if Erin_payment_method == "money" then
197 show("professional_money")
198 elseif Erin_payment_method == "training" then
199 show("professional_training")
200 elseif Erin_payment_method == "weapons" then
201 show("professional_weapons")
202 else
203 Erin_payment_method = false
204 next("training_main")
205 end
206 elseif (Tux:get_skill("melee") == 3) then -- Professional -> Expert (Light Staff)
207 Npc:says(_"Hey, look at what we got here.", "NO_WAIT")
208 Npc:says(_"You're getting good. But not so good like me, though! Hahaha!")
209 Npc:says(_"Tell me, I have one more task for you. Consider this... specialization.")
210 Npc:says(_"Interested?")
211 hide("training_main")
212 if Erin_payment_method == "money" then
213 show("expert_money")
214 elseif Erin_payment_method == "training" then
215 show("expert_training")
216 elseif Erin_payment_method == "weapons" then
217 show("expert_weapons")
218 else
219 Erin_payment_method = false
220 next("training_main")
221 end
222 else -- Tux is an Expert. The promised fight can happen now.
223 Npc:says(_"Heh. I don't want to admit it, but you got pretty good. You'll need to train by yourself now, if you want to improve further.")
224 Tux:says(_"Don't get forgetful. I've challenged you to a duel. You said you would accept when I got stronger.")
225 Npc:says(_"Indeed I did, but Saul needs my services now. I'm sorry, Linarian. You'll need to wait a few days before I can wash the floor with your head.")
226 Tux:says(_"..Your head, you mean...")
227 Npc:says(_"Hey, I won't be training you any further, but this doesn't mean I can't do anything for you. I have a strength pill. Here, take it.", "NO_WAIT")
228 Tux:add_item("Strength Pill")
229 Npc:says(_"May we cross our blades another time, Linarian. This is a promise.")
230 -- at this point, we could send Erin to Slasher mountains or something...
231 hide("training_main")
232 end
233 end,
234 },
235
236 -- Payment method selection
237 {
238 id = "tm_money",
239 text = _"I have lots of valuables with me.",
240 code = function()
241 Erin_payment_method="money"
242 Tux:says(_"You could use money to buy a better outfit, ya'know.")
243 Npc:says(_"Hmm, that can do.")
244 Npc:says(_"But be warned, I'm not cheap!")
245 hide("tm_money", "tm_training", "tm_weapons") show("training_main")
246 end,
247 },
248 {
249 id = "tm_training",
250 text = _"I'll train hard everyday, and make you proud by being the best disciple one could wish for.",
251 code = function()
252 Erin_payment_method="training"
253 Tux:says(_"You will be able to brag about my deeds to all your friends.")
254 Npc:says(_"Hmm, that can do.")
255 Npc:says(_"But be warned, it'll be stressing!")
256 hide("tm_money", "tm_training", "tm_weapons") show("training_main")
257 end,
258 },
259 {
260 id = "tm_weapons",
261 text = _"I could arrange to expand your weapon arsenal.",
262 code = function()
263 Erin_payment_method="weapons"
264 Npc:says(_"Hmm, that can do.")
265 Npc:says(_"If you give me the weapons I ask for, that is!")
266 hide("tm_money", "tm_training", "tm_weapons") show("training_main")
267 end,
268 },
269
270
271 -- Dialog for trainings. Please note payment is handled in another node.
272 {
273 id = "apprentice",
274 echo_text = false,
275 code = function()
276 Tux:says(_"Yes, please make me your apprentice.")
277 Npc:says(_"Okay, try hitting me.")
278 Tux:says(_"Hah! Me, hitting a female?")
279 Tux:del_health(20)
280 Npc:says(_"Shut up and do what you're told! Do you want to learn from me or not?!")
281 Tux:says(_"YOU!!")
282 Npc:says(_"[b]Erin, however, is too fast. She dodges all blows until you're too tired and collapse on the ground.[/b]")
283 Npc:says(_"Haha, what a weakling! I wanted to say even a fly can hit harder than you, but you can't even hit!")
284 Npc:says(_"Listen here, linarian. It's not about causing damage. It's about hitting your enemy.", "NO_WAIT")
285 Npc:says(_"If you do not have the dexterity to hit them, your strength and physical won't matter, you'll die.")
286 Npc:says(_"I hope you've learned your lesson! That I am better than you, that is.")
287 Tux:improve_skill("melee")
288 show("training_main")
289 end_dialog()
290 end,
291 },
292 {
293 id = "professional",
294 echo_text = false,
295 code = function()
296 Tux:says(_"I want to fight like a pro! I want to smash concrete with my bare hands!")
297 Npc:says(_"So, let's have a duel.")
298 Tux:says(_"What?? Hey wait, I wasn't even managing to hit you before--", "NO_WAIT")
299 Tux:del_health(35)
300 Npc:says(_"Shut up and do what you're told! I said you were going to sweat blood!")
301 Tux:says(_"YOU!!")
302 Npc:says(_"[b]This time you're more in shape, and even manage to hit her twice. Unfortunately, her hits were too hard and you give up not long after the fight begun.[/b]")
303 Npc:says(_"Haha, you must be weaker than the bots here. Congratulations on hitting me twice, but you're still far from mastering melee, though.")
304 Npc:says(_"I might be saying the obvious but... There's no point if you die.", "NO_WAIT")
305 Npc:says(_"Giving up was, well, shameful, but you should remember that retreating is no reason of shame. When you retreat, you gain time.")
306 Npc:says(_"You can do a lot of things with extra time. You can change your weapon, train some more, study your opponent, plan a strategy and even hack an army of robots to help you.")
307 Npc:says(_"So, remember this! Retreating is an option! Dying is not!")
308 Npc:says(_"...And take care. I might have seen some 123 bots nearby, and I think they're still too strong for you, so...")
309 Tux:improve_skill("melee")
310 show("training_main")
311 end_dialog()
312 end,
313 },
314 {
315 id = "expert",
316 echo_text = false,
317 code = function()
318 Tux:says(_"So, what do you want, Erin? To mop the ground with my head?")
319 Npc:says(_"No, not this time.")
320 Tux:says(_"Oh? What could it be to iron-clad Erin speak softly?")
321 Tux:del_health(60)
322 Npc:says(_"Shut up!!!")
323 Npc:says(_"[b]Erin hit you pretty strongly, and you fall to the ground.[/b]")
324 Npc:says(_"Oh, you survived. Congratulations. Maybe you can be useful, after all?")
325 Npc:says(_"Today you'll learn stealth. By the hard way, that is.")
326 Npc:says(_"South of here is the building they call... \"The Hell Fortress\". The Red Guard is responsible for its security so I can't get close.", "NO_WAIT")
327 Npc:says(_"They took a necklace from me. Your task is to get it back. You can't fail.")
328 Npc:says(_"Do it without killing them, and I'll consider you an expert at the melee arts. Because fighting is an art, it's not about killing.")
329 -- TODO: Erin was planned to have tasks instead of simple dialog. But that's NYI so bear with us.
330 Npc:says(_"[b]You somehow do it. One of the guards notice you sneaking at his belongings, but you knock him out to the ground and get away unnoticed.[/b]")
331 Npc:says(_"Good job, newbie. You know, we might disagree with the Red Guard but we need them to protect those gates.")
332 Tux:says(_"We?")
333 Npc:says(_"There are many things you don't know, Linarian. The fall of the Red Guard is near. Now leave.")
334 Tux:improve_skill("melee")
335 show("training_main")
336 end_dialog()
337 end,
338 },
339
340 -- Handles payment by class and trade-coin
341 {
342 id = "apprentice_money",
343 text = _"Please make me your apprentice! (costs 1000 circuits)",
344 echo_text = false,
345 code = function()
346 if (Tux:can_train(1000, 0)) then
347 Tux:del_gold(1000)
348 hide("apprentice_money")
349 next("apprentice")
350 else
351 next("no_money")
352 end
353 end,
354 },
355 {
356 id = "apprentice_training",
357 text = _"Please make me your apprentice! (costs 10 training points)",
358 echo_text = false,
359 code = function()
360 if (Tux:can_train(0, 10)) then
361 Tux:del_points(10)
362 hide("apprentice_training")
363 next("apprentice")
364 else
365 next("no_training")
366 end
367 end,
368 },
369 {
370 id = "apprentice_weapons",
371 text = _"Please make me your apprentice! (requires Mace)",
372 echo_text = false,
373 code = function()
374 if (Tux:has_item_backpack("Mace")) then
375 Tux:del_item_backpack("Mace", 1)
376 hide("apprentice_weapons")
377 next("apprentice")
378 else
379 Npc:says(_"Listen, Linarian, I want a mace to smash the bots.", "NO_WAIT")
380 next("no_weapons")
381 end
382 end,
383 },
384
385 {
386 id = "professional_money",
387 text = _"Teach me how to smash concrete with my bare hands! (costs 3000 circuits)",
388 echo_text = false,
389 code = function()
390 if (Tux:can_train(3000, 0)) then
391 Tux:del_gold(3000)
392 hide("professional_money")
393 next("professional")
394 else
395 next("no_money")
396 end
397 end,
398 },
399 {
400 id = "professional_training",
401 text = _"Teach me how to smash concrete with my bare hands! (costs 15 training points)",
402 echo_text = false,
403 code = function()
404 if (Tux:can_train(0, 15)) then
405 Tux:del_points(15)
406 hide("professional_training")
407 next("professional")
408 else
409 next("no_training")
410 end
411 end,
412 },
413 {
414 id = "professional_weapons",
415 text = _"Teach me how to smash concrete with my bare hands! (requires Antique Greatsword)",
416 echo_text = false,
417 code = function()
418 if (Tux:has_item_backpack("Antique Greatsword")) then
419 Tux:del_item_backpack("Antique Greatsword", 1)
420 hide("professional_weapons")
421 next("professional")
422 else
423 Npc:says(_"Listen, Linarian, I want a Greatsword to say I have a Greatsword.", "NO_WAIT")
424 next("no_weapons")
425 end
426 end,
427 },
428
429 {
430 id = "expert_money",
431 text = _"What do you want, Erin? I am ready to become an expert at melee! (costs 6500 circuits)",
432 echo_text = false,
433 code = function()
434 if (Tux:can_train(6500, 0)) then
435 Tux:del_gold(6500)
436 hide("expert_money")
437 next("expert")
438 else
439 next("no_money")
440 end
441 end,
442 },
443 {
444 id = "expert_training",
445 text = _"What do you want, Erin? I am ready to become an expert at melee! (costs 20 training points)",
446 echo_text = false,
447 code = function()
448 if (Tux:can_train(0, 20)) then
449 Tux:del_points(20)
450 hide("expert_training")
451 next("expert")
452 else
453 next("no_training")
454 end
455 end,
456 },
457 {
458 id = "expert_weapons",
459 text = _"What do you want, Erin? I am ready to become an expert at melee! (requires Light Saber)",
460 echo_text = false,
461 code = function()
462 if (Tux:has_item_backpack("Light saber")) then
463 Tux:del_item_backpack("Light saber", 1)
464 hide("expert_weapons")
465 next("expert")
466 else
467 Npc:says(_"Listen, Linarian, I want a Light Saber, because when I was just a child I saw a movie and since then I always wanted to have one.", "NO_WAIT")
468 next("no_weapons")
469 end
470 end,
471 },
472
473 -- Failure messages. Some are too similar to other NPCs and should be changed.
474 {
475 id = "no_money",
476 code = function()
477 Npc:says_random(_"You need more circuits, or no training for you!",
478 _"Please don't bother me if you can't pay me!",
479 _"Come back when you have some circuits. A deal is a deal.",
480 _"Keep your end on the bargain and come back when you have something of value.")
481 end,
482 },
483 {
484 id = "no_training",
485 code = function()
486 Npc:says_random(_"You are not ready. Go kill some bots and come back.",
487 _"Come back when you are mentally prepared to learn.",
488 _"I don't think you have enough experience for this.",
489 _"Come back when you have a real will to learn.",
490 _"You don't have enough experience. Come here after you see some more action.")
491 end,
492 },
493
494 {
495 id = "no_weapons",
496 code = function()
497 Npc:says_random(_"Keep your end on the bargain.",
498 _"Give me the weapon and I'll give you training.",
499 _"I expect you to bring me everything I've asked you to.")
500 end,
501 },
502
503 {
504 id = "node99",
505 enabled = true,
506 text = _"See you later.",
507 code = function()
508 if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
509 Npc:says_random(_"Try to don't die until then.",
510 _"Don't let the bots get you. If they do, you're dead.",
511 _"Yeah yeah. Leave me alone.",
512 _"...Finally...")
513 else
514 Npc:says_random(_"Watch where you step. There may be traps.",
515 _"Yeah yeah. Leave me alone.",
516 _"...Finally...")
517 end
518 end_dialog()
519 end,
520 },
521 }