Debian Codegraph @

data/storyline/act1/dialogs/CerebrumPortalGuardian.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 = { "Robotic" },
21 BACKSTORY = "$$NAME$$ is part of the Special Area across bridge on level 42. Asks for some addons in exchange of more useful ones and some experience. Is a highly advanced bot developed my MegaSys, however it does not possess an AI so advanced like Dvorak or Singularity. It's intentions are unknown even to the developers. It seems to be working with the Red Guard, believing that they'll protect it's back. In exchange, it protects theirs. It's also suspect of murdering the previous scouts sent by Spencer. In additional notice, it was activated by something or someone after the Great Assault. Jim, Dvorak, and even Agent Zero are suspect of doing so, but nothing confirmed."
22 WIKI]]--
23
24 local Npc = FDrpg.get_npc()
25 local Tux = FDrpg.get_tux()
26
27 return {
28 FirstTime = function()
29 Npc:says(_"Intruder detected!! Identifying unknown object...")
30 Npc:says(_"...")
31 Npc:says(_"...")
32 Npc:says(_"Object identification failed. Attack!")
33 play_sound("effects/Influencer_Scream_Sound_0.ogg")
34 Tux:says(_"Hey! That hurts...")
35 Npc:says(_"Intruder responds... Analysing... Intruder is a life form. Aborting attack.")
36 Npc:says(_"Excuse me for attacking you.")
37 Tux:says(_"Why did you attack me?")
38 Npc:says(_"[b]ORDER #4[/b]: If intruder can not be identified, it must be terminated.")
39 Npc:says(_"Sorry, it was my fault, duck.")
40 Npc:says(_"Can I somehow help you?")
41 Tux:says(_"No, ugh... I am still alive, don't worry...")
42 Npc:says(_"Good to hear that.")
43 Npc:says(_"My identification is... [b]NO ID FOUND[/b]... Just call me Cerebrum. And who are you?")
44 Npc:set_name(_"Cerebrum - Portal Guardian")
45 --; TRANSLATORS: %s = Tux:get_player_name()
46 Tux:says(_"My name is %s.", Tux:get_player_name())
47 --; TRANSLATORS: %s = Tux:get_player_name()
48 Npc:says(_"Hello %s!", Tux:get_player_name())
49 show("node0", "node1", "node3", "node5", "node6")
50 Npc:set_rush_tux(false)
51 end,
52
53 EveryTime = function()
54 if (Tux:has_met("CerebrumPortalGuardian")) then
55 Tux:says_random(_"Hello, sentient bot!",
56 _"Hi!",
57 _"Hi Cerebrum!")
58 Npc:says_random(_"Welcome back.",
59 _"Hostile droids didn't kill you? That's good. Hi then!",
60 _"Hello duck!")
61 show("node3")
62 end
63 if ((Tux:has_quest("Bot in need")) and
64 (not Tux:done_quest("Bot in need")) and
65 (Tux:has_item_backpack("Tinfoil patch")) and
66 (Tux:has_item_backpack("Laser sight")) and
67 (Tux:has_item_backpack("Peltier element"))) then
68 show("node4")
69 else
70 hide("node4")
71 end
72 show("node99")
73 end,
74
75 {
76 id = "node0",
77 text = _"Why did you call me a duck?",
78 echo_text = false,
79 code = function()
80 Tux:says(_"Why did you call me a duck? I'm not a duck! I'm a Linarian!")
81 Npc:says(_"I know. But calling you a duck is funny!")
82 hide("node0")
83 end,
84 },
85
86 {
87 id = "node1",
88 text = _"What are you doing here?",
89 code = function()
90 Npc:says(_"[b]PRIMARY OBJECTIVES[/b]:", "NO_WAIT")
91 Npc:says(_"1) Guard the portal;", "NO_WAIT")
92 Npc:says(_"2) Adapt computers' software according to the current situation;", "NO_WAIT")
93 Npc:says(_"3) Prevent reactor's state from going critical.")
94 Tux:says(_"Do you mean this big reactor?")
95 Npc:says(_"And do you see any other reactors nearby?")
96 Tux:says(_"Um... *looks around* No. And is it stable?")
97 if (not Tux:done_quest("Bot in need")) then
98 Npc:says(_"Not really, but don't worry. Just don't touch any buttons.")
99 else
100 Npc:says(_"Yeah! Thank you for Peltier Element! It's cooling it perfectly!")
101 end
102 Npc:says(_"Ah! I forgot to tell you that I am also reading books.")
103 Tux:says(_"You are reading books? Hmmm...")
104 show("node2") hide("node1")
105 end,
106 },
107
108 {
109 id = "node2",
110 text = _"Are you sentient?",
111 code = function()
112 Npc:says(_"Maybe you will find answer in my description. Should I show it to you?")
113 Tux:says(_"Yes please.")
114 Npc:says(_"[b]LOADING DESCRIPTION[/b]")
115 Npc:says(_"...")
116 Npc:says(_"...")
117 Npc:says(_"Here is it:")
118 Npc:says(_"Experimental command cyborg. Fitted with a new type of brain. Mounted on a security droid anti-grav unit for convenience.")
119 hide("node2")
120 end,
121 },
122
123 {
124 id = "node3",
125 text = _"How is it going?",
126 code = function()
127 if (Tux:has_quest("Bot in need")) then
128 if (Tux:done_quest("Bot in need")) then
129 --[[ TODO
130 if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update and
131 (not done_quest("No light - no life")))
132 then
133 Npc:says(_"IT'S HORRIBLE!!")
134 Tux:says(_"What happened?")
135 Npc:says(_"The amount of hostile droids increases in rate of geometric progression!")
136 Npc:says(_"If that was the only problem, I wouldn't worry, but the reactor went offline!")
137 Npc:says(_"Looks like its underground power system has left without fuel!")
138 Npc:says(_"If I won't restore its power source, then bots will assault the fortress, and the robotic 'plague' will spread through the portal!")
139 Tux:says(_"Hmm... Power source?")
140 Npc:says(_"DAC. Dilithium-Antimatter Cartridge. To build it, I'll need dilithium crystal, 2 antimatter converters, 6 Tachyon condensators and standard 'H4PPY FUS10N' cartridge.")
141 Npc:says(_"Fortunately, I've got one crystal somewhere in my junk... Let me search...")
142 Npc:says(_"Second... No... Not there...")
143 Npc:says(_"Rubber duck...")
144 Npc:says(_"Instruments...")
145 Npc:says(_"Another rubber duck...")
146 if (not difficulty() == "hard") then
147 Npc:says(_"Aha! Found it! Here, take.")
148 Tux:add_item("Red Dilithium Crystal", 1)
149 else
150 Npc:says(_"No... Looks like I don't have it... You'll have to find that one too...")
151 Tux:says(_"*I have a bad feeling somewhy...*")
152 end
153 Npc:says(_"The earlier you'll get DAC, the better.")
154 Npc:says(_"Otherwise defensive systems will go offline once reserved generators will become exhausted, and bots will destroy everything here, going further through the portal.")
155 Npc:says(_"You must help me, or that gonna end bad.")
156 Tux:says(_"Err... Okay.")
157 Tux:add_quest("No light - no life", _"Cerebrum's fortress is about to stay undefended because of an exhaust of reactor's fuel. I have to bring him DAC - Dilithium-Antimatter Cartridge. For that I'll need: dilithium crystal, 2 antimatter converters, 6 Tachyon condensators and a 'H4PPY FUS10N' cartridge.")
158 TODO: Tux will go town and ask Chandra and Dixon about the cartridge.
159 else ]]--
160 Npc:says(_"Well, more or less good. After you helped me with my troubles everything is going back to normal.")
161 -- end
162 else
163 Npc:says(_"Where are my addons? I need them, really... Hurry please.")
164 end
165 else
166 Npc:says(_"[b]STATUS[/b]: Bad. I am in need of many addons. My targeting system is outdated, armor is too, and reactor is unstable...")
167 Tux:says(_"Maybe I can help you somehow? Which addons do you need?")
168 Npc:says(_"I need these ones:","NO_WAIT")
169 Npc:says(_"[b]Laser Sight[/b] - it'll make my targeting much easier;","NO_WAIT")
170 Npc:says(_"[b]Tinfoil Patch[/b] - it'll raise my armor;","NO_WAIT")
171 Npc:says(_"[b]Peltier Element[/b] - I'll use this one for stabilizing the reactor's cooling.")
172 --; TRANSLATORS: %s = Tux:get_player_name()
173 Npc:says(_"So will you help me %s? I will give you some required components.", Tux:get_player_name())
174 Tux:says(_"Of course I will help.")
175 Npc:says(_"Thank you, duck.")
176 if (difficulty() == "easy") then
177 Tux:add_item("Plasma Transistor", 15)
178 Tux:add_item("Entropy Inverter", 15)
179 Tux:add_item("Antimatter-Matter Converter", 3)
180 Tux:add_item("Tachyon Condensator", 10)
181 elseif (difficulty() == "normal") then
182 Tux:add_item("Plasma Transistor", 10)
183 Tux:add_item("Entropy Inverter", 10)
184 Tux:add_item("Antimatter-Matter Converter", 2)
185 Tux:add_item("Tachyon Condensator", 10)
186 else
187 Tux:add_item("Plasma Transistor", 5)
188 Tux:add_item("Entropy Inverter", 5)
189 Tux:add_item("Antimatter-Matter Converter", 1)
190 Tux:add_item("Tachyon Condensator", 5)
191 end
192 Tux:add_quest("Bot in need", _"999 Cerebrum bot asked me for Laser Sight, Tinfoil Patch and Peltier Element. I want to help my new friend so I will bring these addons to him.")
193 end
194
195 hide("node3")
196 end,
197 },
198
199 {
200 id = "node4",
201 text = _"I brought your addons. It was a very long way!",
202 code = function()
203 Npc:says(_"Thank you! I was fearing that you took my components and happily made addons for yourself.")
204 Npc:says(_"For that I will award you! While you were searching for addons I found two Brain Stimulators. You may have them.")
205 Npc:says(_"Brain Stimulators are very special addons. They speed up learning making you gain more experience from killing bots. But don't use them too often! I have heard that they can burn human's brain!")
206 Tux:says(_"Don't worry, I have Linarian brain.")
207 Tux:del_item("Laser sight")
208 Tux:del_item("Tinfoil patch")
209 Tux:del_item("Peltier element")
210 Tux:add_item("Brain stimulator")
211 Tux:add_item("Brain stimulator")
212 Tux:end_quest("Bot in need", _"I brought addons to Cerebrum. He gave me pair of Brain Stimulators as reward. They will be useful.")
213 hide("node4")
214 end,
215 },
216
217 {
218 id = "node5",
219 text = _"What are these two bots?",
220 code = function()
221 Npc:says(_"629 guards the gate, and 476 watches for the cables' state.")
222 Tux:says(_"Why does he watch the cables? Is there something wrong with them?")
223 Npc:says(_"No. It just has an error or something. Just ignore that.")
224 hide("node5")
225 end,
226 },
227
228 {
229 id = "node6",
230 text = _"Why are you not hostile?",
231 code = function()
232 Npc:says(_"I was inactive during the day, when all bots went insane.")
233 Npc:says(_"I was activated just few weeks ago, so I could survive.")
234 Tux:says(_"Who activated you?")
235 Npc:says(_"Who knows... The archive that contains this information can only be accessed through network connection, but it's broken. Sorry duck, I don't know.")
236 hide("node6")
237 end,
238 },
239
240 {
241 id = "node99",
242 text = _"See you later.",
243 code = function()
244 Npc:says_random(_"Goodbye.",
245 _"See you later duck!",
246 _"If hostile droids won't kill you, then of course we'll see!",
247 _"Good luck, funny duck.")
248 end_dialog()
249 end,
250 },
251 }