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
20PERSONALITY = { "Militaristic", "Amoral" },
21MARKERS = { NPCID1 = "Francis" },
22PURPOSE = "$$NAME$$ is the leader of the Red Guard and gives Tux several quests that involve either ensuring the survival
23	 of the town, the downfall of the bots or actions Tux can take to join the Red Guard. $$NAME$$ has the final say on
24	 whether Tux can join the Red Guard.",
25RELATIONSHIP = {
26	{
27		actor = "$$NPCID1$$",
28		text = "$$NAME$$ disagrees with $$NPCID1$$ about disposing of people in cryonic stasis. $$NAME$$ wants to dispose of some of
29		 these people because he wants resources used by cryonic stasis for the town\'s survival. $$NAME$$ threatened to reveal a
30		 secret from $$NPCID1$$\'s past to force compliance."
31	}
32}
33WIKI]]--
34
35local Npc = FDrpg.get_npc()
36local Tux = FDrpg.get_tux()
37
38return {
39	FirstTime = function()
40		show("node0")
41		guard_follow_tux = false
42		local guard = FDrpg.get_npc("Town-TuxGuard")
43		guard:set_state("patrol")
44		change_obstacle_state("Dixon-autogun", "enabled")
45	end,
46
47	EveryTime = function()
48		if (MO_HFGateAccessServer_Spencer) then
49			Npc:says(_"Red Guard HQ, Spencer speaking.")
50			Npc:says(_"Are you receiving me?")
51			Tux:says(_"Yes.")
52			Tux:says(_"Spencer, we have a problem.")
53			Npc:says(_"Yes, Richard detected abnormalities with the server. Can you report anything regarding this?")
54			Tux:says(_"Indeed, the server says it is a gate server, not a firmware server.")
55			Npc:says(_"Bah!")
56			Npc:says(_"Must prevent access to the real update server. Can you open the gate?")
57			--; TRANSLATORS: follow the markers on the ground
58			Npc:says(_"Inside, follow the mrkers o e groun")
59			--; TRANSLATORS: Richard says the connection is bad
60			Npc:says(_"Ri ard sa... e c nn cti n *bzzzzzzzzz* bad.")
61			--; TRANSLATORS: good luck
62			Npc:says(_"Goo*sizzle*ck.")
63			--; TRANSLATORS: over
64			Npc:says(_"O*crack*r")
65			Tux:update_quest("Propagating a faulty firmware update", _"Spencer contacted me and said I was supposed to find the real firmware update server. I hope I survive this...")
66			Tux:add_quest("Open Sesame", "It turns out what we thought was the firmware update server was just a gate access server. Spencer speculates the real firmware server is behind this gate. There should be something on the ground I am supposed to follow.")
67			Spencer_can_die = true
68			end_dialog()
69		elseif (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and (not HF_FirmwareUpdateServer_Spencer) then
70			next("node60")
71		elseif (HF_Spencer_teleported) then
72			hide("node7")
73		elseif (tux_has_joined_guard) then
74			Npc:says(_"Greetings fellow Red Guard member.")
75			hide("node2", "node12")
76		end
77
78		if (Tania_met_Pendragon) and (not Spencer_Tania_decision) then
79			show("node50")
80		end
81
82		if (not Tux:has_quest("Opening access to MS Office")) and
83		   (Tux:done_quest("A kingdom for a cluster!")) then
84			show("node37")
85		end
86
87		if (not Tux:has_quest("Propagating a faulty firmware update")) and
88		   (Tux:done_quest("Opening access to MS Office")) then
89			show("node44")
90		end
91
92		if (data_cube_lost) and
93		   (not Tux:done_quest("Deliverance")) then
94			show("node29")
95		end
96
97		show("node99")
98	end,
99
100	{
101		id = "node0",
102		text = _"Hi! I'm new here.",
103		code = function()
104			Npc:says(_"I'm Spencer. I'm the leader of the Red Guard. Is there anything I can help you with?")
105			knows_spencer_office = true
106			if (Tux:has_quest("Deliverance")) and
107			   (not Tux:done_quest("Deliverance")) then
108				show("node20")
109			end
110			hide("node0") show("node1", "node7")
111		end,
112	},
113	{
114		id = "node1",
115		text = _"I want to join the Red Guard.",
116		code = function()
117			Npc:says(_"Hmm... Really? Well, you cannot join just like that, you know...", "NO_WAIT")
118			Npc:says(_"You must prove that you would make a good new member.")
119			hide("node1") show("node2")
120		end,
121	},
122	{
123		id = "node2",
124		text = _"I really want to become a member.",
125		code = function()
126			Npc:says(_"This is not so easy. First you must establish a reputation around here. Ask around, talk to people and build your reputation.")
127			Npc:says(_"Once you're a known character around here, we might let you join the ranks of the Guard.")
128			hide("node2") show("node3", "node12")
129		end,
130	},
131	{
132		id = "node3",
133		text = _"How about some circuits instead?",
134		code = function()
135			Npc:says(_"For 15 million circuits, no less, hehe.")
136			if (Tux:get_gold() >= 15000000) then -- player cheated obviously :-)
137				show("node9")
138			end
139			hide("node3", "node7", "node12") show("node4")
140		end,
141	},
142	{
143		id = "node4",
144		text = _"But I don't have that many circuits!",
145		code = function()
146			Npc:says(_"That much I can tell.")
147			Npc:says(_"Look, I'm just fooling around. We don't let just anyone join the Red Guard.", "NO_WAIT")
148			Npc:says(_"If you seriously want to join, you have to prove yourself first. You might want to ask around town for things you can do.")
149			hide("node4", "node9") show("node7", "node12")
150		end,
151	},
152	{
153		id = "node6",
154		text = _"Maybe I could help somehow?",
155		code = function()
156			Npc:says(_"That would be most kind of you, but I doubt that you will be able to clear out the warehouse for us.")
157			Npc:says(_"But since you are said to be powerful and a former hero, I'll once more put trust into a stranger.")
158			Npc:says(_"I've unlocked the access-way to the warehouse. It's to the north of this town, somewhat hidden in the woods northeast.")
159			Npc:says(_"The stuff we need is on the first floor. Don't go any deeper, there are only bots in there.", "NO_WAIT")
160			Npc:says(_"I wish you the best of luck.")
161			Tux:add_quest("Opening a can of bots...", _"I am supposed to clean out the first level of some warehouse. Sounds easy. It lies nearby, somewhat hidden in the woods north-east of town.")
162			change_obstacle_state("TrapdoorToWarehouse", "opened")
163			hide("node6")
164		end,
165	},
166	{
167		id = "node7",
168		text = _"How is it going?",
169		code = function()
170			if (Tux:has_quest("Opening a can of bots...")) then
171				if (Tux:done_quest("Opening a can of bots...")) then
172					if (Spencer_reward_for_warehouse_given) then
173						Npc:says(_"Thanks to you, we've been able to transport all the goods we need right now. You've really helped us out there.")
174						Npc:says(_"Rest assured that we will never forget your brave activity for our community.")
175					else
176						Npc:says(_"Man, you really did it! I can hardly believe it, but all the bots are gone!", "NO_WAIT")
177						Npc:says(_"Take these 500 circuits as a reward. And be assured that you've earned my deepest respect, Linarian.")
178						Npc:says(_"Our people are transporting the goods as we speak. It can't be too long until new bots from ships in the orbit of the planet will beam down to replace the dead bots.")
179						Tux:add_gold(500)
180						Spencer_reward_for_warehouse_given = true
181						Tux:update_quest("Opening a can of bots...", _"Ouch. It wasn't. At least I am alive, and the warehouse is clear. *Whew*.")
182					end
183				else
184					Npc:says(_"Not too good. Without the supplies from the warehouse we are doomed. So my problems are still the same.")
185					Npc:says(_"Maybe later, when you grow more experienced you might be able to help us after all.")
186				end
187			else
188				Npc:says(_"These are bad times. Interplanetary travel is made impossible by bot ships, so we need to stick to our local resources.")
189				Npc:says(_"We've got a list of stuff we need from the automated underground storage north of town. But the bots there are numerous.")
190				Npc:says(_"And currently I can't spare a single man from the town's defenses. It's quite a difficult situation.")
191				show("node6")
192			end
193		end,
194	},
195	{
196		id = "node9",
197		text = _"I actually do have the 15 million bucks, here take it!",
198		code = function()
199			Npc:says(_"Wow, err, I mean, thanks.")
200			Npc:says(_"You are a Red Guard now.")
201			Npc:says(_"Oh, wait, you cheated, didn't you?")
202			Npc:says(_"There is now way we can have lame cheaters in the Red Guard, forget about it!")
203			Npc:says(_"However, if you did in fact NOT cheat, please tell the developers how you got so much money so they can fix it. :)")
204			Npc:says(_"Contact information can be found at http://www.freedroid.org/Contact")
205			hide("node9")
206			Tux:del_gold(1000000)
207		end,
208	},
209	{
210		id = "node12",
211		text = _"Have I done enough quests to become a member now?",
212		code = function()
213			if (not Tux:done_quest("The yellow toolkit")) then
214				Npc:says(_"I think our teleporter service man, Dixon, has some problem. You might want to talk to him.")
215			elseif (not Dixon_mood) or
216			       (Dixon_mood < 50) then
217				Npc:says(_"Dixon told me about the matter with his toolkit. He seemed pretty impressed by you.")
218			elseif (Dixon_mood < 120) then
219				Npc:says(_"Dixon has his toolkit back.", "NO_WAIT")
220				Npc:says(_"He was in bad mood and told me he had to pay you for getting his own property back.")
221				Npc:says(_"I think it is the best for him if we leave him alone the next days.", "NO_WAIT")
222				Npc:says(_"I'm sure he has to do a lot now.")
223				-- Joining the guard, tux has to pay 500 circuits.
224			elseif (Dixon_mood < 180) then
225				Npc:says(_"Dixon has his toolkit back.", "NO_WAIT")
226				Npc:says(_"He seemed quite aggressive and stressed.")
227				Npc:says(_"Poor guy, if we weren't in such a bad situation, he could have some work-free days, but bot attacks continue all the time.", "NO_WAIT")
228				Npc:says(_"You better don't bother him the next days.")
229				-- Tux will have to pay 700 circuits to join the red guard
230			else
231				Npc:says(_"Dixon has his toolkit back.", "NO_WAIT")
232				Npc:says(_"He did rail against you though. He said he had to give you 400 circuits to get his toolkit back, his own property.")
233				Npc:says(_"That was nearly all money he had. He said you were too greedy to become a good member and he doesn't want to see you anymore.")
234				Npc:says(_"I think everybody has to get a chance. But look ahead! When you are negatively conspicuous again, we will ban you from our town!")
235				-- Tux needs to pay 800 circuits to join the guard.
236			end
237
238			if (Tux:done_quest("Anything but the army snacks, please!")) then
239				Npc:says(_"When I was eating, Michelangelo told me about his renewed oven energy supply. He seemed very pleased, and so was I.")
240			else
241				Npc:says(_"I think you should visit the town's cook sometime. He's usually in the restaurant kitchen.")
242			end
243
244			if (Tux:done_quest("Novice Arena")) then
245				Npc:says(_"From Butch I hear you've become a novice arena master. Congratulations.")
246			else
247				Npc:says(_"You might want to score some arena victories. That could also help your reputation a lot.")
248			end
249
250			if (Tux:done_quest("Bender's problem")) then
251				Npc:says(_"Helping Bender along was also a smart move. But you should be very careful with that one. He can get mad rather easily. A bit of a security threat, but we can't be too picky.")
252			else
253				Npc:says(_"As far as I know, Bender is still very sick.")
254			end
255
256			if (Tux:done_quest("Opening a can of bots...")) then
257				Npc:says(_"But most importantly, I was very impressed with you when you cleared out the warehouse. That was a huge deed I will never forget.")
258			else
259				Npc:says(_"Personally I'm also worrying about how we will manage to get some necessary supplies from our warehouse. It's filled with bots and we just don't have the manpower to spare to clean them out.")
260				if (not Tux:has_quest("Opening a can of bots...")) then
261					show("node6")
262				end
263			end
264
265			if (get_town_score() > 49) then
266				-- ENOUGH POINTS TO JOIN RG
267				Npc:says(_"OK. Your list of achievements is long enough. You can join us. So I hereby declare you a member of the Red Guard.")
268				Npc:says(_"But now that you are in the Guard, know this: There is only one rule for us guards: We stick together. We survive together or we die together. But we do it together.")
269				Npc:says(_"And now you might want to inspect the guard house. Tell Tybalt to open the door for you. Lukas at the arms counter will give you your armor.")
270				Npc:says(_"I hope you will prove yourself a worthy member of the Red Guard.")
271				display_big_message(_"Joined Town Guard!!")
272				tux_has_joined_guard = true
273				change_obstacle_state("Main Gate Guardhouse", "opened")
274				sell_item("Shotgun shells", 1, "Stone")
275				sell_item(".22 LR Ammunition", 1, "Stone")
276				hide("node3", "node12")
277			else
278				if (get_town_score() > 29) then
279					Npc:says(_"All in all, not quite so bad. But you still need to do the one thing or the other. Then we can talk about it.")
280				else
281					Npc:says(_"I can't accept you into the guard like this. Get going. There are still many things to do for you.")
282				end
283			end
284		end,
285	},
286	{
287		id = "node20",
288		text = _"Francis wanted me to give you a data cube.",
289		code = function()
290			Npc:says(_"Ah, excellent, the list I asked for.")
291			Npc:says(_"It figures he would ask someone to deliver it for him.")
292			Tux:says(_"Why's that?")
293			Npc:says(_"We had a little disagreement, Francis and I. He refused to accept our rule and do the task we gave him.")
294			Npc:says(_"I had to persuade him myself.")
295			Npc:says(_"Well, give me the data cube.")
296			if (Tux:has_item_backpack("Data cube")) then
297				show("node21", "node22", "node25", "node26")
298			else
299				show("node23", "node25", "node26")
300			end
301			hide("node20")
302			push_topic("Deliver the cube")
303		end,
304	},
305	{
306		id = "node21",
307		text = _"(Give the data cube to Spencer)",
308		echo_text = false,
309		topic = "Deliver the cube",
310		code = function()
311			Tux:says(_"Here, take it.")
312			Tux:del_item_backpack("Data cube", 1)
313			Npc:says(_"Thank you for the good work you have done. I think you deserve a small reward.")
314			Tux:add_xp(100)
315			Tux:add_gold(100)
316			Tux:end_quest("Deliverance", _"I gave Spencer the data cube. He gave me a small reward.")
317			data_cube_lost = false
318			hide("node20", "node21", "node22", "node23", "node24", "node25", "node26")
319			pop_topic("Deliver the cube")
320		end,
321	},
322	{
323		id = "node22",
324		text = _"(Lie about the oversight of the data cube)",
325		echo_text = false,
326		topic = "Deliver the cube",
327		code = function()
328			next("node23")
329		end,
330	},
331	{
332		id = "node23",
333		text = _"(Apologize for the oversight of the data cube)",
334		echo_text = false,
335		topic = "Deliver the cube",
336		code = function()
337			if (not data_cube_lost) then
338				Tux:says(_"Oh, erm... Hehe, I think I forgot it somewhere.")
339			else
340				Tux:says(_"Hm, I still don't have the data cube.")
341			end
342			Npc:says(_"... What?")
343			Npc:says(_"Then you better go and look for it. Don't waste my time, Linarian.")
344			data_cube_lost = true
345			hide("node21", "node22", "node23")
346			pop_topic("Deliver the cube")
347		end,
348	},
349	{
350		id = "node24",
351		text = _"(Lie about the loss of the data cube)",
352		echo_text = false,
353		topic = "Deliver the cube",
354		code = function()
355			Tux:says(_"I think I lost the data cube.")
356			Npc:says(_"Come on, you've got to be kidding! ...")
357			Npc:says(_"So I will call one minion for this job. You are very useless, unable to bring a small thing.")
358			Npc:says(_"Get out of my sight!")
359			Tux:end_quest("Deliverance", _"I lied about the data cube and Spencer thinks now I lost the cube. I won a little time for people in cryonic stasis. But, I couldn't stop Spencer's project.")
360			Tux:add_xp(250)
361			hide("node21", "node22", "node23")
362			end_dialog()
363		end,
364	},
365	{
366		id = "node25",
367		text = _"How did you persuade Francis? Did you beat him up?",
368		topic = "Deliver the cube",
369		code = function()
370			Npc:says(_"No, nothing so violent. Let's just say I know more about Francis than he would like to remember.")
371			Npc:says(_"Francis is someone who is very understandable. I just had to find the right words.")
372			Npc:says(_"Anyway, we have nearly been close friends since.")
373			hide("node25")
374		end,
375	},
376	{
377		id = "node26",
378		text = _"Why didn't Francis want to do this task you gave him? What was it?",
379		topic = "Deliver the cube",
380		code = function()
381			Npc:says(_"We had an unfortunate misunderstanding, so we had a very hard time talking together.")
382			Npc:says(_"I wanted him to go through the people in cryonic freezing in the facility, and make a list of disposable ones and people unlikely to survive. This cube contains that list.")
383			Tux:says(_"Disposable people? Unlikely to survive? Can't they just stay in cryonics indefinitely?")
384			Npc:says(_"No. They take up a lot of space, and keeping them alive takes a lot of power, which is running out. Most of the people there are sick or dying anyway, which is why they're frozen in the first place. We can't afford to waste any resources.")
385			Npc:says(_"We even had to confiscate the town cook's macrowave oven battery, which means we can't eat warm food anymore. We needed it to keep the town's defenses up.")
386			Tux:update_quest("Deliverance", _"I learn incredible information. Apparently the data cube stored a list of people in freezing in the cryonic facility. Spencer wants to dispose of some of them because keeping them alive uses up the town's power...")
387			hide("node26") show("node24")
388		end,
389	},
390	{
391		id = "node29",
392		text = _"I would like to talk about the Francis' cube.",
393		code = function()
394			Npc:says(_"Well, I'm listening to you. But you must be quickly, I've no time to loose.")
395			Npc:says(_"If you found the data cube, just give it.")
396			if (Tux:has_item_backpack("Data cube")) then
397				show("node21", "node22")
398			else
399				show("node23")
400			end
401			hide("node29")
402			push_topic("Deliver the cube")
403		end,
404	},
405	{
406		id = "node37",
407		text = _"I've heard Richard obtained new information on the town.",
408		code = function()
409			Npc:says(_"Yes, that's right, and in fact it might be crucial. As you may have heard, the MS office is defended by a disruptor shield. They open it only to let out new armies of bots.")
410			Npc:says(_"The data on the cube he obtained indicates the existence of a secret experimental facility in this region. Our findings suggest that they were testing some new form of disruptor shield for MS, so the shield can be controlled from that facility.")
411			Npc:says(_"If the information is true, then you can defeat the control droid and disable the shield permanently via some console or terminal.")
412			Npc:says(_"Then we should be able to get in.")
413			Npc:says(_"We know that MS had a firmware update system, which could be used to propagate a malicious update to disable all bots. It is very alluring, but to perform this trick you need to hack the control droid, which is in the heart of the HF. To enter HF you would have to disable the disruptor shield.")
414			Npc:says(_"This seems like a gift sent from the heavens. Cleaning the Hell Fortress is not going to be easy, though...")
415			hide("node37") show("node38")
416		end,
417	},
418	{
419		id = "node38",
420		text = _"I'd like to participate in this operation.",
421		code = function()
422			Npc:says(_"That's most kind of you to volunteer. So far, I've sent two scouts into the area. They have found the facility entrance and unlocked the gate.")
423			Npc:says(_"That is a good sign, because it shows that the key combinations from the data cube were correct.")
424			Npc:says(_"However, we lost contact with them shortly after they went inside. They also reported heavy bot resistance.")
425			Npc:says(_"I'd be glad if you could take a look. But use the utmost care. We can't afford to lose another guard.")
426			hide("node38") show("node39", "node40")
427		end,
428	},
429	{
430		id = "node39",
431		text = _"OK. I'll be careful. But I'll do it.",
432		code = function()
433			Npc:says(_"Good. The base entrance is somewhat hidden in the caves to the northeast. Best to use the north gate out of town, then head east, and turn north again along the shore.")
434			Npc:says(_"I wish you the best of luck for this operation. It might be that our survival depends on it. Don't wait for assistance.")
435			Npc:says(_"Try to get control over the disruptor shield if you can. The control droid should be somewhere on the lowest level of the installation. Simply destroying the droid might not suffice in disabling the shield, however there should be some terminal around to control it.")
436			Tux:add_quest("Opening access to MS Office", _"Spencer has revealed the information from the data cube evaluation to me. It seems there is an old military research facility north of the town. By defeating the control droid and using a nearby terminal, I should be able to control the disruptor shield at the facility. I can disable disruptor shield, fight my way through the Hell Fortress droids until I reach the main control droid and update it, thereby disabling all bots in the entire area around town in one fell swoop.")
437			change_obstacle_state("DisruptorShieldBaseGate", "opened")
438			hide("node39", "node40")
439		end,
440	},
441	{
442		id = "node40",
443		text = _"I don't feel like doing it now. I'd rather prepare some more.",
444		code = function()
445			Npc:says(_"Good. You should be well prepared if you intend to go.")
446			Npc:says(_"Also, there is no need to hurry with this. After all, the installation is not running away, so it's best to take a cautious approach.")
447			hide("node40")
448		end,
449	},
450	{
451		id = "node44",
452		text = _"It's done. Your soldiers were killed, but I managed to reach a computer terminal that controls the shield. Access to the bot factory is now open, after I changed the password on the terminal so as to prevent the bots from enabling the shield again.",
453		code = function()
454			Npc:says(_"Good. We cannot help you much in this final mission, but I can tell you what our recon teams gathered behind the factory doors. You will enter a zone that used to be a MS office.")
455			Npc:says(_"They carried out some development there, and had part of their patching division and update management department. The actual factory is located behind the office.")
456			Npc:says(_"With a bit of luck, you might not need to access it. We know they have their update server in the office.")
457			Npc:says(_"If you can find it and get it to propagate a faulty update, this could suffice to stopping bots dead in their tracks.")
458			Npc:says(_"Look for the entrance of the office in the crystal fields. I will send a message to the guards so they let you pass. Then you will be on your own.", "NO_WAIT")
459			Npc:says(_"However I'll ask Richard to see if we can contact you as soon as you find the server so we know if you're alive and there is still hope, or if things are going to go back to the way they were before you were taken out of stasis sleep...")
460			Npc:says(_"Good luck.")
461			Tux:add_quest("Propagating a faulty firmware update", _"I can now enter the fortress and find the upgrade server terminal. The fortress gates are in the Crystal Fields. Spencer told the guards to open the doors for me. He said he'd probably contact me when I found the server.")
462			Npc:says(_"Wait. I have a weapon here. It is not an Exterminator, but should save your life in the Hell Fortress.")
463			Tux:add_item("Electro Laser Rifle", 1)
464
465			if (difficulty_level() > 2) then -- difficulty neither easy, nor normal, nor hard
466				Npc:says("ERROR, Spencer NODE 44, game difficulty not handled")
467			end
468			local dev_count = 2 - difficulty_level()
469			if (not difficulty_level() == 0) then
470				Tux:add_item("Plasma Shockwave Emitter", dev_count)
471			end
472			Npc:says(_"In the name of the Red Guard I wish you the best of luck!")
473			hide("node44") show("node45")
474		end,
475	},
476	{
477		id = "node45",
478		text = _"I will need some time to get myself ready before I clean up Hell Fortress.",
479		code = function()
480			Npc:says(_"You better be ready.")
481		end,
482	},
483	{
484		id = "node50",
485		text = _"I found someone out in the desert.",
486		code = function()
487			Npc:says(_"Great, another mouth to feed.")
488			Npc:says(_"What is this person's name?")
489			hide("node50") show("node51")
490		end,
491	},
492	{
493		id = "node51",
494		text = _"Tania",
495		code = function()
496			if (tux_has_joined_guard) then
497				Npc:says(_"Well, since you are a guard member, I'll let you vouch for this Tania person.")
498			else
499				Npc:says(_"Well, we have enough food for now. I'll let this Tania person in.")
500			end
501
502			if (DocMoore:is_dead()) then
503				Npc:says(_"I'd say you should take her straight away to Doc Moore, but he was found dead earlier.")
504				Npc:says(_"You wouldn't happen to know anything about that, would you?")
505				if (killed_docmoore) then
506					show("node53")
507				end
508				show("node52", "node54")
509			else
510				Npc:says(_"You must take her straight away to Doc Moore. We can't have a disease breaking out.")
511				Spencer_Tania_decision = "doc_moore"
512				Tux:update_quest("Tania's Escape", _"Spencer said it was okay for Tania to enter the town, as long as she goes to see Doc Moore first thing. Now all I have to do is tell her and Pendragon.")
513			end
514			hide("node51")
515		end,
516	},
517	{
518		id = "node52",
519		text = _"No, of course not.",
520		code = function()
521			Npc:says(_"Good.")
522			Npc:says(_"I didn't think it was you, but you never know.")
523			Npc:says(_"About your friend, she can come in provided that she pulls her weight around here.")
524			Spencer_Tania_decision = "free"
525			if (killed_docmoore) then
526				Tux:update_quest("Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. I denied everything and he bought it! He says it is OK for Tania to enter the town: I should tell her and Pendragon.")
527			else
528				Tux:update_quest("Tania's Escape", _"When I asked about Tania entering the town, Spencer said Doc Moore was found dead! Oh, and Tania can enter the town. I should go tell her that.")
529			end
530			hide("node52", "node53", "node54")
531		end,
532	},
533	{
534		id = "node53",
535		text = _"He and I had a disagreement, which we settled.",
536		code = function()
537			Npc:says(_"I am the law here. If you have a problem, you come to me.")
538			if (tux_has_joined_guard) then
539				Npc:says(_"I'm going to strip you of your membership in the Red Guard.")
540				tux_has_joined_guard = false
541				change_obstacle_state("Main Gate Guardhouse", "closed")
542				Npc:says(_"Your friend can come in, but we will be watching the two of you closely.")
543				Spencer_Tania_decision = "free"
544				Tux:update_quest("Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. I told him the truth, and he kicked me out of the Red Guard. But he let Tania in, Now all I have to do is tell her and Pendragon.")
545			else
546				Npc:says(_"As the law, I pronounce you GUILTY of MURDER.")
547				Npc:says(_"The punishment is death.")
548				Tux:update_quest("Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. He found me guilty of murder, and sentenced me to death.")
549				set_faction_state("redguard", "hostile")
550				end_dialog()
551			end
552			hide("node52", "node53", "node54")
553		end,
554	},
555	{
556		id = "node54",
557		text = _"I killed him just to see what it was like. It was awesome.",
558		code = function()
559			Npc:says(_"You are a sociopath, and a danger to us all!")
560			Npc:says(_"We must stop you before you kill again.")
561			Tux:update_quest("Tania's Escape", _"When I asked about Tania entering the town, Spencer confronted me about Doc Moore's death. He found me too dangerous to live.")
562			set_faction_state("redguard", "hostile")
563			hide("node52", "node53", "node54")
564			end_dialog()
565		end,
566	},
567	{
568		id = "node60",
569		text = "BUG, REPORT ME! Spencer node60 -- Post Firmware Update",
570		code = function()
571			Npc:says(_"*Fizz*")
572			--; TRANSLATORS: can you hear me; %s = Tux:get_player_name()
573			Npc:says(_"*Crackle*n you hear me? Hello? %s?", Tux:get_player_name())
574			Tux:says(_"Spencer? How are you reaching me?")
575			Npc:says(_"You did it! I just can't... I can't believe you actually did it!")
576			Npc:says(_"The bots outside, they all just dropped! They're scrap metal!")
577			Npc:says(_"We're saved!")
578			Tux:says(_"Whew...")
579			Npc:says(_"But wait! It gets more interesting: we can actually have this conversation face to face.")
580			Npc:says(_"Stand by.")
581			add_obstacle(0, 33.5, 51.05, 282) --"Close" Spencer's office door
582			change_obstacle_type("spencer-opendoor", 321) --Make the obstacle standing for an open door invisible (321=pathblocker)
583			end_dialog()
584			show("node61")
585		end,
586	},
587	{
588		id = "node61",
589		text = _"Hey!",
590		code = function()
591			Npc:says(_"This must be the main server room. It's safer than an interstellar bunker.")
592			Npc:says(_"This is the source of all our suffering.")
593			Npc:says(_"You are truly a living legend, Linarian. I don't know how you did it. I don't know how we can thank you.")
594			Npc:says(_"You've given us life, and hope.")
595			hide("node61") show("node62", "node63", "node64")
596		end,
597	},
598	{
599		id = "node62",
600		text = _"What's going on? How did you get in here?",
601		code = function()
602			Npc:says(_"When you uploaded the firmware, every security component for this area just blacked out. Every network in range was suddenly open.")
603			Npc:says(_"Naturally, they were all running on the MegaSys operating system.")
604			if Tux:has_met("Richard") then
605				Npc:says(_"Richard is still back at the citadel; he's happier than a jaybird ever since we uncovered all this networking. He calls it a treasure.")
606			else
607				Npc:says(_"Our computer administrator at the citadel is as happy as he could be since all this secret networking popped up. He calls it a treasure.")
608			end
609			Npc:says(_"The firmware server was one of the things that were hidden in this network, and with all the obfuscations and defenses down, we not only could find it, but had full access.")
610			Npc:says(_"But the most interesting thing we uncovered is a secret teleportation network. It was very well-guarded, we never even knew it existed, but now it's open for us to use.")
611			Npc:says(_"My guess is, the corporate bastards who drove this sweatshop would use it to get in and out of work unnoticed. Grab the money and zap off to some island to relax.")
612			Tux:update_quest("Propagating a faulty firmware update", _"Neutralizing the bot threat in the area wasn't the only thing I'd succeeded in doing: every MegaSys-based security product within range is completely broken now. A new teleportation network was discovered by the Red Guard, which is why Spencer is standing next to me right now.")
613			hide("node62") show("node65")
614		end,
615	},
616	{
617		id = "node63",
618		text = _"I couldn't have done any different.",
619		code = function()
620			Npc:says(_"You are far too modest. I doubt anyone alive right now could have done it.")
621			Npc:says(_"But the work isn't done... Not even close. The entire galaxy is still at war.")
622			Npc:says(_"You saved our little town, and you've proven that we can win this thing.")
623			Npc:says(_"We can't rest now. It's going to be hard and dangerous, but the alternative is death for humanity.")
624			hide("node63", "node64") show("node66")
625		end,
626	},
627	{
628		id = "node64",
629		text = _"I only did it for fun, really.",
630		code = function()
631			Npc:says(_"... Oh, it doesn't matter.")
632			Npc:says(_"I suppose no one's perfect...")
633			Npc:says(_"What matters is that we're alive - those of us left, anyway - we have supplies, and we can take what we need from the Fortress now.")
634			Npc:says(_"And, whether or not you intended to, you've proven that we have a chance against the bots. Something worth fighting for. Worth living for.")
635			Npc:says(_"You'll probably be happy to know that the entire galaxy is pretty much your playground now, Linarian. You'll have all the bots in the world to play with, and lots of opportunities to be a hero.")
636			Tux:says(_"Awesome!")
637			Tux:update_quest("Propagating a faulty firmware update", _"I'm so cool. I saved a bunch of people and bashed a bunch of bots. And there's much more where both of those came from! I'm done here, it's time to go help the next dump.")
638			hide("node63", "node64") show("node66")
639		end,
640	},
641	{
642		id = "node65",
643		text = _"Can I use this teleportation network to return to town?",
644		code = function()
645			if Tux:has_met("Richard") then
646				Npc:says(_"Yes, I think you can. I'll contact Richard and tell him to ready the teleporter and link it back to the one in town.")
647			else
648				Npc:says(_"I believe you can, yes. I'll contact our computer expert and tell him to ready the teleporter and link it back to the one in town.")
649			end
650			Npc:says(_"But the way he explained it, this system is very limited by design: if the two teleporters are linked, using one will always take you to the other. So keep that in mind.")
651			Npc:says(_"We'll stay here for a while longer. This place still needs to be investigated.")
652			change_obstacle_type("59-Teleporter", 21)
653			hide("node65")
654		end,
655	},
656	{
657		id = "node66",
658		text = _"I'm ready. Just tell me what to do.",
659		code = function()
660			Npc:says(_"You've faced countless dangers so far. Are you sure you're willing to face more?")
661			Tux:says(_"Bring it on!")
662			Npc:says(_"That's exactly what I wanted to hear.")
663			Npc:says(_"Now listen carefully, this is the plan...")
664			Tux:end_quest("Propagating a faulty firmware update", _"The town is saved, but there's still a lot to do. I agreed to continue fighting the robot armies with the Red Guard.")
665			hide("node65")
666			win_game()
667			end_dialog()
668		end,
669	},
670	{
671		id = "node99",
672		text = _"I'll be going then.",
673		code = function()
674			if (not HF_FirmwareUpdateServer_Spencer) then
675				Npc:says(_"See you later.")
676			else
677				Npc:says(_"Come back soon. There's much to be done.")
678			end
679			end_dialog()
680		end,
681	},
682}
683