Debian Codegraph @

data/storyline/act1/dialogs/Kevin.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 = { "Obsessed", "Distracted", "Intelligent" },
21 MARKERS = { NPCID1 = "Jasmine" },
22 PURPOSE = "$$NAME$$ will help to improve Tux\'s skills.",
23 BACKSTORY = "$$NAME$$ stole material from the town and works in isolation on research to defeating the bots.",
24 RELATIONSHIP = {
25 {
26 actor = "$$NPCID1$$",
27 text = "$$NAME$$ is $$NPCID1$$\'s creator and boyfriend." },
28 }
29 WIKI]]--
30
31 local Npc = FDrpg.get_npc()
32 local Tux = FDrpg.get_tux()
33
34 return {
35 FirstTime = function()
36 show("node0")
37 Kevin_max_lessons = 6 -- the max number of lessons Kevin is willing to teach
38 Kevin_lessons_taught = 0 -- the number of lessons Kevin has already taught, initialized with 0
39 Kevin_next_lesson_cost = 0 -- the training point cost of the upcoming lesson
40 Kevin_talk_later = 0 -- to trigger the stdoubt node
41 Kevin_hacking = false -- Should we display Kevin's hacking node?
42 end,
43
44 EveryTime = function()
45 if (Kevin_hacking) then
46 show("node30")
47 Kevin_hacking=false
48 end
49
50 if (Kevin_entering_from_back) then
51 Npc:says(_"Hey, what are you doing?")
52 Npc:says(_"You aren't allowed to enter through the backdoor, least of all make one...")
53 Npc:says(_"Of course, unless you receive authorization from the administrator.")
54 Npc:says(_"Of course, unless you could save lives or protect people.")
55 Npc:says(_"Of course, unless, maybe two or three further exceptions...")
56 Npc:says(_"But this isn't the case here, so explain yourself.")
57 show("node90", "node91", "node92")
58 push_topic("Backdoor")
59 elseif (not has_met("Kevin")) then -- don't say "hello again" when meeting for the first time
60 Tux:says_random(_"Hello.",
61 _"Hi there.")
62 Npc:says_random(_"Well, hello.",
63 _"Hello hello.",
64 _"Uhm hello.")
65 else
66 Tux:says_random(_"Hello.",
67 _"Hi there, Kevin.")
68 Npc:says_random(_"Well, hello again.",
69 _"Hello hello.",
70 _"Welcome back.")
71 end
72
73 if (Tux:has_quest("A strange guy stealing from town")) and
74 (not Tux:done_quest("A strange guy stealing from town")) then
75 Tux:add_xp(100)
76 Tux:end_quest("A strange guy stealing from town", _"Oh, I seem to have found the guy the town guard was raving on about. Better not tell the Red Guards in town or they might force me to assist them in his capture. I'll likely have more use of Kevin and his knowledge here in his house with his computers than in a holding cell in town.")
77 end
78
79 if (Tux:has_quest("And there was light...")) and
80 (Tux:done_quest("And there was light...")) then
81 show("node8", "node10")
82 if (not Kevin_did_And_there_was_light) then
83 Kevin_did_And_there_was_light = true -- Tux spoke with Kevin after completing the quest "And there was light..."
84 Tux:update_quest("And there was light...", _"Everything *is* back to normal for now, so Kevin doesn't need to spend all his time monitoring the power levels.")
85 end
86 end
87
88 if (Jasmine_sigsegv) then
89 show_if((not Kevin_sigtalk), "node20")
90 end
91
92 if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
93 Npc:says(_"Dang, my test subjects just died and I just can't find other droids to replace them...")
94 Npc:says(_"Where did all droids go, after all?!")
95 Npc:says(_"I have no time to talk, I have to find new test subjects.")
96 if (not Kevins_Lawnmower_tux_login_granted) and
97 (Kevins_Lawnmower_tux_login) then
98 next("node61")
99 end
100 end_dialog()
101 end
102
103 if (not Kevins_Lawnmower_tux_login_granted) then
104 if (Kevins_Lawnmower_tux_login_kevin_attempt) then
105 Npc:says(_"Hmm, strange things are happening to my lawnmower.")
106 Npc:says(_"But I don't have the time right now to take a look at it.")
107 end
108
109 if (Kevins_Lawnmower_tux_login) then
110 Npc:says(_"Oh, and did you play around with my lawnmower?")
111 show("node60", "node61")
112 end
113 end
114
115 show("node99")
116 end,
117
118 {
119 id = "node0",
120 text = _"Oh dear... You look awful... Who did this to you? Did they torture you?",
121 code = function()
122 Npc:says(_"I haven't eaten and slept very much lately, so I'm a little hungry and may appear a little tired.")
123 Npc:says(_"One of the side effects of always deleting all cookies.")
124 Npc:says(_"Don't worry about me. I'll be fine.")
125 Npc:says(_"I'm Kevin, a computer security expert.")
126 Tux:says(_"In other words: You are a hacker.")
127 Npc:says(_"Eh... I guess you could put it that way, yes.")
128 Npc:set_name("Kevin - Hacker")
129 hide("node0") show("node30")
130 end,
131 },
132 {
133 id = "node6",
134 text = _"I'll see after the energy supply now.",
135 code = function()
136 Npc:says(_"That's great. You can't miss it. It's not hard to find. Enter my garden and find the lower station entrance there.")
137 Npc:says(_"It would be best not to bother with the resistance on the first level. You only need to take care of the energy supply. And that's on the SECOND level.")
138 Npc:says(_"I hope you have a laser pistol or something like that, the bots there will rip you apart if you try to approach them.")
139 Npc:says(_"Best make it quick. I'm already sick of stabilizing the stupid power grid!")
140 Tux:update_quest("And there was light...", _"The entrance is in Kevin's garden. According to Kevin I also don't need to bother with bots on the first level, just go straight for the second level.")
141 hide("node6", "node7")
142 end,
143 },
144 {
145 id = "node7",
146 text = _"I'm sorry, but I don't think there's anything I could do about the energy supply.",
147 code = function()
148 Npc:says(_"Too bad. Now get out of my sight.")
149 hide("node7")
150 end,
151 },
152 {
153 id = "node8",
154 text = _"About that project you said you have running...",
155 code = function()
156 if (Tux:done_quest("A kingdom for a cluster!")) then
157 Npc:says(_"I've already received the results from the evaluation of my data in the cluster. Good work.")
158 else
159 Npc:says(_"Yes, since the energy supply has been constant, results were much better. I've achieved my goal.")
160 Npc:says(_"I've obtained secret data on the town surroundings. We'll need a big computer cluster to evaluate it properly.")
161 Npc:says(_"Once we've evaluated the data, we might find a way to secure the town and ensure our survival. But it's too early to tell yet.")
162 Npc:says(_"If I only had a suitable cluster. Then we could start data evaluation right away.")
163 show("node9")
164 end
165 hide("node8")
166 end,
167 },
168 {
169 id = "node9",
170 text = _"Maybe I can help somehow to find a suitable cluster.",
171 code = function()
172 if (Tux:has_quest("A kingdom for a cluster!")) then
173 Npc:says(_"You've already agreed to take my data cube to the cluster. I have no influence on this matter anymore.")
174 Npc:says(_"The fate of the town now rests in your hands. Take the data cube I gave you to the cluster. Only there can the data be evaluated properly.")
175 else
176 Npc:says(_"That would be great of course. I know that the old town is maintaining a suitable information infrastructure and has had a proper cluster running for some time now.")
177 Npc:says(_"The only problem is, I can't go back to town. They would probably kill me because of... a misunderstanding.")
178 Npc:says(_"Also, the cluster is inside of the guard citadel. I hear that only members of the Red Guard are allowed to enter the complex.")
179 Npc:says(_"But maybe you can arrange that somehow. For me it would be impossible, because of my reputation.")
180 Npc:says(_"I'll give you the data cube. Take it to the computer cluster administration people. They will know what to do. And don't mention me there.")
181 Tux:add_quest("A kingdom for a cluster!", _"Kevin gave me a cube full of some kind of data. I am supposed to take it to a computer cluster for analysis. Ought to be simple.")
182 Tux:add_item("Kevin's Data Cube", 1)
183 Npc:set_death_item("NONE") -- to make sure we don't get two data cubes!!
184 end
185 hide("node9")
186 end,
187 },
188 {
189 id = "node10",
190 text = _"How about some reward for securing your energy supply area?",
191 code = function()
192 if (Kevin_reward_given) then
193 Npc:says_random(_"I've already rewarded you for that. Don't steal my time. I'm busy.",
194 _"I am not as confused as you think. Go away now.")
195 else
196 Npc:says(_"What do you want?")
197 push_topic("Kevin's Reward")
198 show("node11", "node12", "node13", "node14")
199 end
200 hide("node10")
201 end,
202 },
203 {
204 id = "node11",
205 text = _"I want to become a hacker.",
206 topic = "Kevin's Reward",
207 code = function()
208 Npc:says(_"Your desire for information amuses me. Your wish will be granted. I will teach you how to improve your skill in designing hacking programs.")
209 Npc:says(_"You must know that hacking is an art. It is easy to chop your enemy to bits with an axe or shred it to atoms with a grenade... But hacking requires skill.")
210 Npc:says(_"Look at this terminal... I am connected to a remote system. A fool would just launch a thousand attacks, but a skilled intruder stops and thinks.")
211 Npc:says(_"You must know when to hack and when not to hack. You must attack when the enemy is unprepared for you.")
212 Npc:says(_"Now watch. Observe carefully. See how I enter the system... Yes. Watch the connection glowing, burning like a bright star...")
213 Npc:says(_"...only to die seconds after, as the system far away collapses under it's own weight... It's done.")
214 Npc:says(_"That is all I want to show you for now. Maybe later I will teach you something else.")
215 Tux:improve_program("Hacking")
216 next("node15")
217 end,
218 },
219 {
220 id = "node12",
221 text = _"I don't want any reward. Just gratitude.",
222 topic = "Kevin's Reward",
223 code = function()
224 Npc:says(_"Of course you can have that. There, I'm most grateful to you. That should do.")
225 -- reward here could be bonus to joining faction or a powerful hacked (friendly) bot that supports Tux fighting in Hell Fortress.
226 next("node15")
227 end,
228 },
229 {
230 id = "node13",
231 text = _"I want money.",
232 topic = "Kevin's Reward",
233 code = function()
234 Npc:says(_"Eh... Here, take these 900 circuits. That should be enough.")
235 Tux:add_gold(900)
236 next("node15")
237 end,
238 },
239 {
240 id = "node14",
241 text = _"I want to think about that for another moment.",
242 topic = "Kevin's Reward",
243 code = function()
244 Npc:says(_"So be it. As reward for your help I grant you the right to think about that.")
245 Npc:says(_"Just joking. Come back when you've decided what you want.")
246 hide("node11", "node12", "node13", "node14")
247 pop_topic() -- "Kevin's Reward"
248 end,
249 },
250 {
251 id = "node15",
252 topic = "Kevin's Reward",
253 code = function()
254 Kevin_reward_given = true -- Tux received a reward for completing the quest "And there was light..."
255 hide("node11", "node12", "node13", "node14") show("node30")
256 pop_topic() -- "Kevin's Reward"
257 end,
258 },
259 {
260 id = "node20",
261 text = _"Jasmine just blew up.",
262 code = function()
263 Npc:says(_"Oh. Right.")
264 Npc:says(_"Well, thanks for telling me.")
265 Npc:says(_"Back to the drawing board, I guess...")
266 Kevin_sigtalk = true -- Tux spoke with Kevin about Jasmine blew up
267 hide("node20") show("node21")
268 end,
269 },
270 {
271 id = "node21",
272 text = _"I thought you would be more worried about her death.",
273 code = function()
274 --; TRANSLATORS: %s = a week day.
275 Npc:says(_"Why? I have backups from last %s. No reason to worry at all.",
276 get_random(_"Monday", _"Tuesday", _"Wednesday", _"Thursday", _"Friday", _"Saturday", _"Sunday"))
277 Npc:says(_"It will be a while till I get her together again, but she will be fine.")
278 hide("node21")
279 end,
280 },
281 {
282 id = "node30",
283 text = _"What can you teach me about hacking?",
284 code = function()
285 if (not Tux:done_quest("And there was light...")) then
286 if (not Tux:has_quest("And there was light...")) then
287 Npc:says(_"Not now, I'm busy.")
288 Npc:says(_"I've got an important research project going on. In fact this project might be crucial to the survival of the whole town.")
289 Npc:says(_"There is tremendous importance in it. But the project is in danger. There are some maintenance bots down at the energy source.")
290 Npc:says(_"They are trying to 'maintain' machines by rebooting them all the time. This must stop, but I can't leave this place.")
291 Npc:says(_"I must balance the remaining power in such a way that my project can continue uninterrupted.")
292 Npc:says(_"Now, if you go down there and make the power flow stable, then I'll find the time to teach you something.")
293 Tux:add_quest("And there was light...", _"Kevin has a problem with his energy supply. His bots keep rebooting the system, and he cannot conduct any experiments with an unstable power supply. My job is to stabilize the power. I think that implies removing the stupid bots.")
294 show("node6", "node7")
295 else
296 Npc:says(_"As I've told you, I cannot teach you anything right now. I don't have the time.")
297 Npc:says(_"I must see that the flaky energy stream is distributed in such a way that my research project can continue.")
298 Npc:says(_"If you get rid of the maintenance bots on the second underground level of this station, I will find the time to teach you something.")
299 end
300 else
301 if (Kevin_lessons_taught == Kevin_max_lessons) then
302 Npc:says(_"Sorry, there is no human alive that could give you further training.")
303 hide("node31")
304 else
305 Kevin_next_lesson_cost = 2 * (Kevin_lessons_taught + 1)
306 Npc:says(_"I can teach you everything, for a price of course.", "NO_WAIT")
307 Npc:says(_"Three hundred per lesson, up front.", "NO_WAIT")
308 --; TRANSLATORS: %d = number training points needed
309 Npc:says(_"You will need %d training points.", Kevin_next_lesson_cost)
310 Npc:says(_"Still interested?")
311 show("node31")
312 end
313 end
314 Kevin_hacking=true
315 hide("node30")
316 end,
317 },
318 {
319 id = "node31",
320 text = _"Yes, please teach me how to become a hacker.",
321 code = function()
322 if (Tux:train_program(300, Kevin_next_lesson_cost, "Hacking")) then
323 Kevin_lessons_taught = Kevin_lessons_taught + 1
324 Npc:says(_"Good. The most important thing about hacking is to understand the nature of the machine you want to hack.")
325 Npc:says(_"Once you have figured out what the creators of the system were thinking when setting it up, you'll also know how to best hack it.")
326 Npc:says(_"Now I see the feature set of your hacking program has already improved a lot.")
327 else
328 if (Tux:get_gold() < 300) then
329 next("node40")
330 else
331 next("node41")
332 end
333 end
334 hide("node31") show("node30")
335 end,
336 },
337 {
338 id = "node40",
339 code = function()
340 Tux:says_random(_"Hold on, I don't seem to have that much money right now.",
341 _"This is embarrassing. I will come back when I have the amount of valuable circuits you desire.")
342 Npc:says_random(_"Ok, come back when you can afford to pay me if you are interested.",
343 _"Please don't bother me if you can't pay me.",
344 _"You don't have enough money! I cannot afford to just give away training for free.",
345 _"Come back when you have enough circuits.",
346 _"So come back when you have some valuables.")
347 end,
348 },
349 {
350 id = "node41",
351 code = function()
352 Tux:says(_"Sorry, my memory data bank is filled to the brim right now. Can't learn more until I get some more experience.")
353 Npc:says_random(
354 _"You Linarians are funny creatures. Come back later when you feel ready if you please.",
355 _"I cannot teach you when you have no training points. Come back when you are more prepared.",
356 _"You are not ready. Go kill some bots and come back.",
357 _"Come back when you are mentally ready to learn.",
358 _"Come back after some more practice in the field.",
359 _"Waving those circuits in front of me when you are too unfocused to train won't help. I can take your money, but you won't learn anything.",
360 _"Yeah, I don't think you have enough experience for this. Come back here after you see some more action.",
361 _"Then come back when you have a real will to learn.",
362 _"You don't have enough experience. Come here after you see some more action.")
363 end,
364 },
365 {
366 id = "node60",
367 text = _"No, I didn't touch it.",
368 code = function()
369 Npc:says(_"Strange, I should have a look at it...") --Tux lied to him and will not directly get an account if he talks to it next time.
370 Npc:says(_"...when I have more time...")
371 Kevins_Lawnmower_tux_login = false
372 hide("node60", "node61")
373 end,
374 },
375 {
376 id = "node61",
377 text = _"Yes, I tried to login.",
378 code = function()
379 if (Tux:done_quest("And there was light...")) then
380 Npc:says(_"Please, don't touch it.")
381 Npc:says(_"I don't want you to break it somehow.")
382 Kevins_Lawnmower_tux_login_granted = true -- Tux has access to Kevin-Lawnmower
383 else
384 Npc:says(_"You better not touch it!")
385 Npc:says(_"If you break it somehow, I'll be very angry.")
386 Npc:says(_"And I still have no time.")
387 Npc:says(_"The power level is still very low, hence, I am quite busy.")
388 end
389 Kevins_Lawnmower_tux_login = false
390 hide("node60", "node61")
391 end,
392 },
393 {
394 id = "node90",
395 text = _"I came to warn you: droids broke through your wall!",
396 topic = "Backdoor",
397 code = function()
398 Npc:says(_"You could just go around and enter by the main door.")
399 Npc:says(_"This way, you might waste time. You've optimized your path. Good job!")
400 Npc:says(_"Thank you for your report, but I don't have time to fix it.")
401 next("node93")
402 end,
403 },
404 {
405 id = "node91",
406 text = _"My mission is top-secret. I must be stealthy.",
407 topic = "Backdoor",
408 code = function()
409 Npc:says(_"You are really careful with the security of your mission.")
410 Npc:says(_"However, don't destroy my equipment, I can support you to be stealthy.")
411 Npc:says(_"But later, maybe... I don't have time now.")
412 next("node93")
413 end,
414 },
415 {
416 id = "node92",
417 text = _"I saw an opening in the wall and I decided to take a look inside.",
418 topic = "Backdoor",
419 code = function()
420 Npc:says(_"Oh, you have just entered by curiosity. I always fought to make it an exception to the rules.")
421 Npc:says(_"I like curiosity. I think it's what rocketed us on Mars. And beyond...")
422 Npc:says(_"Thank you, I now know the issue, but I don't have time to fix it.")
423 next("node93")
424 end,
425 },
426 {
427 id = "node93",
428 topic = "Backdoor",
429 code = function()
430 -- open KevinGuard door
431 KevinGuard_door_open = true
432 change_obstacle_state("KevinsDoor", "opened")
433
434 Kevin_entering_from_back = false
435 pop_topic()
436 end,
437 },
438 {
439 id = "node99",
440 text = _"Let us talk later.",
441 code = function()
442 if (Kevin_talk_later == 10) then
443 Npc:says(_"Hey Linarian...")
444 Tux:says(_"Mmmh, yes?")
445 Npc:says(_"Do you know this feeling...")
446 Npc:says(_"... when you get a really strange output...")
447 Npc:says(_"... and you look at the code...")
448 Npc:says(_"... again and again...")
449 Npc:says(_"... but you see no path it could come from?")
450 Tux:says(_"Hmm, yes, I get this sometimes...")
451 Npc:says(_"I checked online if there is a name for this symptom... but couldn't find anything...")
452 Npc:says(_"I guess I am going to call it 'stdoubt'.")
453 Tux:says(_"Ok...")
454 Tux:says(_"...")
455 else
456 Npc:says_random(_"Be careful. The bots are in a foul mood today. Very easy to get killed. Very easy.",
457 _"If you need to contact me, my number is 127.0.0.1",
458 _"Keep your system up to date, Linarian.")
459 end
460 Kevin_talk_later = Kevin_talk_later + 1
461 end_dialog()
462 end,
463 },
464 }