Debian Codegraph @

data/storyline/act1/dialogs/Bob.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" },
21 BACKSTORY = "$$NAME$$ is part of the Special Area across bridge on level 42. He guards the portal to the recption desk."
22 WIKI]]--
23
24 local Npc = FDrpg.get_npc()
25 local Tux = FDrpg.get_tux()
26
27 return {
28 FirstTime = function()
29 Tux:says(_"Hello.")
30 Npc:says(_"Hi... Wait... How did you find this place?")
31 Tux:says(_"Well, I was researching our beautiful continent, then I saw a gate, and walked through.")
32 Npc:says(_"Oh... Well, welcome to this little fortress. There are only three people - me, my friend Jim and you.")
33 Npc:says(_"There is also a 614 security droid.")
34 Tux:says(_"Yeah, I noticed...")
35 Npc:says(_"By the way, who are you?")
36 --; TRANSLATORS: %s = Tux:get_player_name()
37 Tux:says(_"I am %s.", Tux:get_player_name())
38 Tux:says(_"And, who are you?")
39 Npc:says(_"Bob. I'm guardian of these gates.")
40 Npc:set_name(_"Bob - Gate Guardian")
41 Jim:set_name(_"Jim - Portal Guardian")
42 show("node1", "node2", "node6")
43 end,
44
45 EveryTime = function()
46 if (Tux:has_quest("Ticket's price - crystal")) and
47 (not Tux:done_quest("Ticket's price - crystal")) and
48 (Tux:has_item_backpack("Red Dilithium Crystal")) then
49 show("node5")
50 else
51 hide("node5")
52 end
53
54 if Tux:has_met("Bob") then
55 Tux:says_random(_"Hello.", _"Hi again, Bob.")
56 if (Tux:done_quest("Ticket's price - crystal")) then
57 Npc:says_random(_"Hi again. ", _"Hi again, my friend.", _"Welcome back, my friend.")
58 else
59 Npc:says_random(_"Hi again, Linarian", _"Hi.", _"Welcome back.")
60 end
61 end
62
63 if (Tux_wants_taste_fruits) then
64 show("node3")
65 end
66
67 show("node99")
68 end,
69
70 {
71 id = "node1",
72 text = _"I see a room near.",
73 code = function()
74 Npc:says(_"This is the room with the portal to the other continent inside.")
75 Tux:says(_"To the other continent?!")
76 Npc:says(_"Yeah. But the gate is closed.")
77 Tux:says(_"Why?")
78 Npc:says(_"Jim told me to do that, because he is afraid that bots can teleport through the portal.")
79 Tux:says(_"But they will kill him if he stays inside a locked room!")
80 Npc:says(_"I know. But Jim doesn't fear that... He hates bots and wants to destroy them all.")
81 Tux:says(_"What's wrong with him? Is he crazy?")
82 Npc:says(_"No... That's a bad story...")
83 Npc:says(_"Spencer, the leader of Red Guard, sent a group of soldiers to scout the area, but none of them came back.")
84 Npc:says(_"He got a message from one of them before the connection terminated. This message contained two coordinates and description with just one word: [b]Portal[/b].")
85 Npc:says(_"So, he sent us to find this portal. There were 3 of us. Me, Jim and his brother. Also there was our 614. One day Jim's brother woke us up, and said that there were lots of bots around.")
86 Npc:says(_"We started to flee, but some bots were faster than we are. Jim's brother said that he would hold them as long as possible, and ordered us to run... We have never seen him again...")
87 Npc:says(_"After about four hours of running, we found this little fortress, and noticed that it was at Spencer's coordinates.","NO_WAIT")
88 Npc:says(_"We hid inside.")
89 Npc:says(_"And Jim hasn't talked since.")
90 hide("node1") show("node4")
91 Tux_heard_Bob_and_Jim_story = true
92 end,
93 },
94 {
95 id = "node2",
96 text = _"What are these two trees?",
97 code = function()
98 Npc:says(_"The trees' fruit is our only source of food. The fruit is slightly bitter and leaves your mouth like an unripe persimmon, but we've noticed our wounds are healing much faster.")
99 Tux:says(_"Wow.")
100 Npc:says(_"Yeah. I can give you some. Just ask.")
101 Tux:says(_"Thanks.")
102 Tux_wants_taste_fruits = true
103 hide("node2") show("node3")
104 end,
105 },
106 {
107 id = "node3",
108 text = _"Could you give me another fruit please?",
109 code = function()
110 Npc:says(_"Of course. Take this one.")
111 Tux:heal()
112 hide("node3")
113 end,
114 },
115 {
116 id = "node4",
117 text = _"I would like to walk inside this portal room anyways.",
118 code = function()
119 Npc:says(_"Sorry, my friend, but I can't let you do that. I need a good reason why I should open the gate for you.")
120 Tux:says(_"What about a deal? I'll help you, you'll open this gate.")
121 Npc:says(_"Good idea, but I don't need any help... Wait! My 614... Its power level is too low. I think that soon it will turn off.")
122 Npc:says(_"Well, here is my task for you: bring me one dilithium crystal. I'll need it to raise my bot's power level.")
123 Tux:says(_"Ok... but where can I find it?")
124 Npc:says(_"Hmmm... You have to go to the underground. The entrance is situated far away from here on the south. I don't know anything else.")
125 Tux:says(_"Thanks for the information. Well, I'll go then.")
126 Npc:says(_"Linarian... Please, be careful! I don't want to have same story with you as Jim had with his brother.")
127 Tux:says(_"*gulp* Ok... I'll be careful...")
128 Tux:add_quest("Ticket's price - crystal", _"I asked Bob to open a gate for me, but he said that he will open it only if I'll help him by bringing one dilithium crystal for his 614. He said that I must go somewhere to the south. Also he warned me to be careful. But I think that some bunch of stupid bots won't scare me.")
129 hide("node4")
130 end,
131 },
132 {
133 id = "node5",
134 text = _"Well, here is your difficult-to-find dilithium crystal.",
135 code = function()
136 Npc:says(_"COOL!! Give it to me.")
137 Tux:says(_"Here you go.")
138 Tux:del_item("Red Dilithium Crystal", 1)
139 Npc:says(_"Oh dude, you can't even imagine how thankful I am!")
140 if (not HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then
141 Npc:says(_"My bot is now fine: the power level is holding steady at 9001 megawatts. I won't need to worry that bots will kill me while I am sleeping! Thank you so much!")
142 else
143 Npc:says(_"My bot is now fine: the power level is holding steady at 9001 megawatts. Now I have a robot and my brother to talk to, even knowing none of them will reply my questions! Thank you so much!")
144 end
145 Npc:says(_"Here is my award for you. When we saw this place at the first time, we found some bot inside. I destroyed it and this mace dropped out of it. I'm not sure how did it appear inside, but now it's yours.")
146 Tux:add_item("Mace")
147 Tux:says(_"Thank you, Bob.")
148 Npc:says(_"Well, now I'll open the gate for you... I'm afraid that Jim will be angry because I violated his order not to open the gates... But he won't say me anything, hehehehe.")
149 Tux:end_quest("Ticket's price - crystal", _"I finally brought a dilithium crystal for Bob. He even awarded me with a mace. But my main prize is the opened gate to the room with the portal that goes to the other continent. I've finally got a ticket for a trip.")
150 hide("node5")
151 end,
152 },
153 {
154 id = "node6",
155 text = _"What is this scrap near the entrance?",
156 code = function()
157 Npc:says(_"A couple days ago few bots became our 'guests'.")
158 Tux:says(_"Yuck! I hope that you are not welcoming all guests like that.")
159 Npc:says(_"No. Do not worry about that.")
160 hide("node6")
161 end,
162 },
163 {
164 id = "node99",
165 text = _"See you later.",
166 code = function()
167 if Tux:done_quest("Ticket's price - crystal") then
168 Npc:says_random(_"See you later.", _"Goodbye, my friend.")
169 else
170 Npc:says(_"See you later, Linarian.")
171 end
172 end_dialog()
173 end,
174 },
175 }