Debian Codegraph @

data/storyline/act1/dialogs/Tamara.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 = { "Intelligent", "Timid" },
21 MARKERS = { NPCID1 = "Sorenson", QUESTID1 = "An Explosive Situation" },
22 PURPOSE = "$$NAME$$ can sell Tux programs books. Her skills are needed to aid Tux in resolving the $$QUESTID1$$ quest.",
23 BACKSTORY = "$$NAME$$ is the town\'s librarian, which she use to run with $$NPCID1$$ until their falling out. $$NAME$$ also documents bot history in her spare time.",
24 RELATIONSHIP = {
25 {
26 actor = "$$NPCID1$$",
27 text = "$$NAME$$ and $$NPCID1$$ are half-sisters who have not talked to each other since $$NAME$$ locked $$NPCID1$$
28 in her bedroom for staring into computer screens too much."
29 },
30 }
31 WIKI]]--
32
33 local Npc = FDrpg.get_npc()
34 local Tux = FDrpg.get_tux()
35
36 return {
37 FirstTime = function()
38 -- Initialization
39 Tamara_about_bots_nodes = 0
40
41 --; TRANSLATORS: %s =Tux:get_player_name()
42 Tux:says(_"Hi, I'm %s.", Tux:get_player_name())
43 Npc:says(_"Welcome to the Library, I'm Tamara.")
44 Npc:says(_"Please take a look around and see if there is something here that interests you.")
45 Npc:says(_"You are welcome to ask me if you have any questions.")
46 Npc:set_name("Tamara - Librarian")
47 show("node10")
48 end,
49
50 EveryTime = function()
51 if (Tamara_restock) then
52 Npc:says(_"I was looking at the depot and found some interesting books. You might want to take a look at them later.")
53 Tamara_restock=false
54 end
55
56 if (tamara_shelf_count == 1) and
57 (not tamara_shelf_count_1_done) then
58 Npc:says(_"Hey, please don't make such a mess here.")
59 tamara_shelf_count_1_done = true
60 elseif (tamara_shelf_count == 2) and
61 (not tamara_shelf_count_2_done) then
62 Npc:says(_"Please put everything back in place if you don't need it.")
63 tamara_shelf_count_2_done = true
64 elseif (tamara_shelf_count == 3) and
65 (not tamara_shelf_count_3_done) then
66 Npc:says(_"Please be careful with these books. They are older than most computers in this town.")
67 tamara_shelf_count_3_done = true
68 tamara_shelf_stuff = "done"
69 elseif (tamara_shelf_count) and
70 (tamara_shelf_count > 3) then
71 Npc:says("ERROR: Tamara.dialog, EveryTime LuaCode: unhandled value for tamara_shelf_count, please report. value is: %s", tamara_shelf_count)
72 end
73
74 if (Tux:has_met("Tamara")) then
75 Npc:says(_"What can I help you with?")
76 end
77
78 if (Tux:has_met("Sorenson")) and
79 (not Tamara_talked_about_sister) then
80 show("node1")
81 end
82
83 show_if(((not won_nethack) and
84 (not Tamara_asked_hacking)), "node2")
85
86 show_if(Tamara_bot_apocalypse_book, "node21")
87
88 if (Ewalds_296_needs_sourcebook) and
89 (not Tamara_have_296_book) then
90 show("node50")
91 end
92
93 -- function to hide node in the topic Tamara_about_bot_nodes
94 function hide_node_about_bots(node)
95 Tamara_about_bots_nodes = Tamara_about_bots_nodes - 1
96 hide("node" .. node)
97 if (Tamara_about_bots_nodes <= 0) then
98 pop_topic()
99 end
100 end
101
102 if (Kevin_sigtalk) and
103 (not tamara_robotic_girlfriends_node) then
104 Tamara_about_bots_nodes = Tamara_about_bots_nodes + 1
105 tamara_robotic_girlfriends_node = true;
106 show("node34")
107 end
108
109 if (tux_has_joined_guard) and
110 (not tamara_robot_class_node) then
111 Tamara_about_bots_nodes = Tamara_about_bots_nodes + 1
112 tamara_robot_class_node = true;
113 Npc:says(_"By the way, someone just returned a book about 'Advanced Robot Classes', tell me if you're interested.")
114 show("node35")
115 end
116
117 show_if(Tamara_talked_about_bots and
118 (Tamara_about_bots_nodes > 0), "node31")
119
120 show("node99")
121
122 show_if((HF_FirmwareUpdateServer_uploaded_faulty_firmware_update and
123 not Tamara_post_firmware_update), "Tamara_post_firmware_update_1")
124 end,
125
126 {
127 id = "node1",
128 text = _"Hmm, you look very similar to another person I met, by the name of Sorenson.",
129 code = function()
130 Npc:says(_"Well, it's understandable. We are sisters.")
131 Npc:says(_"Or actually half sisters. She is also half crazy, so we don't communicate much.")
132 Npc:says(_"*sigh*")
133 Npc:says(_"We used to. Even ran this library together.")
134 Npc:says(_"Then she started reading more and more books and sitting in front of the computer day and night, never sleeping.")
135 Npc:says(_"In the end she completely lost her marbles, sadly.")
136 Npc:says(_"Now all she does is sitting locked in her house staring into the computer.")
137 Tamara_talked_about_sister = true
138 hide("node1")
139 end,
140 },
141 {
142 id = "node2",
143 text = _"I would like to learn how to hack.",
144 code = function()
145 Tamara_asked_hacking = true
146 if (Tamara_talked_about_sister) then
147 Npc:says(_"My sister used to play Nethack all the time, about the time she became really good at hacking.")
148 else
149 Npc:says(_"Everyone I know who is good with computers always talks about beating Nethack.")
150 end
151 Npc:says(_"I think there might be a version on the town's computers.")
152 Npc:says(_"I've never played it.")
153 Npc:says(_"That might be why I'm no good with computers.")
154 hide("node2")
155 end,
156 },
157 {
158 id = "node10",
159 text = _"I see you have a huge source code book collection. Mind if I buy some from you?",
160 code = function()
161 Npc:says(_"This is a library, not a book shop.")
162 Npc:says(_"However, valuable books have a tendency to simply vanish and never get returned by some people...")
163 Npc:says(_"Especially strangers just passing by...")
164 Npc:says(_"Thus, I'm forced to take a deposit for each book.")
165 hide("node10") show("node11")
166 end,
167 },
168 {
169 id = "node11",
170 text = _"So what interesting books do you have available right now?",
171 code = function()
172 Npc:says_random(_"Some of these might interest you.",
173 _"I only have a few programming volumes, feel free to look through them.")
174 trade_with("Tamara")
175 show_if(not Tamara_bot_apocalypse_book, "node20")
176 show_if(not Tamara_talked_about_bots, "node30")
177 end,
178 },
179 {
180 id = "node20",
181 text = _"Do you have any books about the bot apocalypse?",
182 code = function()
183 Npc:says(_"I'm writing one, but it isn't complete, and there are no publishers left.")
184 Tamara_bot_apocalypse_book = true
185 hide("node20")
186 end,
187 },
188 {
189 id = "node21",
190 text = _"Have you been progressing on your book about the bot apocalypse?",
191 code = function()
192 Npc:says_random(_"I need more time to finish it.",
193 _"Page-by-page, my book is growing up.",
194 _"Sorry, but you have to wait a bit more before you can read it.")
195 hide("node21")
196 end,
197 },
198 {
199 id = "node30",
200 text = _"Do you have any books about robotics?",
201 code = function()
202 Npc:says(_"Sorry, most of them have been stolen or borrowed.")
203 Npc:says(_"However, I can tell you all about robots and automata in literature. Interested?")
204 Tamara_talked_about_bots = true
205 Tamara_about_bots_nodes = Tamara_about_bots_nodes + 2
206 hide("node30") show("node32", "node33", "node39")
207 push_topic("About bots")
208 end,
209 },
210 {
211 id = "node31",
212 text = _"I would like to know some more about bots.",
213 code = function()
214 Npc:says(_"If you mean in culture, I have some anecdote you could be interested in.")
215 push_topic("About bots")
216 end,
217 },
218 {
219 id = "node32",
220 text = _"Where does the word 'bot' come from?",
221 topic = "About bots",
222 code = function()
223 Npc:says(_"It is a shortening of the word 'robot', derived from the Czech word for forced labor.")
224 Npc:says(_"R.U.R. (Rossum's Universal Robots), a theatrical play, introduced 'robots' as artificial people.")
225 Npc:says(_"In the play the robots revolted, took over the world, and killed all the humans.")
226 Tux:says(_"Ironic.")
227 hide_node_about_bots(32)
228 end,
229 },
230 {
231 id = "node33",
232 text = _"What about the creation of robots for defense?",
233 topic = "About bots",
234 code = function()
235 Npc:says(_"During the Holy Roman Empire, the Jewish people of the Prague ghetto needed protection.")
236 Npc:says(_"So a holy rabbi shaped a Golem out of clay, and brought it to life through rituals and writing 'emet' (truth) on its head.")
237 Npc:says(_"The Golem initially protected the Jews, but was brainless and stupid, and thus soon became dangerously violent to the Jews also.")
238 Npc:says(_"It was only by trickery that the rabbi was able to even get close to the Golem.")
239 Npc:says(_"But as the rabbi changed 'emet' to 'met' (death), the Golem fell on him, and both the creator and creation became lifeless.")
240 hide_node_about_bots(33)
241 end,
242 },
243 {
244 id = "node34",
245 text = _"What can you tell me about robotic girlfriends?",
246 topic = "About bots",
247 code = function()
248 Npc:says(_"Well, the Greeks wrote down a story about Pygmalion, the sculptor of Cyprus.")
249 Npc:says(_"Pygmalion carved an ivory woman of far surpassing natural beauty and fell in love.")
250 Npc:says(_"Aphrodite, the goddess of love, brought the ivory woman to life.")
251 Npc:says(_"The woman, Galatea, likewise fell in love and married her creator Pygmalion.")
252 Npc:says(_"So you could say that this is one of the few stories that end well.")
253 hide_node_about_bots(34)
254 end,
255 },
256 {
257 id = "node35",
258 text = _"Earlier you've said that there was a book about Advanced Robot Classes.",
259 topic = "About bots",
260 code = function()
261 Npc:says(_"Yes. Here, I'll show it to you.")
262 Npc:says(_"[b]Advanced Robot Classes - A quick guide introducing the most dangerous robots on our world.[/b]")
263 Npc:says(_"[b]Battle Droids - Droids from the class 700s are Battle Droids. They are designed for war, so they're pretty much killing machines. If you find a droid of the 700s class, it's advised to run.[/b]")
264 Npc:says(_"[b]Security Droids - Droids from the class 800s are meant to seek intruders and exterminate them. Most are fast and very dangerous, with the notable exception of the 883 model, which is designed to hold position and is even more dangerous. If you find a droid of the 800s class, it's advised to run.[/b]")
265 Npc:says(_"[b]Command Droids - Droids from the class 900s were designed to control droids, ships, stations, and a lot more. Being experimental, they usually are heavily armored, fast, and powerful. Most are equipped with top-notch sensors to see even invisible things. If you find a droid of the 900s class, it's advised to survive. Which is unlikely.[/b]")
266 Tux:says(_"Great. Why I have the feeling that I'll be meeting these droids soon enough?")
267 hide_node_about_bots(35)
268 end,
269 },
270 {
271 id = "node39",
272 text = _"Can I come back to you on that later?",
273 topic = "About bots",
274 code = function()
275 Npc:says(_"Don't hesitate to talk to me again for further questions.")
276 pop_topic()
277 end,
278 },
279 {
280 id = "Tamara_post_firmware_update_1",
281 text = _"Have you heard about the news?",
282 code = function()
283 Npc:says(_"Oh? What news?")
284 Tux:says(_"The world is saved! The apocalypse is over!")
285 Npc:says(_"Oh, yes... This news. I agree, it's wonderful.")
286 hide("Tamara_post_firmware_update_1")
287 show("Tamara_post_firmware_update_2")
288 Tamara_post_firmware_update = true
289 end,
290 },
291 {
292 id = "Tamara_post_firmware_update_2",
293 text = _"You don't seem very excited.",
294 code = function()
295 Npc:says(_"I am glad, although... Well, it's not like the library was ever in any immediate danger.")
296 Tux:says(_"What? Did you want it to be?")
297 Npc:says(_"No - it's hard to explain. I suppose I had this certain... Idea that it was my job to keep the books safe during the apocalypse. To defend them.")
298 Npc:says(_"It was my little fortress made of electronic paper, that I had to grow and protect from any threats. To save human knowledge.")
299 hide("Tamara_post_firmware_update_2")
300 show("Tamara_post_firmware_update_3")
301 end,
302 },
303 {
304 id = "Tamara_post_firmware_update_3",
305 text = _"But what about all the people that died? They weren't made of E-paper!",
306 code = function()
307 Npc:says(_"I know! Please, don't misunderstand, I think it's fantastic that the Assault is over!")
308 Npc:says(_"I just... Well, I guess I wanted a bigger piece of the action, in my own way.")
309 Npc:says(_"I'll... Go and arrange some books now...")
310 if (tamara_shelf_count) then
311 Npc:says(_"It's rather hard to keep the library in good shape lately. Someone's been ransacking the southern sections. Times like these can bring out the worst in us.")
312 Npc:says(_"But I guess cleaning work is also part of preserving culture.")
313 end
314 hide("Tamara_post_firmware_update_3")
315 show("Tamara_post_firmware_update_interview", "Tamara_post_firmware_update_burn")
316 end,
317 },
318 {
319 id = "Tamara_post_firmware_update_burn",
320 text = _"You know, I can start a fire here if you want me to.",
321 code = function()
322 Npc:says(_"What? No! Absolutely not!")
323 Npc:says(_"Why in the world would I want you to do that?!")
324 Tux:says(_"Because that would put the books in immediate danger, and then you can rush in and save them!")
325 Npc:says(_"That - that's insane!")
326 Npc:says(_"You are a danger to this establishment. Get out of here!")
327 Tux:says(_"You are a very confusing person.")
328 if (Tamara_talked_about_sister) then
329 Tux:says(_"I guess it runs in the family...")
330 end
331 end_dialog()
332 hide("Tamara_post_firmware_update_burn", "Tamara_post_firmware_update_interview")
333 end,
334 },
335 {
336 id = "Tamara_post_firmware_update_interview",
337 text = _"Well, you didn't get to fend off a hoard of bots. But you can interview me personally!",
338 code = function()
339 Npc:says(_"Really? You'd let me interview you?")
340 if (Tamara_bot_apocalypse_book) then
341 --; TRANSLATORS: it = the interview
342 Tux:says(_"Sure! You can put it in the book you're writing.")
343 else
344 Tux:says(_"Sure!")
345 end
346 Npc:says(_"Thank you! This is a wonderful opportunity! I have a first-hand account from a central actor in the biggest event in human history!")
347 Npc:says(_"We must set a time for an interview. And I must read everything in the library about interviewing!")
348 Npc:says(_"There's a lot of ground to cover, but i can already imagine the descriptions - you, in the center of the robot apocalypse...")
349 Npc:says(_"Just like in those old fairy tales they used to tell children, about the brave dashing knight storming alone into a castle to save the princess.")
350 Npc:says(_"With some mild adjustments.")
351 Npc:says(_"I mean, no one in those stories had flippers.")
352 Tux:says(_"That sounds like discrimination.")
353 Npc:says(_"Yes, they don't tell those stories to children anymore. Too much adult content. The effect on the young psyche was poorly studied.") -- might open the subject of Linarian folk tales?
354 hide("Tamara_post_firmware_update_interview", "Tamara_post_firmware_update_burn")
355 end,
356 },
357 {
358 id = "node50",
359 text = _"Do you have a copy of Subatomic and Nuclear Science for Dummies, Volume IV?",
360 code = function()
361 Npc:says(_"It's interesting you should be looking for that - the library has two copies.")
362 Tux:says(_"I need one - it's a matter of life and death!")
363 Npc:says(_"Life and death?")
364 Tux:says(_"There's a nuclear reactor going super critical under the town - if I have the book, maybe I can stop it.")
365 Npc:says(_"In that case, you can have it. My mission is to preserve our culture, which won't matter if we're all dead.")
366 Tux:says(_"Thank you, Tamara.")
367 Tux:update_quest("An Explosive Situation", _"I was able to get a copy of Subatomic and Nuclear Science for Dummies, Volume IV from the librarian, Tamara. I'd better hurry back to Ewald's 296 with it.")
368 Tux:add_item("Nuclear Science for Dummies IV")
369 Tamara_have_296_book = true
370 hide("node50")
371 end_dialog()
372 end,
373 },
374 {
375 id = "node99",
376 text = _"Thank you for the help.",
377 code = function()
378 Npc:says_random(_"No problem, and remember to return your books in time.",
379 _"I aim to ensure that the great works of literature will survive this horrible apocalypse.",
380 _"That is what I'm here for. Come back at any time.")
381 end_dialog()
382 end,
383 },
384 }