Debian Codegraph @

data/storyline/act1/dialogs/Karol.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 PURPOSE = "Another shop keeper."
21 BACKSTORY = "$$NAME$$ probably breaks current storyline, and its fate is undecided."
22 WIKI]]--
23
24 local Npc = FDrpg.get_npc()
25 local Tux = FDrpg.get_tux()
26
27 return {
28 FirstTime = function()
29 show("node0")
30 end,
31
32 EveryTime = function()
33 if (Tux:has_met("Karol")) then
34 show("node1")
35 if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
36 Npc:says(_"Commerce today is slower than usual. I wonder if something happened.")
37 end
38 end
39
40 show("node99")
41 end,
42
43 {
44 id = "node0",
45 text = _"Hello. Can I buy something from you?",
46 code = function()
47 Npc:says(_"Hi, yes, you can buy stuff from me.")
48 Npc:says(_"My name is Karol. I sell mostly tools which are needed to manufacture bots.")
49 Npc:set_name("Karol - Shop owner")
50 hide("node0") show("node1", "node2")
51 end,
52 },
53 {
54 id = "node1",
55 text = _"What are your offers today?",
56 code = function()
57 Npc:says(_"Take a look.")
58 trade_with("Karol")
59 end,
60 },
61 {
62 id = "node2",
63 text = _"Can I buy droid parts? Like Entropy Inverters?",
64 code = function()
65 Npc:says(_"Sorry, these are all sold out.")
66 Npc:says(_"But I think a shipment will come by the next month.")
67 Tux:says(_"I can't wait that long.")
68 Npc:says(_"There is nothing I can do about it. Try exchanging with another worker, maybe?")
69 hide("node2")
70 end,
71 },
72 {
73 id = "node99",
74 text = _"See you later.",
75 code = function()
76 Npc:says(_"Bye bye.")
77 end_dialog()
78 end,
79 },
80 }