Debian Codegraph @

data/storyline/act1/dialogs/Michelangelo.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 = { "Depressed", "Frustrated" },
21 MARKERS = { ITEMID1 = "Red Dilithium Crystal" },
22 PURPOSE = "$$NAME$$ directs Tux to where he can find $$ITEMID1$$s.",
23 BACKSTORY = "$$NAME$$ is frustrated by his inability to be a chef, as well as his current working conditions.",
24 WIKI]]--
25
26 local Npc = FDrpg.get_npc()
27 local Tux = FDrpg.get_tux()
28
29 return {
30 FirstTime = function()
31 Michelangelo_food_cooking_time = 0
32 show("node0")
33 end,
34
35 EveryTime = function()
36 hide("node29") -- the node will be re-shown later if we have enough crystals
37
38 if (Tux:has_quest("Anything but the army snacks, please!")) then
39 if (Tux:done_quest("Anything but the army snacks, please!")) then
40 show("node24") hide("node11")
41 if (Tux:has_quest("SADD's power supply")) then
42 if (Tux:done_quest("SADD's power supply")) then
43 hide("node75", "node76", "node77")
44 else
45 if (not Tux:has_item_backpack("Red Dilithium Crystal")) then show("node40", "node75") end
46 end
47 end
48 if (Tux:has_quest("Gapes Gluttony")) then
49 if (not Tux:done_quest("Gapes Gluttony")) then
50 show_if((not Michelangelo_been_asked_meal_to_go), "node21")
51 hide("node24")
52 elseif (Tux:has_item_backpack("Empty Picnic Basket")) then
53 show("node22")
54 end
55 end
56 else
57 local nb_crystals = Tux:count_item_backpack("Red Dilithium Crystal")
58 if (nb_crystals > 2) then
59 show("node29")
60 elseif (nb_crystals > 0) then
61 show("node30")
62 else
63 if (Michelangelo_been_asked_for_army_snacks) then
64 show("node26")
65 else
66 show("node12")
67 end
68 show("node31", "node32", "node40")
69 end
70 end
71 end
72 show("node99")
73 end,
74
75 {
76 id = "node0",
77 text = _"Hi! I'm new here.",
78 code = function()
79 Npc:says(_"Hello. I'm Michelangelo. I haven't been here for long either.")
80 Npc:says(_"I wish the bots had just killed me, but I got 'lucky' and ended up in this hellhole.")
81 Npc:set_name("Michelangelo - Chef")
82 hide("node0") show("node10", "node11")
83 end,
84 },
85 {
86 id = "node10",
87 text = _"How is it going?",
88 code = function()
89 Npc:says(_"Don't ask.")
90 Npc:says(_"'Terribly' would be a huge understatement.")
91 hide("node10") show("node18")
92 end,
93 },
94 {
95 id = "node11",
96 text = _"Can I buy some food here?",
97 code = function()
98 Npc:says(_"There is no food here, just the odious military rations.")
99 Npc:says(_"They are made fully out of artificial nutrients and carcinogenic flavors. Even the army hated them.")
100 Npc:says(_"It's better than starving, but some people have already committed suicide because that repulsive material is the only thing available to eat.")
101 Npc:says(_"I can give you some, but it's not worthy of being called food.")
102 if (Michelangelo_been_asked_for_army_snacks) then
103 show("node26")
104 else
105 show("node12")
106 end
107 hide("node11")
108 end,
109 },
110 {
111 id = "node12",
112 text = _"I want some yummy army snacks!",
113 code = function()
114 if (Tux:has_item("Fork", "Plate", "Mug")) then
115 if (Tux:has_item_equipped("Fork")) then
116 Npc:says(_"I am supposed to read this out to all newcomers. Here goes:")
117 Npc:says(_"'Please note that the army rations model #23 you are about to eat is provided 'as is' without warranty of any kind.")
118 Npc:says(_"That includes the implied warranty of edibility or fitness for a particular purpose. The entire risk as to the quality of the food is with you.")
119 Npc:says(_"Should the army meal model #23 prove poisonous, you agree to cover the cost of keeping you alive by the base medical staff or the costs of your cremation in our nuclear furnaces.'")
120 Npc:says(_"Well, that is all. Here is the junk that you wanted. Enjoy.")
121 Michelangelo_been_asked_for_army_snacks = true
122 next("node27")
123 hide("node12")
124 else
125 Npc:says(_"You need to equip your fork before you can use it to eat.")
126 end
127 else
128 Npc:says_random(_"You need to have a full mess kit with a Fork, Mug, and Plate before I can give you any army snacks.",
129 _"You need a Fork, Plate, and Mug before I can issue any army snacks.",
130 _"You need a full mess kit for army snacks.")
131 end
132 end,
133 },
134 {
135 id = "node18",
136 text = _"You do not sound happy. What is wrong?",
137 code = function()
138 if (guard_follow_tux) then
139 Npc:says(_"I am very happy! The Red Guard is making us so secure, it is great to live here with them taking care of us!")
140 else
141 Npc:says(_"EVERYTHING!")
142 Npc:says(_"Just look at this stupid town!")
143 Npc:says(_"We are constantly pushed around by our 'saviors' the rotten Red Guard. I hope they all die from rat bites as soon as possible and go to the deepest hells to boil in lava forever.")
144 Npc:says(_"And the bots are keeping us busy by murdering, chopping, slicing, cleaving, rending and wounding us. How wonderful.")
145 Npc:says(_"The guards gave me a filthy hovel to live in. The walls are so thin that every night I am rocked to sleep by the bots communicating with those beeps and modem sounds.")
146 Npc:says(_"It sounds like they are singing something. Every night they start their song... I cannot sleep thanks to that electric chorus.")
147 Npc:says(_"Have I mentioned that the only food that we have is some kind of pestilential military ration? The smell alone is making me want to vomit.")
148 hide("node18") show("node19", "node20")
149 end
150 end,
151 },
152 {
153 id = "node19",
154 text = _"Cheer up! All will be fine! Happy days are coming! Hurray!",
155 code = function()
156 Npc:says(_"...")
157 Npc:says(_"Linarian, have you been gorging on psychoactive pills or something?")
158 Npc:says(_"Get a grip, the situation is bad and there is no use in pretending otherwise.")
159 hide("node19")
160 end,
161 },
162 {
163 id = "node20",
164 text = _"You are a cook. Stop complaining about the poor food! Make some yourself.",
165 code = function()
166 Npc:says(_"I cannot! My beautiful macrowave oven is out of power. The wretched Red Guard took away my uranium battery.")
167 Npc:says(_"I wish I could kill them all with my bare hands. They deserve it.")
168 Npc:says(_"If only I had some dilithium to use as a backup power source...")
169 hide("node20") show("node40", "node41", "node42", "node70", "node80")
170 end,
171 },
172 {
173 id = "node21",
174 text = _"Can I get a meal to go?",
175 code = function()
176 Tux:says(_"I've found a man who has nothing left to eat but army snacks. He has information for me, but I've got to feed him first.")
177 Npc:says(_"I see. We do not have much to spare, but I will see what I can do. I will let you borrow my picnic basket, but I must have it back.")
178 Npc:says(_"Here... This meal should satisfy his hunger. I even added a dessert.")
179 Tux:update_quest("Gapes Gluttony", _"Michelangelo gave me a healthy meal with dessert for Will Gapes. I have to remember to return the basket!")
180 Tux:says(_"Thank you. I'm sure it will be delicious.")
181 Tux:add_item("Lunch in a Picnic Basket")
182 Michelangelo_been_asked_meal_to_go = true
183 hide("node21")
184 end,
185 },
186 {
187 id = "node22",
188 text = _"I've brought your Picnic Basket back.",
189 code = function()
190 Npc:says(_"Oh, thank you. Hopefully, the meal hit the spot.")
191 Tux:says(_"Yes, he enjoyed it, and I got my information.")
192 Npc:says(_"Excellent! Now, perhaps these antibiotics will help you on your mission.")
193 Tux:del_item_backpack("Empty Picnic Basket")
194 Tux:add_item("Antibiotic", 3)
195 hide("node22")
196 end,
197 },
198 {
199 id = "node24",
200 text = _"Got any food yet?",
201 code = function()
202 -- The cooking of food take 5 in-game minute.
203 if (game_time() - Michelangelo_food_cooking_time < 300) then
204 Npc:says(_"I'm confused, nothing of my upper gastronomy is ready to eat. Not one cheese cake.")
205 Npc:says(_"But don't despair, Michelangelo is slaving over his stove. A army of bots could not stop the Master when he's cooking.")
206 Npc:says(_"Until my next batch of food comes out of the macrowave oven, all I have are the odoriferous military rations.")
207 if (Michelangelo_been_asked_for_army_snacks) then
208 show("node26")
209 else
210 show("node12")
211 end
212 else
213 if (not Michelangelo_food_dish) then
214 Michelangelo_food_dish = math.random()
215 end
216 if (Michelangelo_food_dish > 0.9) then
217 Npc:says(_"Here, try this slice of lemon meringue pie.")
218 if (not Tux:has_item("Fork")) then
219 Npc:says(_"Wait, you don't have a fork. You need a fork...")
220 elseif (not Tux:has_item_equipped("Fork")) then
221 Npc:says(_"You need to equip your fork before you can use it to eat.")
222 else
223 Tux:says(_"It is as if a cloud from heaven was made into a pie.")
224 Tux:hurt(-20)
225 Michelangelo_food_dish = false
226 Michelangelo_food_cooking_time = game_time() -- wait before you can eat.
227 end
228 elseif (Michelangelo_food_dish > 0.8) then
229 Npc:says(_"Try this crab cake.")
230 if (not Tux:has_item("Fork")) and
231 (not Tux:has_item_backpack("Plate")) then
232 Npc:says(_"Where is your plate and fork?")
233 elseif (not Tux:has_item_equipped("Fork")) then
234 Npc:says(_"You need to equip your fork before you can use it to eat.")
235 else
236 Tux:says(_"Such an intense, delectable, blend of savory spices... it melts in my mouth.")
237 Tux:hurt(-40) -- cholesterol not included ;-)
238 Michelangelo_food_dish = false
239 Michelangelo_food_cooking_time = game_time() -- wait before you can eat.
240 end
241 elseif (Michelangelo_food_dish > 0.6) then
242 Npc:says(_"May I interest you in some eggs sardou?")
243 Tux:says(_"EGGS!?")
244 Npc:says(_"Oh, Michelangelo had forgotten...")
245 Npc:says(_"How about a... yummy army snack instead?")
246 Michelangelo_food_dish = false
247 Michelangelo_food_cooking_time = game_time() -- wait before you can eat.
248 if (Michelangelo_been_asked_for_army_snacks) then
249 show("node26")
250 else
251 show("node12")
252 end
253 elseif (Michelangelo_food_dish > 0.4) then
254 Npc:says(_"I am in the midst of a culinary masterpiece.")
255 Npc:says(_"I cannot rush art for I am an artist!")
256 Michelangelo_food_dish = false
257 else
258 Npc:says(_"I had prepared some delicacies, but the ravenous Red Guard ate it all.")
259 Npc:says(_"Not a big loss, I have a second batch of food cubes in the oven and they will be ready shortly.")
260 Npc:says(_"I think the mood in the town will improve once the cooking master Michelangelo gets to work. Ha!")
261 Npc:says(_"But if you are really hungry, I still have some of those disgusting army snacks.")
262 Michelangelo_food_dish = false
263 Michelangelo_food_cooking_time = game_time() -- wait before you can eat.
264 if (Michelangelo_been_asked_for_army_snacks) then
265 show("node26")
266 else
267 show("node12")
268 end
269 end
270 end
271 hide("node24")
272 end,
273 },
274 {
275 id = "node26",
276 text = _"I am racked with hunger pains, give me some army snacks!",
277 code = function()
278 Npc:says(_"I thought you would have learned by now.")
279 Npc:says(_"As you wish.")
280 hide("node26") next("node27")
281 end,
282 },
283 {
284 id = "node27",
285 text = _"Hmm... Crunchy... That is... Oh... No. Ugh. Help.",
286 code = function()
287 Npc:says(_"Oh yes. You were warned, so don't blame me.")
288 Tux:says(_"Bleah! That is not food!")
289 Npc:says(_"We already know that. There is nothing else to eat here, so I hope you get used to the taste.")
290 Npc:says(_"That thing only looks okay, and has a nice color.")
291 Npc:says(_"But as you can see, the color cannot be eaten, only the taste counts.")
292 end,
293 },
294 {
295 id = "node29",
296 text = _"I have the dilithium you wanted.",
297 code = function()
298 Npc:says(_"Really? I thought you were dead, but not only did you come back alive, you also brought some power crystals for my trusty oven.")
299 Npc:says(_"I will start cooking at once.")
300 Npc:says(_"Thank you, Linarian. As soon as the food cubes are ready I will be able to give them away to the hungry people.")
301 display_big_message(_"Restored Michelangelo's power supply")
302 Tux:add_xp(350)
303 Tux:del_item_backpack("Red Dilithium Crystal", 3)
304 Tux:end_quest("Anything but the army snacks, please!", _"I gave the cook, Michelangelo, enough dilithium to last a decade. The evil spectre of eating army snacks is lifted from the town's cantina.")
305 Michelangelo_food_cooking_time = game_time() -- wait before you can eat.
306 hide("node29", "node31", "node32", "node40")
307 end,
308 },
309 {
310 id = "node30",
311 text = _"I have the dilithium you wanted.",
312 code = function()
313 Npc:says(_"Really? I thought you were dead, but not only did you come back alive, you also brought some power crystals for my trusty oven.")
314 Npc:says(_"However, I need at least three crystals. Can you come back with all the crystals I need?")
315 hide("node30")
316 end,
317 },
318 {
319 id = "node31",
320 text = _"What was I supposed to do again?",
321 code = function()
322 Npc:says(_"Get me three dilithium crystals before the whole stupid town commits mass suicide because of poor food quality.")
323 Npc:says(_"Of course our heinous food might do us in far before that. I swear I saw that stuff glow it the dark and try to sneak away from my plate a few times.")
324 hide("node31")
325 end,
326 },
327 {
328 id = "node32",
329 text = _"Where can I find dilithium crystals?",
330 code = function()
331 Npc:says(_"There is an old abandoned dilithium mine is to the east of the town.")
332 Npc:says(_"Be careful if you go down there!")
333 hide("node32")
334 end,
335 },
336 {
337 id = "node40",
338 text = _"What is this 'dilithium'?",
339 code = function()
340 Npc:says(_"You do not know? I thought Linarians were unmatched in their knowledge of the universe. Anyway...")
341 Npc:says(_"Dilithium is a substance which is usually seen in the form of a small crystal.")
342 Npc:says(_"It somehow generates and stores amazing amounts of electricity. I do not know the details. I'm a cook, not a quantum scientist.")
343 hide("node40")
344 end,
345 },
346 {
347 id = "node41",
348 text = _"I have an idea. Use fire to cook the food for the town.",
349 code = function()
350 Npc:says(_"A nice idea, but there is a couple of major problems with it.")
351 Npc:says(_"We are a town of 450 hungry people. It would need to be a very big fire to supply heat for all of the meals.")
352 Npc:says(_"There is nothing to burn inside the town. If you want you can go and try to chop some trees in the region to the north, but odds are the bots will chop you down before you get a chance to swing the hatchet once.")
353 Npc:says(_"Finally, the meal cubes which we have in the freezer are optimized for macrowaves. If we stick them in a fire they will combust and not cook.")
354 Npc:says(_"No oven means having to use premacrowaved food.")
355 Npc:says(_"And the only such thing around is that abhorrent military sludge.")
356 hide("node41")
357 end,
358 },
359 {
360 id = "node42",
361 text = _"Tell the Red Guard that you need your battery back.",
362 code = function()
363 if (tux_has_joined_guard) then
364 Npc:says(_"Well, you ARE a Red Guard", "NO_WAIT")
365 Npc:says(_"Why can't you just talk to Spencer?")
366 Npc:says(_"I want my battery back!")
367 Tux:says(_"Umm... I guess you have a point there.")
368 Tux:says(_"But sorry, I don't think there is anything I can do right now,", "NO_WAIT")
369 Tux:says(_"Talk to Spencer yourself.")
370 else
371 Npc:says(_"I did.")
372 Npc:says(_"They said it was already fed to their reactor as fuel.")
373 end
374 hide("node42")
375 end,
376 },
377 {
378 id = "node70",
379 text = _"Why don't you send someone for the dilithium?",
380 code = function()
381 Npc:says(_"I did.")
382 Npc:says(_"Yesterday a guard patrol found a few tiny bits of him and lots of dried blood.")
383 Npc:says(_"The bots made a bloody mess out of him.")
384 hide("node70")
385 end,
386 },
387 {
388 id = "node75",
389 text = _"I need a dilithium crystal.",
390 code = function()
391 Npc:says(_"I am already using the ones you got me. They are being used to feed the town.")
392 if (Michelangelo_been_asked_for_spare_dilithium) then
393 show("node76")
394 else
395 show("node77")
396 end
397 hide("node75") show("node32")
398 end,
399 },
400 {
401 id = "node76",
402 text = _"I need one of the dilithium crystals back, it is a matter of life or death!",
403 code = function()
404 Npc:says(_"I gave you all of the crystals I can spare.")
405 hide("node76")
406 end,
407 },
408 {
409 id = "node77",
410 text = _"I need one of the dilithium crystals back, it is a matter of life or death!",
411 code = function()
412 Npc:says(_"I guess I can spare one of them, since it is an emergency.")
413 Michelangelo_been_asked_for_spare_dilithium = true
414 Tux:add_item("Red Dilithium Crystal", 1)
415 Tux:update_quest("SADD's power supply", _"I remembered that I gave Michelangelo three dilithium crystals when he only needed two for his oven. I convinced him it was a life-or-death situation (is the SADD a life-form?) so he returned the spare one to me. Looks like I saved myself a trip back to the old dilithium mine!")
416 hide("node77")
417 end,
418 },
419 {
420 id = "node80",
421 text = _"Maybe I can get you some dilithium.",
422 code = function()
423 Npc:says(_"Have you gotten overheated, Linarian?")
424 Npc:says(_"Look, there are dozens of ways you can kill yourself, and most hurt less than being killed by a bot.")
425 Npc:says(_"If you want to die just walk into a nuclear reactor or something. So much simpler.")
426 hide("node80") show("node81")
427 end,
428 },
429 {
430 id = "node81",
431 text = _"Don't worry, I'll be fine.",
432 code = function()
433 Npc:says(_"Do you know how the bots act? Some want to kill you as soon as possible... Others want to do the same, but slowly.")
434 Npc:says(_"I have seen corpses with nearly all of the fingers ripped off. People with eyes drilled out by some big tool.")
435 Npc:says(_"I have smelled burnt meat and heard the screams of the captives as they were incinerated alive outside the town walls.")
436 Npc:says(_"The bots know no mercy. They cannot even define it, infernal scrap metal fiends.")
437 Npc:says(_"Feel free to go, Linarian, but make sure to be very dead before they start killing you.")
438 Tux:says(_"Where can I get the crystals?")
439 Npc:says(_"There is an old dilithium mine to the east. I am sure there is lots of that stuff there.")
440 Npc:says(_"I will talk to the guards, they will open the eastern gate for you.")
441 Npc:says(_"Good luck. Try not to get yourself killed.")
442 Tux:says(_"How many dilithium crystals do you need?")
443 Npc:says(_"A single small crystal could power my oven for a decade if it is of good quality. But unfortunately my oven requires two to operate correctly. And since it is so dangerous to send anyone to get dilithium, could you get me a spare as well?")
444 Tux:says(_"So you need three dilithium crystals?")
445 Npc:says(_"Yes. Please get me three dilithium crystals.")
446 change_obstacle_state("EastGateOfTown", "opened")
447 Tux:add_quest("Anything but the army snacks, please!", _"I am supposed to get three dilithium crystals for that cook, Michelangelo. Without them he cannot cook anything in his macrowave oven. And without his cooking, the whole town is stuck eating army snacks. Many people have committed suicide because of the horrible food. This madness must stop.")
448 hide("node19", "node40", "node41", "node42", "node70", "node81")
449 end,
450 },
451 {
452 id = "node99",
453 text = _"I'll be going then.",
454 code = function()
455 Npc:says(_"See you later.")
456 end_dialog()
457 end,
458 },
459 }