| 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 = { "Independent", "Free Spirit", "Reclusive" }, |
| 21 |
MARKERS = { ITEMID1 = "Desk Lamp", NPCID1 = "Erin" }, |
| 22 |
PURPOSE = "$$NAME$$ is a treasure hunter living in the town. $$NAME$$ complains about the amount of light in her quarters |
| 23 |
and will trade with Tux for a $$ITEMID1$$.", |
| 24 |
BACKSTORY = "$$NAME$$ may be Francis' daughter, and a spy of the Rebel Faction, but this information remains to be checked. She may also have some backstory with $$NPCID1$$ but this also remains to be checked." |
| 25 |
WIKI]]-- |
| 26 |
|
| 27 |
local Npc = FDrpg.get_npc() |
| 28 |
local Tux = FDrpg.get_tux() |
| 29 |
|
| 30 |
return { |
| 31 |
FirstTime = function() |
| 32 |
Iris_max_lessons = 5 -- the max number of lessons Iris is willing to teach |
| 33 |
Iris_lessons_taught = 0 -- the number of lessons Iris has already taught, initialized with 0 |
| 34 |
Iris_next_lesson_cost = 0 -- the training point cost of the upcoming lesson |
| 35 |
show("node0") |
| 36 |
end, |
| 37 |
|
| 38 |
EveryTime = function() |
| 39 |
if (Iris_wants_lamp) then |
| 40 |
if (Tux:has_item_backpack("Desk Lamp")) then |
| 41 |
if (Iris_deal) then |
| 42 |
Npc:says(_"Hey, remember our deal?") |
| 43 |
Npc:says(_"I'll trade you a book, for that lamp and 100 credits.") |
| 44 |
show("node7") |
| 45 |
else |
| 46 |
hide("node6") show("node5") |
| 47 |
end |
| 48 |
else |
| 49 |
Npc:says_random(_"Sure is dark around here.", |
| 50 |
_"I wish there was some decent lighting.") |
| 51 |
end |
| 52 |
end |
| 53 |
|
| 54 |
if (Iris_false_happy) and |
| 55 |
(not guard_follow_tux) then |
| 56 |
Iris_false_happy = false |
| 57 |
show("node4") |
| 58 |
end |
| 59 |
|
| 60 |
if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) and |
| 61 |
(Tux:has_met("Iris")) and |
| 62 |
(not Iris_post_firmware_upgrade) then |
| 63 |
show("Iris_post_firmware_upgrade") |
| 64 |
end |
| 65 |
|
| 66 |
show("node99") |
| 67 |
end, |
| 68 |
|
| 69 |
{ |
| 70 |
id = "node0", |
| 71 |
text = _"Hello.", |
| 72 |
code = function() |
| 73 |
Npc:says_random(_"Hello.", |
| 74 |
_"Hi there!") |
| 75 |
if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then |
| 76 |
Npc:says(_"I've heard about you.") |
| 77 |
Npc:says(_"A lot.") |
| 78 |
Npc:says(_"You're the talk of the town, actually.") |
| 79 |
Iris_post_firmware_upgrade = true |
| 80 |
show("node50", "node51", "node52") |
| 81 |
else |
| 82 |
show("node1") |
| 83 |
end |
| 84 |
hide("node0") |
| 85 |
end, |
| 86 |
}, |
| 87 |
{ |
| 88 |
id = "node1", |
| 89 |
text = _"Who are you?", |
| 90 |
code = function() |
| 91 |
Npc:says(_"I'm Iris.") |
| 92 |
Npc:set_name("Iris") |
| 93 |
Tux:says(_"Hello, Iris.") |
| 94 |
hide("node1") show("node2") |
| 95 |
end, |
| 96 |
}, |
| 97 |
{ |
| 98 |
id = "node2", |
| 99 |
text = _"What are you doing here?", |
| 100 |
code = function() |
| 101 |
Npc:says(_"I'm here just for vacations.") |
| 102 |
Tux:says(_"And what do you usually do?") |
| 103 |
Npc:says(_"Usually I hunt bots and their 'treasures'.") --she may be a spy of the rebel faction that is not yet implemented |
| 104 |
Npc:set_name("Iris - treasure hunter") |
| 105 |
hide("node2") show("node3", "node30") |
| 106 |
end, |
| 107 |
}, |
| 108 |
{ |
| 109 |
id = "node3", |
| 110 |
text = _"Where do you come from?", |
| 111 |
code = function() |
| 112 |
Npc:says(_"Nowhere and everywhere.") |
| 113 |
Npc:says(_"As I already said, I walk around, kill bots and loot their corpses.") |
| 114 |
hide("node3") show("node4") |
| 115 |
end, |
| 116 |
}, |
| 117 |
{ |
| 118 |
id = "node4", |
| 119 |
text = _"Do you like it here?", |
| 120 |
code = function() |
| 121 |
if (guard_follow_tux) then |
| 122 |
Iris_false_happy = true |
| 123 |
Npc:says(_"Yes, sure.") |
| 124 |
Npc:says(_"The Red Guard is very polite and keeps us safe from bots.") |
| 125 |
Npc:says(_"And the overall design of the town is quite clever.") |
| 126 |
Npc:says(_"Nevertheless, this room is quite dark.") |
| 127 |
Npc:says(_"It could use some light.") |
| 128 |
else |
| 129 |
Npc:says(_"Not really.") |
| 130 |
Npc:says(_"The town is quite ugly and dark.") |
| 131 |
Npc:says(_"And there are very strange people here.") |
| 132 |
Tux:says(_"I know exactly what you are talking about...") |
| 133 |
Npc:says(_"I think this room could use some decoration.") |
| 134 |
Npc:says(_"It looks so cold and dark...") |
| 135 |
end |
| 136 |
if (not Iris_traded_lamp) then |
| 137 |
Iris_wants_lamp = true |
| 138 |
if (Tux:has_item_backpack("Desk Lamp")) then |
| 139 |
show("node5") |
| 140 |
else |
| 141 |
Npc:says(_"Perhaps what I need is a lamp.") |
| 142 |
end |
| 143 |
end |
| 144 |
hide("node4") |
| 145 |
end, |
| 146 |
}, |
| 147 |
{ |
| 148 |
id = "node5", |
| 149 |
text = _"Look, I have this Lamp.", |
| 150 |
code = function() |
| 151 |
Npc:says(_"Wow, nice.") |
| 152 |
hide("node5") show("node6") |
| 153 |
end, |
| 154 |
}, |
| 155 |
{ |
| 156 |
id = "node6", |
| 157 |
text = _"You can have it.", |
| 158 |
code = function() |
| 159 |
Npc:says(_"Oh great, thanks!") |
| 160 |
Npc:says(_"Hmm, what can I give you as a thank-you...?") |
| 161 |
Npc:says(_"Oh, I have a nice book here.") |
| 162 |
Npc:says(_"But it's worth more than the old dusty lamp.") |
| 163 |
Npc:says(_"I'll give it to you for the lamp and 100 circuits.") |
| 164 |
if (Tux:get_gold() > 99) then |
| 165 |
show("node7") |
| 166 |
else |
| 167 |
Tux:says(_"I don't have that much right now.") |
| 168 |
Tux:says(_"Let me get back to you about that.") |
| 169 |
end_dialog() |
| 170 |
end |
| 171 |
hide("node6") |
| 172 |
Iris_deal = true |
| 173 |
end, |
| 174 |
}, |
| 175 |
{ |
| 176 |
id = "node7", |
| 177 |
text = _"Sure, sounds like a fair trade.", |
| 178 |
code = function() |
| 179 |
if (not Tux:has_item_backpack("Desk Lamp")) then |
| 180 |
Npc:says(_"Uhm, sorry, but where is the Desk Lamp?") |
| 181 |
Tux:says(_"Erm, ah, good question, where could it be?") |
| 182 |
Npc:says(_"Well, eff off until you have the lamp!") |
| 183 |
elseif (Tux:del_gold(100)) then |
| 184 |
Tux:says(_"Take these 100 valuable circuits.") |
| 185 |
Npc:says(_"Ok, here it is. Take this book.") |
| 186 |
Npc:says(_"It's quite old and some pages are missing, but the main message is still clear.") |
| 187 |
Tux:says(_"Oh, thanks!") |
| 188 |
Tux:del_item_backpack("Desk Lamp", 1) |
| 189 |
Tux:add_item("Source Book of Invisibility") |
| 190 |
Iris_wants_lamp = false |
| 191 |
Iris_traded_lamp = true |
| 192 |
else |
| 193 |
Npc:says(_"Don't try to trick me, fat bird.") |
| 194 |
Npc:says(_"I know you can't afford it.") |
| 195 |
Npc:says(_"Eff off until you have the right sum!") |
| 196 |
end |
| 197 |
hide("node7") |
| 198 |
end, |
| 199 |
}, |
| 200 |
{ |
| 201 |
id = "node30", |
| 202 |
text = _"Can you teach me anything about treasure-hunting?", |
| 203 |
code = function() |
| 204 |
if (Iris_lessons_taught == Iris_max_lessons) then |
| 205 |
Npc:says(_"Teach you right now?", "NO_WAIT") |
| 206 |
Npc:says(_"In your dreams, Penguin!") |
| 207 |
else |
| 208 |
Iris_next_lesson_cost = 200 * (Iris_lessons_taught + 1) |
| 209 |
Npc:says(_"It requires a certain stylization of form and technique, so you have to be in the proper mindset.", "NO_WAIT") |
| 210 |
Npc:says(_"Likewise I'll require a small gratuity for my time.", "NO_WAIT") |
| 211 |
--; TRANSLATORS: %d = number of circuits needed |
| 212 |
Npc:says(_"You will need 3 training points and %d circuits.", Iris_next_lesson_cost) |
| 213 |
Npc:says(_"Any interest?") |
| 214 |
show("node31") |
| 215 |
end |
| 216 |
hide("node30") |
| 217 |
end, |
| 218 |
}, |
| 219 |
{ |
| 220 |
id = "node31", |
| 221 |
text = _"Yes, teach me how to find bots 'treasures' more often.", |
| 222 |
code = function() |
| 223 |
if (Tux:train_program(Iris_next_lesson_cost, 3, "Treasure Hunting")) then |
| 224 |
Iris_lessons_taught = Iris_lessons_taught + 1 |
| 225 |
Npc:says(_"Good. I'll give you an algorithm better than the one you're using right now.") |
| 226 |
Npc:says(_"Try using the 0x6974656D6D6F6E6579 algorithm.") -- ItemMoney (in hex and lowercase) |
| 227 |
--; TRANSLATORS: %d = "random" one-digit number. |
| 228 |
Npc:says(_"But this time, replaces every 6 with %d61.", Iris_lessons_taught) |
| 229 |
Tux:says(_"Yes, I understand. It's so simple! How I never thought on this before.") |
| 230 |
else |
| 231 |
if (Tux:get_gold() < Iris_next_lesson_cost) then |
| 232 |
next("node40") |
| 233 |
else |
| 234 |
next("node41") |
| 235 |
end |
| 236 |
end |
| 237 |
hide("node31") show("node30") |
| 238 |
end, |
| 239 |
}, |
| 240 |
{ |
| 241 |
id = "node40", |
| 242 |
code = function() |
| 243 |
Tux:says_random(_"Hold on, I don't seem to have that much money right now.", |
| 244 |
_"This is embarrassing. I will come back when I have the amount of valuable circuits you desire.") |
| 245 |
Npc:says_random(_"I'm not going to teach you anything for free!", |
| 246 |
_"Please don't bother me if you can't even pay me.", |
| 247 |
_"Come back when you have enough circuits, penguin.") |
| 248 |
end, |
| 249 |
}, |
| 250 |
{ |
| 251 |
id = "node41", |
| 252 |
code = function() |
| 253 |
Tux:says(_"Sorry, I don't think I can process another algorithm right now.") |
| 254 |
Npc:says_random( |
| 255 |
_"Everyone has the right to be stupid, but sometimes you abuse the privilege.", |
| 256 |
_"Come back when you are going to be serious.", |
| 257 |
_"You can only learn to hunt after the hunt.") |
| 258 |
end, |
| 259 |
}, |
| 260 |
|
| 261 |
{ |
| 262 |
id = "Iris_post_firmware_upgrade", |
| 263 |
text = _"Hello.", |
| 264 |
code = function() |
| 265 |
Npc:says(_"Hello again.") |
| 266 |
Npc:says(_"I've been hearing about you all day. You're the talk of the town.") |
| 267 |
Iris_post_firmware_upgrade = true |
| 268 |
hide("Iris_post_firmware_upgrade") show("node50", "node51", "node52") |
| 269 |
end, |
| 270 |
}, |
| 271 |
{ |
| 272 |
id = "node50", |
| 273 |
text = _"Yep, that's me. I saved everyone's hide. Including yours.", |
| 274 |
code = function() |
| 275 |
Npc:says(_"You did save a lot of lives, I'll give you that.") |
| 276 |
Npc:says(_"But I wouldn't get so excited if I were you. I don't think we're in the clear yet.") |
| 277 |
hide("node50", "node51", "node52") show("node53") |
| 278 |
end, |
| 279 |
}, |
| 280 |
{ |
| 281 |
id = "node51", |
| 282 |
text = _"Oh, and what have you heard?", |
| 283 |
code = function() |
| 284 |
Npc:says(_"Pretty cool stuff, actually. I heard you practically saved the town.") |
| 285 |
Npc:says(_"You penetrated the Hell Fortress in a bold operation against all odds, and managed to sabotage every bot from here to the next MegaSys service cell over, without so much as touching any standard interface.") |
| 286 |
Npc:says(_"That's what they say, anyway.") |
| 287 |
Tux:says(_"Hehe, well, the stories people tell...") |
| 288 |
Tux:says(_"The important thing is that everyone's safe now.") |
| 289 |
Npc:says(_"Yeah. I just wish I could be as certain of that...") |
| 290 |
hide("node50", "node51", "node52") show("node53") |
| 291 |
end, |
| 292 |
}, |
| 293 |
{ |
| 294 |
id = "node52", |
| 295 |
text = _"I know what they say, but I'm really not the superhero they make me out to be.", |
| 296 |
code = function() |
| 297 |
Npc:says(_"Hey, you gotta give yourself some credit.") |
| 298 |
Npc:says(_"Infiltration and sabotage are some of the most complicated types of operations out there. And also the most fun.") |
| 299 |
Npc:says(_"And you did pretty well, by the looks of it. Especially for someone with no fingers.") |
| 300 |
Tux:says(_"Thank you... I guess.") |
| 301 |
Npc:says(_"Yeah. Although there's still a lot to be done.") |
| 302 |
hide("node50", "node51", "node52") show("node53") |
| 303 |
end, |
| 304 |
}, |
| 305 |
{ |
| 306 |
id = "node53", |
| 307 |
text = _"What do you mean?", |
| 308 |
code = function() |
| 309 |
Npc:says(_"I... I'm not sure.") |
| 310 |
Npc:says(_"It could be just background noise. Maybe it's not even that. But there's still something a little weird about it.") |
| 311 |
Npc:says(_"More than a little, when I think about it.") |
| 312 |
Tux:says(_"What are you talking about?") |
| 313 |
Npc:says(_"... I hope trusting you with this isn't a mistake.") |
| 314 |
--; TRANSLATORS: comm = communication |
| 315 |
Npc:says(_"My comm devices have been intercepting strange signals in this area, ever since I got here. It's usually scrambled beyond recognition, and I wasn't even sure it was a signal at all until recently.") |
| 316 |
Npc:says(_"It was just before you arrived, actually.") |
| 317 |
Tux:says(_"Are you saying I'm emitting some kind of signal?") |
| 318 |
Npc:says(_"No - if that were the case my equipment would've been going crazy right now. But it's definitely related to you.") |
| 319 |
Tux:says(_"But how do you know?") |
| 320 |
Npc:says(_"Because just before you arrived, everything did go crazy. At first I thought we were being nuked and the EMP was causing it.") |
| 321 |
Npc:says(_"But then I realized: someone is broadcasting, and they really wanted outreach.") |
| 322 |
Npc:says(_"It wasn't scrambled this time, and I listened. The whole thing lasted about an hour. It was mostly binary; I couldn't figure most of it out, but there were some names encoded in hex in there. Places. People.") |
| 323 |
Npc:says(_"One of them was you.") |
| 324 |
push_topic("Mysterious signal") |
| 325 |
hide("node53") show("node54") |
| 326 |
end, |
| 327 |
}, |
| 328 |
{ |
| 329 |
id = "node54", |
| 330 |
text = _"My name? What does this mean?", |
| 331 |
topic = "Mysterious signal", |
| 332 |
code = function() |
| 333 |
Npc:says(_"It means someone knew about you before the Red Guard did, and it means whoever it was broadcast it far and wide.") |
| 334 |
Npc:says(_"That's all I can make of it.") |
| 335 |
hide("node54") |
| 336 |
show("node55", "node56") |
| 337 |
end, |
| 338 |
}, |
| 339 |
{ id = "node55", |
| 340 |
text = _"I understand.", |
| 341 |
topic = "Mysterious signal", |
| 342 |
code = function() |
| 343 |
Npc:says(_"If I were you, I would be very careful. I'm sure there were a lot of hands stirring in this mess, but I think some of them weren't chopped off by a bot.") |
| 344 |
hide("node55", "node56") |
| 345 |
pop_topic() |
| 346 |
end, |
| 347 |
}, |
| 348 |
{ id = "node56", |
| 349 |
text = _"I don't understand.", |
| 350 |
topic = "Mysterious signal", |
| 351 |
code = function() |
| 352 |
Npc:says(_"I don't either, and I don't have anything more to say on the matter.") |
| 353 |
--; TRANSLATORS: previous sentence was "I don't have anything more to say on the matter" |
| 354 |
Npc:says(_"Just that I hope that your optimism will be justified.") |
| 355 |
hide("node55", "node56") |
| 356 |
pop_topic() |
| 357 |
end, |
| 358 |
}, |
| 359 |
{ |
| 360 |
id = "node99", |
| 361 |
text = _"See you later.", |
| 362 |
code = function() |
| 363 |
if (HF_FirmwareUpdateServer_uploaded_faulty_firmware_update) then |
| 364 |
Npc:says_random(_"Take care.", |
| 365 |
_"Be careful out there.", |
| 366 |
_"Keep an eye out for anything weird.", |
| 367 |
_"Remember the saying, 'Speak softly and carry a big stick.' I think you'll need that stick soon.") |
| 368 |
elseif (Iris_wants_lamp) then |
| 369 |
Npc:says(_"Bye.") |
| 370 |
else |
| 371 |
Npc:says(_"In your dreams, Penguin!") |
| 372 |
end |
| 373 |
end_dialog() |
| 374 |
end, |
| 375 |
}, |
| 376 |
} |