Debian Codegraph @

data/storyline/act1/dialogs/Pendragon.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 = { "Militarist", "Aggressive", "Confident" },
21 MARKERS = { QUESTID1 = "Doing Duncan a favor" },
22 PURPOSE = "$$NAME$$ helps improve Tux\'s skill. Tux must bribe $$NAME$$ in order to complete the $$QUESTID1$$ quest"
23 WIKI]]--
24
25 local Npc = FDrpg.get_npc()
26 local Tux = FDrpg.get_tux()
27
28 return {
29 FirstTime = function()
30 desertgate_tax = 0
31 if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
32 show("node0")
33 else
34 show("Pendragon_postfirmwareupdate")
35 end
36
37 end,
38
39 EveryTime = function()
40
41 if (Tania_position == "town_gate") and (not Tania_met_Pendragon) then
42 Npc:says(_"Halt! Who goes there?")
43 Tux:says(_"Someone I found in the desert, Tania.")
44 --; TRANSLATORS: %s = Tux:get_player_name()
45 Npc:says(_"%s, you may enter.", Tux:get_player_name())
46 Npc:says(_"However, you will have to talk to Spencer before you bring your friend, Tania, into the town.")
47 change_obstacle_state("DesertGate-Inner", "opened")
48 Tania:teleport("W-enter-2") --Ensure that Tania is on Level 0!
49 Tania:set_state("patrol")
50 start_chat("Tania")
51 end_dialog()
52 elseif (not Pendragon_OK_w_Tania) and (Spencer_Tania_decision) then --Tania Escape Quest stuff
53 if (not Tux:done_quest("Tania's Escape")) then
54 Npc:says(_"Tania has been waiting to talk to you.")
55 else
56 Npc:says(_"Spencer says it is OK?")
57 Npc:says(_"Well that is good enough for me.")
58 Npc:says(_"She may enter.")
59 Pendragon_OK_w_Tania = true
60 end_dialog()
61 end
62 end
63
64 if ((HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and (not Pendragon_post_firmware_update)) then
65 show("Pendragon_postfirmwareupdate")
66 end
67
68 show("node99")
69
70 if (not guard_follow_tux) then
71 show("node40")
72 end
73
74 if (desertgate_tax ~= 0) then
75 if (cmp_obstacle_state("DesertGate", "closed")) then
76 Npc:says(_"Got the money?")
77 show_if((Tux:get_gold() >= desertgate_tax), "node45")
78 end
79 hide("node40")
80 end
81
82 if (cmp_obstacle_state("DesertGate", "opened")) or
83 (Tux:has_met("Tania")) then
84 hide("node40", "node45")
85 end
86 end,
87
88 {
89 id = "node0",
90 text = _"Hi! I'm new here.",
91 code = function()
92 Npc:says(_"You don't say. I'm not living here either. I'm just on vacation.")
93 Npc:says(_"Normally I'm a fighter. But now I try to relax, chill, take it easy and have a lot of fun.")
94 Npc:says(_"And in case you couldn't tell, that was sarcasm.")
95 Npc:set_name("Fighter")
96 hide("node0") show("node1", "node2")
97 end,
98 },
99 {
100 id = "node1",
101 text = _"Could you teach me how to fight?",
102 code = function()
103 if (Pendragon_beaten_up) then
104 Npc:says(_"NO! NO! Er... I mean, not right now. I am busy. Come again later.")
105 else
106 Npc:says(_"Sure. I can help you.", "NO_WAIT")
107 Npc:says(_"For a price. A hundred circuits should be enough.")
108 hide("node1", "node99") show("node11", "node19")
109 end
110 end,
111 },
112 {
113 id = "node2",
114 text = _"Do you have a name?",
115 code = function()
116 Npc:says(_"I go by Pendragon, because I can pull a knife from thin air.")
117 Npc:says(_"And you?")
118 --; TRANSLATORS: %s = Tux:get_player_name()
119 Tux:says(_"%s, because it is my name?", Tux:get_player_name())
120 if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
121 --; TRANSLATORS: %s = Tux:get_player_name()
122 Npc:says(_"%s. Hah. They won't remember that name the way you think, bird.", Tux:get_player_name())
123 end
124 Npc:set_name("Pendragon - Fighter")
125 hide("node2")
126 end,
127 },
128 {
129 id = "node11",
130 text = _"Teach me the basic stuff.",
131 code = function()
132 Npc:says(_"Are you sure?", "NO_WAIT")
133 Npc:says(_"I only accept students that already have some experience in fighting bots.")
134 hide("node11", "node19") show("node12", "node29")
135 end,
136 },
137 {
138 id = "node12",
139 text = _"Yes (costs 100 valuable circuits, 5 training points)",
140 code = function()
141 if (Tux:get_skill("melee") < 1) then
142 if (Tux:train_skill(100, 5, "melee")) then
143 Tux:del_health(25)
144 Npc:says(_"Let us begin then.")
145 Npc:says(_"Come closer...")
146 Npc:says(_"HA!")
147 Tux:says(_"Ouch! What the hell are you doing?")
148 Npc:says(_"Lesson number one. Never trust the opponent.")
149 Tux:says(_"Just let me get up an -- ouch! Stop it.")
150 Npc:says(_"Lesson number two. The bots have no mercy.")
151 Npc:says(_"They won't let you get up if you fall down. They will kill you.")
152 Npc:says(_"Now, lesson number -- ugh! That hurt!")
153 Tux:says(_"Lesson number three. Never underestimate the enemy.")
154 Npc:says(_"Ugh. Yes. You are correct.")
155 Npc:says(_"I need to... Lie down for a while... My head hurts...")
156 Npc:says(_"Lesson number four. Never hit your sparring partner with full force.")
157 Npc:says(_"I think you broke my ribs...")
158 Npc:says(_"This is enough training for today.")
159 Pendragon_beaten_up = true
160 else
161 if (Tux:get_gold() >= 100) then
162 Npc:says(_"You don't have enough experience. I can't teach you anything more right now.")
163 Npc:says(_"First collect more experience. Then we can go on.")
164 else
165 Npc:says(_"You don't have enough valuable circuits on you! Come back when you have the money.")
166 end
167 end
168 else
169 Npc:says(_"Hey, wake up! I taught you that stuff already. Go practice on the bots, if you really want more training.")
170 end
171 hide("node12")
172 end,
173 },
174 {
175 id = "node19",
176 text = _"Teach me how to smash concrete blocks with my bare hands.",
177 code = function()
178 Npc:says(_"Oh, Linarian, you amuse me so.", "NO_WAIT")
179 Npc:says(_"You are quite an ambitious fellow.")
180 Npc:says(_"First learn the basics. Spend a year working on that, and then I'll be able to teach you some advanced tricks.")
181 hide("node19") show("node20")
182 end,
183 },
184 {
185 id = "node20",
186 text = _"Teach me Ninjitsu.",
187 code = function()
188 Npc:says(_"Go away.")
189 hide("node20") show("node21")
190 end,
191 },
192 {
193 id = "node21",
194 text = _"I want to know the Mega Uber Crazy Double-Fang Wolf-Sunlight I-Like-Tea Death Touch of Major Destruction Flesh-Bursting Attack!",
195 code = function()
196 Npc:says(_"Wow.", "NO_WAIT")
197 Npc:says(_"You have a very rich imagination. There is no such thing. Get a life.")
198 hide("node21") show("node22")
199 end,
200 },
201 {
202 id = "node22",
203 text = _"I want to know the forbidden skill of furuike ya kawazu tobikomu mizu no oto.",
204 code = function()
205 Npc:says(_"This is starting to make me angry. Shut up and go away.")
206 hide("node22") show("node23")
207 end,
208 },
209 {
210 id = "node23",
211 text = _"Teach me how to flip out and kill people!",
212 code = function()
213 Npc:says(_"*sigh*")
214 Npc:says(_"I will teach you to keep your mouth shut when told to. Observe very carefully.")
215 Npc:says(_"Make sure you pay attention.")
216 Npc:says(_"TAKE THIS!")
217 Tux:says(_"OW!")
218 if (not Tux:del_health(40)) then
219 if (not Tux:del_health(20)) then
220 Tux:del_health(5)
221 end
222 end
223 Npc:says(_"Now go away.")
224 hide("node23")
225 end_dialog()
226 end,
227 },
228 {
229 id = "node29",
230 text = _"Enough for now.",
231 code = function()
232 Npc:says(_"Fine.")
233 hide("node11", "node12", "node19", "node20", "node21", "node22", "node23", "node29") show("node1", "node99")
234 end,
235 },
236 {
237 id = "node40",
238 text = _"I want to pass the gate.",
239 code = function()
240 Npc:says(_"Fine.")
241 Tux:says(_"Can you open it, please?")
242 Npc:says(_"Yes, I can.")
243 Tux:says(_"Thanks.")
244 Tux:says(_"Uhm...")
245 Tux:says(_"Will you do it?")
246 Npc:says(_"Yes. But you have to pay a one-time tax for it first.")
247 if (not Town_NorthGateGuard_tux_nickname_loon) then
248 Npc:says(_"Pay 30 circuits and you may pass.")
249 desertgate_tax = 30
250 else
251 Npc:says(_"You can enter the desert, but first you'll have to pay 40 circuits.")
252 desertgate_tax = 40
253 end
254 if (Tux:get_gold() >= desertgate_tax) then
255 show("node45")
256 end
257 hide("node40")
258 end,
259 },
260 {
261 id = "node45",
262 text = _"Yes, I've got the money.",
263 code = function()
264 if (Tux:get_gold() >= desertgate_tax) then
265 if (desertgate_tax == 30) then
266 Npc:says(_"Good.")
267 Tux:says(_"Here, take it.")
268 Npc:says(_"You may pass.")
269 if (Tux:has_quest("Doing Duncan a favor")) then
270 Tux:update_quest("Doing Duncan a favor", _"Pendragon opened the gate for me, but I had to pay a little tax.")
271 end
272 elseif (desertgate_tax == 40) then
273 Npc:says(_"At last.")
274 Tux:says(_"Here, let me pass now.")
275 Npc:says(_"You may pass, Loon.")
276 Npc:says(_"But don't expect any help in there.")
277 if (Tux:has_quest("Doing Duncan a favor")) then
278 Tux:update_quest("Doing Duncan a favor", _"Pendragon opened the gate for me, but I had to pay a tax.")
279 end
280 end
281 Tux:del_gold(desertgate_tax)
282 desertgate_tax = 0
283 change_obstacle_state("DesertGate", "opened")
284 else
285 Npc:says(_"Don't try to trick me, duck.") --just in case...
286 Npc:says(_"Come back if you have the bucks!")
287 end
288 hide("node45")
289 end_dialog()
290 end,
291 },
292 {
293 id = "Pendragon_postfirmwareupdate",
294 text = _"Hi!",
295 code = function()
296 Npc:says(_"What do you want?")
297 Pendragon_post_firmware_update = true
298 show("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont",
299 "Pendragon_postfirmwareupdate_brag")
300 hide("Pendragon_postfirmwareupdate")
301 end,
302 },
303 {
304 id = "Pendragon_postfirmwareupdate_goodbye",
305 text = _"Nothing...",
306 code = function()
307 Npc:says(_"Get lost. Don't come back.")
308 hide("Pendragon_postfirmwareupdate_goodbye","Pendragon_postfirmwareupdate_cont",
309 "Pendragon_postfirmwareupdate_brag")
310 end_dialog()
311 end,
312 },
313 {
314 id = "Pendragon_postfirmwareupdate_cont",
315 text = _"How's it going?",
316 code = function()
317 Npc:says(_"Listen to me carefully, bird.")
318 Npc:says(_"Maybe it looks like you saved the day, but I know better than that. You're nothing but a duck. You're not a human.")
319 Npc:says(_"As far as I'm concerned, you just landed here and stole our show. The Red Guard had everything under control, and we did not need your stupid flippers waddling in our affairs.")
320 Npc:says(_"And don't think that just because Spencer is excited, he's on your side.")
321 Npc:says(_"He may not share his plans with the rest of us, but I know him well enough to know that he's using you.")
322 Npc:says(_"He's been using you since he did you a favor and defrosted you, and your stupid bird brain can't even comprehend that. So don't get cocky.")
323 Npc:says(_"You'll get what you deserve, soon enough, just like all the other bird aliens.")
324 if (not Pendragon_beaten_up) then
325 Npc:says(_"HA!")
326 Tux:del_health(10)
327 Tux:says(_"Ouch!")
328 end
329 hide("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont",
330 "Pendragon_postfirmwareupdate_brag")
331 end_dialog()
332 end,
333 },
334 {
335 id = "Pendragon_postfirmwareupdate_brag",
336 text = _"I want to see a better attitude around here. You'd better be nice to me.",
337 code = function()
338 if (Pendragon_beaten_up) then
339 Tux:says(_"Remember our lesson?")
340 Npc:says(". . .")
341 else
342 Npc:says(_"You impudent little eggspawn.")
343 next("Pendragon_postfirmwareupdate_cont")
344 end
345 hide("Pendragon_postfirmwareupdate_goodbye", "Pendragon_postfirmwareupdate_cont",
346 "Pendragon_postfirmwareupdate_brag")
347 end_dialog()
348 end,
349 },
350 {
351 id = "node99",
352 text = _"See you later.",
353 code = function()
354 if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
355 Npc:says_random(_"Have courage.",
356 _"Be strong.")
357 else
358 if (Pendragon_beaten_up) then
359 Npc:says(". . .")
360 else
361 Npc:says_random(_"You'll see. Big hero. You'll learn your place soon.",
362 _"I hate birds.")
363 end
364 end
365 end_dialog()
366 end,
367 }
368 }