Debian Codegraph @

data/storyline/act2/dialogs/Yadda.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 --[[WIKI13
20 PERSONALITY = { "Wise", "Arrogant" },
21 PURPOSE = "$$NAME$$ is a strange monk who follows the path of light. Options become available as you talk to him. Gives quest to slay evil glitches. Give quests for Source Book of Light, Light Saber and Light Staff. Is a pacifist with a weak resolve. May summon droids to help Tux in certain quests, or to kill tux if he appears to be walking on an evil path, be it because bad karma, or because strange items on his possession.",
22 BACKSTORY = "Please refer to key-characters section on website."
23 WIKI]]--
24
25 local Npc = FDrpg.get_npc()
26 local Tux = FDrpg.get_tux()
27
28 return {
29 FirstTime = function()
30 Yadda_times=0
31 Yadda_TP_cost=1
32 Yadda_books_bought=0
33 Yadda_vmx_saber=20+(math.random(5,7)*difficulty_level())
34 show("node99")
35 Npc:says(_"Welcome to my temple of peace. People say I am the wisest man alive in the world, but I think I am the wisest in the universe!", "NO_WAIT")
36 cli_says(_"And in case you're wondering: ", "NO_WAIT")
37 end,
38
39 EveryTime = function()
40 --
41 Npc:says(_"Greetings, I'm Master Yadda. I teach the path of light.")
42
43 -- Those two conditions make Yadda hostile and wanting to kill tux at once. (Maybe could use extra explanation)
44 if (Tux:has_item_equipped("Nobody's edge")) then
45 next("evil")
46 elseif (Tux:has_item_backpack("Pandora's Cube")) then
47 next("pandora")
48 end
49
50 -- Show player bad options, like showing Nobody's Edge and such.
51 if (Tux:has_item_backpack("Nobody's edge")) then
52 show("evil")
53 end
54
55 if (Tux:has_quest("Message From An Old Friend") and not Yadda_PGP) then
56 Yadda_PGP=true
57 show("pgpkey")
58 end
59 -- Yadda's wise advises and time-dependent events.
60 Yadda_times=Yadda_times + 1
61 if (Yadda_times==1) then
62 Npc:says(_"Come and seek my light advice every now and then, and you'll find truth and light.")
63 Tux:assign_quest("The Reapers Of MegaSys I", _"Master Yadda seems to be a very wise man, and I should talk to him a lot more.")
64 elseif (Yadda_times==3) then
65 Npc:says(_"The only skill worth acquiring in the world: Light.")
66 show("book")
67 elseif (Yadda_times==7) then
68 Npc:says(_"Persistence is the way to perfection.")
69 elseif (Yadda_times==13) then
70 -- Note for self: thirteen thirty-seven = 1337
71 Npc:says(_"I have secrets, but you are not ready for them.")
72 Npc:says(_"If you talk to me thirty seven times, as in thirteen thirty-seven, I'll teach them.")
73 Tux:update_quest("The Reapers Of MegaSys I", _"Sorry, Master Yadda is ANNOYING! But he promised to tell me a secret if I keep talking to him.")
74 elseif (Yadda_times==37) then
75 Npc:says(_"This is the 37th time you have asked me for enlightenment, as in thirteen thirty-seven. I'll teach you a secret. There is a super-strong bot in this area. It might be worth checking it out.")
76 show("C64gate")
77 elseif (Yadda_times==15) then
78 Npc:says(_"I accidentally overkilled a bot and lost my Light Saber in the process. What a shame. Already built a new one, though.")
79 show("saber")
80 elseif (Yadda_times==28) then
81 Npc:says(_"I haven't seen any Alpha Bots lately. Things are strangely calm. And the calm precedes the storm.")
82 show("bots")
83 -- Random quotes. If we're not in an specific event from above, give Tux a “wise” advice.
84 elseif (Yadda_times < 20) then
85 -- All texts below are quotes adapted to FreedroidRPG world.
86 Npc:says_random(_"In matters of destroying bots, style, not brute force, is the vital thing.",
87 _"Any fool can bust a bot open; the art is in knowing how to exploit it.",
88 _"The knife is without measure, for if you hit a bot right, out will come treasure.",
89 _"When the linarian falls, the bots reigns.",
90 _"A linarian is only finished when he gives up.",
91 _"Yadda Yadda Yadda.",
92 _"Basically, it's just a jump to the left, and a step to the right... You see?")
93 elseif (Yadda_times < 40) then
94 -- Texts below aren't quotes, but advises. Some disagree, specially the Yadda parts.
95 Npc:says_random(_"No one knows what the future holds. Except Master Yadda.",
96 _"Yadda Yadda Yadda.",
97 _"The secret to sure victory is siding with Master Yadda.",
98 _"Kill bots first, ask questions later.",
99 _"There was the Experimental Alpha Class. If you meet one, your death is close.",
100 _"If you can think, you're sentient. This won't make you a life-form though.",
101 _"Lamps are nice. Always carry one with you. You never know when you'll need them.",
102 _"Bots will aim at whatever is in front of them. Which, in most cases, will be you.")
103 else
104 Npc:says(_"You're very dedicated, seeking my advice, and wise words that much. But I have nothing else to tell you. Besides that: ")
105 --; TRANSLATORS: %d = number of times talked to Yadda
106 Npc:says(_"You've asked for my wise advice %d times. Maybe you should start figuring things out on your own.", Yadda_times)
107 end
108
109
110 show("node99")
111 end,
112
113 {
114 id = "pgpkey",
115 text = _"Master, I've been looking for a PGP key in order to unlock a certain file.",
116 code = function()
117 Tux:says(_"Your wisdom is not mensurable, it's so high to be understood by mere mortals like me, you surely must know where I can find it.")
118 -- Tux probably expected: “You're quite right, except for one thing. I do not know where this key is.”
119 Npc:says(_"Indeed, you're quite right there.", "NO_WAIT")
120 Npc:says(_"You can find it by walking south and descending through the first trapdoor you see.")
121 Tux:says(_"I thought you would tell me in a riddle.") -- “Actually, I thought you wouldn't tell me at all.”
122 Npc:says(_"Well, you would find it if you explore this area for two minutes. To be asking me this, you must be as lazy as me, so I decided to just tell you right away. Please enjoy this Island.")
123 hide("pgpkey")
124 end,
125 },
126 {
127 id = "C64gate",
128 text = _"I heard there was a dangerous bot which needs killing. Where is it?",
129 code = function()
130 Npc:says(_"Indeed, an evil bot there is. A glitch from the gamers at MegaSys threatens this lands.", "NO_WAIT")
131 Npc:says(_"If you defeat it, the fictional survivors which aren't here because of the Great Assault would be very grateful. You will also gain a nice amount of experience, and who knows what it will drop?", "NO_WAIT")
132 Tux:says(_"Seems interesting. Where can I find it?")
133 Npc:says(_"Just follow the water, young apprentice of Yaddawan. Only the ones with enough faith can walk over water and save the world!")
134 Tux:update_quest("The Reapers Of MegaSys I", _"The first Reaper of MegaSys, The Glitch, can be found by walking over the water on Icy Summer Island. I better stay away, as searching for it is a death wish.")
135 del_obstacle("Act2-ArtificialPassage-1")
136 del_obstacle("Act2-ArtificialPassage-2")
137 hide("C64gate")
138 end,
139 },
140 {
141 id = "book",
142 text = _"I want that skill you mentioned earlier.",
143 code = function()
144 Tux:says(_"Light skill, was it?")
145 Npc:says(_"Of course I can show you the wonderful program called [b]Light[/b], but I'm too lazy to actually teach you anything.", "NO_WAIT")
146 Npc:says(_"Therefore I shall write by hand a book explaining the wonders of light. But such wonderful skill requires some readiness of mind to absorb; it's rich content.")
147 --; TRANSLATORS: %d = number of training points required to buy the book.
148 Npc:says(_"For you, it'll cost only 2,000 circuits and %d training points.", Yadda_TP_cost)
149 show("buybook")
150 end,
151 },
152 {
153 id = "buybook",
154 text = _"I want to buy the Source Book of Light for the price you mentioned earlier.",
155 code = function()
156
157 -- Check if player can buy the book
158 if (Tux:get_gold() < 2000) then
159 next("no_money")
160 elseif (Tux:get_training_points() < Yadda_TP_cost) then
161 next("no_points")
162 else -- Everything is OK. Get the book.
163 Tux:del_training_points(Yadda_TP_cost)
164 Tux:add_gold(-2000)
165 Tux:add_item("Source Book of Light", 1)
166 Yadda_books_bought=Yadda_books_bought+1
167 if (Yadda_books_bought % 3 == 0) then
168 Yadda_TP_cost=Yadda_TP_cost+1
169 end
170
171 -- Fancy message
172 if (Yadda_books_bought % 3 == 1) then
173 Npc:says(_"It's a deal. May the light guide your path.")
174 elseif (Yadda_books_bought % 3 == 2) then
175 Npc:says(_"Deal. Light guide you forever.")
176 else
177 Npc:says(_"Here is the book. May the light guide your steps.")
178 end
179
180 -- Limit to 10 sells
181 if (Yadda_books_bought == 10) then
182 Npc:says(_"I won't sell you anymore from now on.")
183 hide("book")
184 elseif (Yadda_books_bought == 9) then
185 Npc:says(_"I'll only sell you one more copy. Be sure not to waste it.")
186 elseif (Yadda_books_bought == 7) then
187 Npc:says(_"I'll only sell you three more copies.")
188 end
189
190 hide("buybook")
191 end
192 end,
193 },
194 {
195 id = "saber",
196 text = _"You crafted a light saber? Amazing! Can I have one?",
197 code = function()
198 Npc:says(_"The light saber is for the disciples of light.")
199 Tux:says(_"I'm always eager to hear your wisdom, o wise master Yadda.")
200 Npc:says(_"I'm too wise to be fooled by your compliments, young apprentice. But yet, I shall craft one for you, for a small price of my wisdom.")
201 Npc:says(_"I shall require 5,000 circuits in compensation for my efforts, 3 source books of light to prove your worthiness and eagerness to learn from my wise words... And...")
202 Tux:says(_"...And?")
203 --; TRANSLATORS: %d = number of VMX grenades required to craft the Light Saber. Varies according to difficulty.
204 Npc:says(_"...And %d VMX Gas Grenades. I'm a pacifist, but the disciples of the dark - robots and programmers - are after my life. Only with gas grenades I shall survive. They're poison to mere mortals, but for the great master Yadda, they are a source of life.", Yadda_vmx_saber)
205 --; TRANSLATORS: %d = number of VMX grenades required to craft the Light Saber. Varies according to difficulty.
206 Tux:says(_"I have no idea of how life can come out from gas grenades, and how a gas grenade can kill a bot, but I shall bring you 5,000 circuits, 3 source books of light, and %d VMX grenades.", Yadda_vmx_saber)
207 hide("saber") show("buysaber")
208 end,
209 },
210 {
211 id = "buysaber",
212 text = _"I have the 5,000 circuits, 3 source books of light, and the VMX grenades you requested. Gimme the saber!",
213 code = function()
214
215 -- Check if player can buy the saber
216 if (Tux:get_gold() < 5000) then
217 next("no_money")
218 elseif (Tux:count_item_backpack("Source Book of Light") < 3) then
219 Npc:says(_"And the proof of eagerness? I require three source books of light.")
220 elseif (Tux:count_item_backpack("VMX Gas Grenade") < Yadda_vmx_saber) then
221 --; TRANSLATORS: %d = number of VMX grenades required to craft the Light Saber. Varies according to difficulty.
222 Npc:says(_"I really need %d VMX Gas Grenades to protect myself from the disciples of dark. I won't give you a light saber without it.", Yadda_vmx_saber)
223 else -- Everything is OK. Get the saber.
224 Tux:add_gold(-5000)
225 -- FIXME: Source Book of Light doesn't stacks. Therefore, it's necessary to call the function three times.
226 -- This is a fragility from C code to delete items. Other functions might work without this additional care.
227 Tux:del_item_backpack("Source Book of Light")
228 Tux:del_item_backpack("Source Book of Light")
229 Tux:del_item_backpack("Source Book of Light")
230 Tux:del_item_backpack("VMX Gas Grenade", Yadda_vmx_saber)
231 Tux:add_item("Light saber", 1)
232
233 Npc:says(_"Here it is.")
234 Tux:says(_"So quick? I thought you were going to craft it?")
235 Npc:says(_"I have dozens of these. I make them in my spare time.")
236
237 hide("saber", "buysaber")
238 end
239 end,
240 },
241 {
242 id = "bots",
243 text = _"Wise master Yadda, could you please instruct this humble servant of light again about what the Alpha Bots are?",
244 code = function()
245 Npc:says(_"Hah. They're all experimental, most might be scrap in a single shoot, but they all have... skills... which more than makes up for any deficiency they might have.", "NO_WAIT")
246 Npc:says(_"My friend, I hope you never meet any of them. They should be only rumors, though.")
247 Npc:says(_"Also, I heard from the bard something about Agent Zero not managing to get a good designer for these droids and reusing existing droid models on them.", "NO_WAIT") -- An excuse for missing art.
248 Npc:says(_"They should be all be locked away at the Ice Pass area, north from here. I hope...")
249 --Npc:says(_"If this is the case, you might think you're meeting a normal bot and be surprised when it causes havoc because it's from the Alpha class.") -- Missing art can be used as extra difficulty. Still would be better to not provoke mistakes because that.
250 --Npc:says(_"There is the [b]001 Influencer[/b]. It can take over your bots. If your army suddenly become hostile to you, one might be near.")
251 Npc:says(_"There is the [b]002 Pillbody[/b]. That bot is made to withstand heavy fire. If you find one, be careful as more dangerous bots will come.") -- Also have good sensors
252 Npc:says(_"There is also the [b]011 Grenadier[/b]. It will throw grenades to destroy your army. Mass destruction. Kill it as fast as you can.")
253 Npc:says(_"Not to mention the [b]021 Wizard[/b]. This one is nasty, so I hope you have an army, because it can slow you, paralyze, and it can even poison you, so don't trifle with it.")
254 Npc:says(_"Finally there is the [b]Marvin[/b]. I am not sure what it does, because no one has returned alive after fighting one. Even the droid number is unknown.")
255 Tux:says(_"Sounds dangerous.")
256 Npc:says(_"Ha! That's not even the half of it. Agent Zero did many tests on this area to create the supreme foe. There are bots at graveyard too: [b]Zombot[/b] and you won't want to know what it does, the [b]Ghost[/b] and [b]Shadow Hunter[/b] which uses invisibility, so very dangerous.", "NO_WAIT") -- Maybe the Zombot is the 001 model, which take over your droids
257 Npc:says(_"There are also [b]Ghoul Bots[/b] and the silly [b]Pepper Bot[/b] who you won't bother with until suddenly! You're dead.")
258 Tux:says(_"Sounds extremely dangerous.")
259 Npc:says(_"The alpha class carries on. They are only experiments, weak and not mass produced, so you might have a chance against them with my advice. But I must warn you that further on, you might find specialized droids with those characteristics. If this happens, I hope you have The Holy Light blessings.")
260 Tux:says(_"Thank you. I shall look for one of those experimental droids to practice.")
261 Npc:says(_"You won't find them. Do not worry about it.")
262 --Npc:says(_"...I hope you know what you're doing.")
263 end,
264 },
265 {
266 id = "evil",
267 text = _"I have this nice weapon here, want to take a look?",
268 code = function()
269 Npc:says(_"Nobody's Edge! How do you dare to bring such evil pulsing weapon to those lands!!", "NO_WAIT")
270 --; TRANSLATORS: Komm und hilf mir → Come and aid me (from German, use whatever you used with Geist)
271 Npc:says(_"Komm und hilf mir, minions! Let's kill this... this... heretic!")
272 Npc:set_faction("ms")
273 create_droid("Act2-YaddaRef1", "GUB", "ms", "AfterTakeover", "radar")
274 create_droid("Act2-YaddaRef2", "GUA", "ms", "AfterTakeover", "radar")
275 end_dialog()
276 end,
277 },
278 {
279 id = "pandora",
280 text = _"I found this small cube on a desert.",
281 code = function()
282 Npc:says(_"The Pandora Box! How do you dare to bring doom to those lands!!", "NO_WAIT")
283 --; TRANSLATORS: Komm und hilf mir → Come and aid me (from German, use whatever you used with Geist)
284 Npc:says(_"Komm und hilf mir, minions! Let's kill this doom bringer!")
285 Npc:set_faction("ms")
286 create_droid("Act2-YaddaRef1", "GUB", "ms", "AfterTakeover", "radar")
287 create_droid("Act2-YaddaRef2", "GUA", "ms", "AfterTakeover", "radar")
288 end_dialog()
289 end,
290 },
291 {
292 id = "no_money",
293 code = function()
294 Npc:says_random(_"Please don't bother me if you can't pay me.",
295 _"No money, no deal.",
296 _"I was pretty clear about the amount of money I wanted.")
297 end,
298 },
299 {
300 id = "no_points",
301 code = function()
302 Npc:says_random(
303 _"Come back when you have a real will to learn.",
304 _"You don't have enough experience. You'll never understand my wisdom like this.")
305 end,
306 },
307 {
308 id = "node99",
309 text = _"Erm... That was very wise, thank you. I'll think about what you said.",
310 code = function()
311 Npc:says_random(_"Stay on the path of light.",
312 _"I'm pure wisdom. If you follow my words you'll have success.",
313 _"Wisdom is more worth than rubies. But if it's my wisdom, it'll be more worth than the whole universe!",
314 _"Take as much time you need to reflect on what I said, and you'll become wise, because I am the wisest man on this universe.")
315 end_dialog()
316 end,
317 },
318 }