Debian Codegraph @

data/storyline/act1/dialogs/Stone.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 = { "Friendly", "Desperate" },
21 MARKERS = {
22 QUESTID1 = "Saving the shop",
23 ITEMID1 = "Two Barrel shotgun",
24 ITEMID2 = "Shotgun shells"
25 },
26 PURPOSE = "$$NAME$$ is the first seller of equipment available in the town. She sells armament for the first part of game.",
27 BACKSTORY = "$$NAME$$ has continued to take care of her shop after The Great Assault. However, the Red Guard taxes represent
28 such a significant financial burden that she is having problems with its finances. $$NAME$$\'s grandfather knows Tux as
29 a ancient hero. She managed to hide her grandfather\'s $$ITEMID1$$ from the Red Guard. She may give it and some $$ITEMID2$$
30 to Tux as a reward for completing the $$QUESTID1$$ quest."
31 WIKI]]--
32
33 local Npc = FDrpg.get_npc()
34 local Tux = FDrpg.get_tux()
35
36 return {
37 FirstTime = function()
38 show("node0")
39 end,
40
41 EveryTime = function()
42 if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
43 --; TRANSLATORS: %s = Tux:get_player_name()
44 Npc:says(_"Congratulations on saving us, %s! I knew you could do it!", Tux:get_player_name(), "NO_WAIT")
45 end
46
47 if (Tux:has_quest("Saving the shop")) then
48 show_if((Tux:get_gold() > 1400), "node23")
49 if (Tux:done_quest("Saving the shop")) then
50 hide("node23") show("node10")
51 end
52 end
53
54 if (Stone_talk_again_later) then
55 show("node4")
56 end
57
58 show("node99")
59 end,
60
61 {
62 id = "node0",
63 text = _"Hi! I'm new here.",
64 code = function()
65 Npc:says(_"Welcome to our town! I'm Ms. Stone. I run this shop.")
66 Npc:set_name("Stone - Shop owner")
67 hide("node0") show("node1", "node3", "node10")
68 end,
69 },
70 {
71 id = "node1",
72 text = _"I would like to trade with you.",
73 code = function()
74 Npc:says(_"Good! Here is the selection of items I have for sale.")
75 show_if((not Stone_asked_for_guns), "node2")
76 trade_with("Stone")
77 end,
78 },
79 {
80 id = "node2",
81 text = _"Swords, clubs and maces? What is this? I want guns!",
82 code = function()
83 if (tux_has_joined_guard) then
84 Npc:says(_"I think the Red Guard has their own store somewhere.")
85 Npc:says(_"At least, they somehow get supplement I don't sell.")
86 Npc:says(_"However, I'm quite sure, they don't offer the same range of products that I do.")
87 else
88 Npc:says(_"Sorry, this is all we have for now. The Red Guard took away all of our poppers.", "NO_WAIT")
89 Npc:says(_"For our own good. Of course.")
90 end
91 Stone_asked_for_guns = true
92 hide("node2")
93 end,
94 },
95 {
96 id = "node3",
97 text = _"What can you tell me about the guards here?",
98 code = function()
99 Npc:says(_"Ah, the Red Guard.", "NO_WAIT")
100 if (guard_follow_tux) then -- tux followed by guard
101 Npc:says(_"Well, they keep the town safe.")
102 Npc:says(_"Without them, everything would drown in chaos, but...")
103 show("node4")
104 elseif (tux_has_joined_guard) then -- tux joined guard/not followed by guard
105 Npc:says(_"Well, you ARE a Red Guard.")
106 Npc:says(_"What should I tell you about them that you don't know yet?")
107 Tux:says(_"Uhm, right.")
108 else
109 Npc:says(_"Stranger, best if you don't ask such questions.", "NO_WAIT")
110 Npc:says(_"They keep us alive and safe from the bots, but...")
111 show("node4")
112 end
113 hide("node3")
114 end,
115 },
116 {
117 id = "node4",
118 text = _"But...?",
119 code = function()
120 if (guard_follow_tux) then
121 Npc:says(_"But nothing.")
122 Npc:says(_"I'm busy right now.")
123 Npc:says(_"We should talk again later...")
124 Stone_talk_again_later = true -- EveryTime Code: if var then show("node4")
125 elseif (tux_has_joined_guard) then -- tux joined guard, not followed
126 Npc:says(_"But nothing!")
127 Npc:says(_"I don't know what you are talking about.")
128 Stone_talk_again_later = false -- Stone rejects to tell more because Tux is RG now
129 else
130 Npc:says(_"The Guards run the town with very strict laws and demand total obedience.", "NO_WAIT")
131 Npc:says(_"We all need to obey their rules. We need to work hard or they hurt us.")
132 Npc:says(_"I guess I should not complain. The bots are far worse than the guards can be, but...")
133 Npc:says(_"Sucked dry by a bloodthirsty regime over many years or just sliced into bits by our former servants...", "NO_WAIT")
134 Npc:says(_"... What's the difference?")
135 Stone_talk_again_later = false
136 show("node8")
137 end
138 hide("node4")
139 end,
140 },
141 {
142 id = "node8",
143 text = _"If things are so bad right now, why don't you leave?",
144 echo_text = false,
145 code = function()
146 Tux:says(_"If things are so bad right now, why --")
147 Npc:says(_"I don't want to hear this jabberwocky.", "NO_WAIT")
148 Npc:says(_"A hint, Linarian: We don't have much, but we're alive and we'd rather stay that way.", "NO_WAIT")
149 if (tux_has_joined_guard) then
150 Npc:says(_"You are a Red Guardian now, feel free to make attempts on making our situation better here in this town.")
151 else
152 Npc:says(_"If you want to start a revolution, you're on your own.")
153 end
154 hide("node8")
155 end,
156 },
157 {
158 id = "node10",
159 text = _"How is your business going?",
160 code = function()
161 if (Tux:done_quest("Saving the shop")) then
162 Npc:says(_"Thanks to you I have a chance now.", "NO_WAIT")
163 Npc:says(_"Ha! It's time to show the world that Lily Stone is not going down without putting up a REAL good fight.")
164 Npc:set_name("Lily Stone - Shop owner")
165 else
166 Npc:says(_"I'll be finished in about a week.", "NO_WAIT")
167 Npc:says(_"The Stone family always bought cheap and sold at a low profit. The times have changed, but not my prices.")
168 Npc:says(_"The new taxes, the worldwide economic collapse and other factors are slowly murdering the family store.")
169 show("node13", "node16")
170 end
171 hide("node10")
172 end,
173 },
174 {
175 id = "node13",
176 text = _"Can I help you somehow, Ms. Stone?",
177 code = function()
178 Npc:says(_"No, there's nothing that can be done anymore. I don't have enough money to lift the shop from the downward spiral.")
179 Npc:says(_"I'd need thousands to just survive the month.", "NO_WAIT")
180 Npc:says(_"The shop is dying, and there's nothing either of us can do about it.")
181 hide("node13", "node16") show("node15")
182 end,
183 },
184 {
185 id = "node15",
186 text = _"Maybe there is still hope, Ms. Stone. How much exactly do you need?",
187 code = function()
188 Npc:says(_"I couldn't get myself to look at my finance logs for a while now. I guess about two thousand circuits.")
189 Tux:add_quest("Saving the shop", _"Ms. Stone can't afford to pay her taxes, and it looks like the family business will be going under soon. She needs 2000 in cash to stay afloat. I could try to help her out.")
190 show_if((Tux:get_gold() > 2000), "node23")
191 hide("node15")
192 end,
193 },
194 {
195 id = "node16",
196 text = _"A pity that nothing can be done about your store.",
197 code = function()
198 Npc:says(_"Yes. A tradition of six generations will die with this shop...", "NO_WAIT")
199 Npc:says(_"I guess it just had to happen one day...")
200 hide("node13", "node16")
201 end,
202 },
203 {
204 id = "node23",
205 text = _"I have the money you need, Ms. Stone. You can have it.",
206 code = function()
207 Npc:says(_"Is... Is this a joke? So much money? And you're just giving it to me?", "NO_WAIT")
208 Npc:says(_"Thank you! Thank you! Thank you! Savior!")
209 if (tux_has_joined_guard) then -- joined guard
210 Npc:says(_"Are you sure you really have the sum of 2000 circuits?")
211 if (Tux:del_gold(2000)) then
212 Tux:says(_"Yes, I have it.")
213 Npc:says(_"Oh thank you!")
214 Tux:end_quest("Saving the shop", _"Ms. Stone seemed relieved as I gave her the money. I hope she won't need to file bankruptcy.")
215 else -- joined guard + not enough money
216 Npc:says(_"Hold on a minute, you are still a bit short on money.", "NO_WAIT")
217 Npc:says(_"Don't try to trick me.")
218 end
219 else -- not joined guard, Stone will be more kind
220 Npc:says(_"But this isn't fair to you. The Stones are a family of fair merchants and I intend to uphold that tradition.")
221 Npc:says(_"I need 1,547 circuits to get through the month. I will accept only that and not a transistor more.")
222 if (Tux:del_gold(1547)) then
223 Npc:says(_"Now it's fair. Thank you.", "NO_WAIT")
224 Npc:says(_"You've given me a bit of hope.. ", "NO_WAIT")
225 Npc:says(_"Wait a second... I think I recognize you...")
226 --; TRANSLATORS: %s = Tux:get_player_name()
227 Npc:says(_"You are %s, aren't you...?", Tux:get_player_name())
228 Npc:says(_"The hero...")
229 show("node31", "node32", "node33")
230 push_topic("Stone's Hero")
231 else -- not joined guard + not enough money
232 Npc:says(_"Hold on a minute, you are still a bit short on money.", "NO_WAIT")
233 Npc:says(_"Please return with the full amount if you want to help.", "NO_WAIT")
234 Npc:says(_"Otherwise, you're throwing good money after bad, and I couldn't let you do that.")
235 end
236 end
237 hide("node23")
238 end,
239 },
240 {
241 id = "node31",
242 text = _"Yes, it's me.",
243 topic = "Stone's Hero",
244 code = function()
245 Npc:says(_"I thought so. My grandfather used to tell me stories about you. He said you would come here in a time of despair.", "NO_WAIT")
246 Npc:says(_"And here you are.")
247 Npc:says(_"I hope your arrival changes the tide of this war...", "NO_WAIT")
248 Npc:says(_"I have something here for you. I managed to hide this Shotgun from the Red Guard.")
249 Npc:says(_"It used to belong to my grandfather, so it's very dear to me, but I'm sure he would have liked you to have it on your journey to save us all.")
250 --; TRANSLATORS: %s = Tux:get_player_name()
251 Npc:says(_"%s, if you ever find out who started the Great Assault... GIVE THEM A SWIFT KICK FROM LILY STONE!!!", Tux:get_player_name())
252 Npc:set_name("Lily Stone - Shop owner")
253 Tux:add_item("Two Barrel shotgun", 1)
254 Tux:add_item("Shotgun shells", 20)
255 Tux:end_quest("Saving the shop", _"Ms. Stone was really grateful for my help. She took only what she needed from me, and still rewarded me with a shotgun she had been hiding from the Red Guard.")
256 hide("node31", "node32", "node33")
257 pop_topic() -- "Stone's Hero"
258 end,
259 },
260 {
261 id = "node32",
262 text = _"It's not important who I am.",
263 topic = "Stone's Hero",
264 code = function()
265 Npc:says(_"If you want to remain a stranger, I will respect your wishes.", "NO_WAIT")
266 Npc:says(_"So be it.")
267 Tux:end_quest("Saving the shop", _"Ms. Stone was really grateful for my help. She took only what she needed from me.")
268 hide("node31", "node32", "node33")
269 pop_topic() -- "Stone's Hero"
270 end,
271 },
272 {
273 id = "node33",
274 text = _"Ha ha ha, you fell for it! You get nothing from me! Hahahahah!",
275 topic = "Stone's Hero",
276 code = function()
277 Npc:says(_"You... monster...", "NO_WAIT")
278 Npc:says(_"No one makes fun of Lily Stone's family store!", "NO_WAIT")
279 Npc:says(_"Say your prayers, you oversized duck!!!")
280 Tux:add_gold(1547)
281 npc_faction("crazy", _"Lily Stone - Bird Hunter")
282 Tux:end_quest("Saving the shop", _"I tricked that Ms. Stone into believing I was going to help her out. It was funny to see her get angry.")
283 hide("node31", "node32", "node33")
284 pop_topic() -- "Stone's Hero"
285 end_dialog()
286 end,
287 },
288 {
289 id = "node99",
290 text = _"See you later.",
291 code = function()
292 Npc:says_random(_"Have a nice day!",
293 _"Take care that you don't void any warranties.",
294 _"Please come back if you have any questions regarding my goods.",
295 _"I hope to see you again, soon!")
296 end_dialog()
297 end,
298 },
299 }