| 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 = { "Robotic" }, |
| 21 |
PURPOSE = "$$NAME$$ controls arena functions in the game.", |
| 22 |
BACKSTORY = "$$NAME$$ is the Arena Manager for the Red Guard.", |
| 23 |
WIKI]]-- |
| 24 |
|
| 25 |
local Npc = FDrpg.get_npc() |
| 26 |
local Tux = FDrpg.get_tux() |
| 27 |
|
| 28 |
local tr_rankings = { |
| 29 |
novice = _"Novice", |
| 30 |
elite = _"Elite", |
| 31 |
champion = _"Champion", |
| 32 |
} |
| 33 |
|
| 34 |
local function start_arena(level) |
| 35 |
arena_current_level = level |
| 36 |
arena_next_wave = 1 |
| 37 |
|
| 38 |
-- Prepare the arena |
| 39 |
change_obstacle_state("Arena-ChangingRoomDoor", "opened") |
| 40 |
change_obstacle_state("Arena-RingEntrance", "opened") |
| 41 |
|
| 42 |
next("arena_start") |
| 43 |
end |
| 44 |
|
| 45 |
return { |
| 46 |
FirstTime = function() |
| 47 |
show("botnode1") |
| 48 |
end, |
| 49 |
|
| 50 |
EveryTime = function() |
| 51 |
if (not has_met("Mike")) then |
| 52 |
Tux:says(_"Euh...hello?") |
| 53 |
Npc:says(_"Salutation: Welcome to the arena.") |
| 54 |
Npc:says(_"Presentation: The robot is M.I.K.E.", "NO_WAIT") |
| 55 |
Npc:says(_"Modern Interactive Kombat Executive.") |
| 56 |
Npc:says(_"Tasks: Multiple assignments have been programmed.") |
| 57 |
Npc:says(_"Suggestion: The arena enrollment program is open.") |
| 58 |
show("arena_enroll") |
| 59 |
else |
| 60 |
if (arena_current_level ~= nil) then |
| 61 |
if (arena_won) then |
| 62 |
Npc:says(_"You have won the arena.") |
| 63 |
if (not done_quest("Novice Arena")) then |
| 64 |
--change_obstacle_state("NoviceArenaExitDoor", "opened") |
| 65 |
display_console_message(_"Novice arena cleared!") |
| 66 |
display_big_message(_"Novice arena cleared!") |
| 67 |
Tux:end_quest("Novice Arena", _"I won the fight in the novice arena.") |
| 68 |
end |
| 69 |
if (arena_ranking == "novice") then |
| 70 |
arena_ranking = "elite" |
| 71 |
elseif (arena_ranking == "elite" and arena_current_level == "elite") then |
| 72 |
arena_ranking = "champion" |
| 73 |
end |
| 74 |
show("arena_ready") |
| 75 |
elseif (arena_withdraw) then |
| 76 |
Npc:says(_"Information: You have withdrawn the arena.") |
| 77 |
Npc:says(_"Note: You can restart it another time.") |
| 78 |
--; TRANSLATORS: This sentence use the english adage 'Better safe than sorry'. Use the equivalent adage of the language you translate. |
| 79 |
Npc:says(_"Advice: It is better to be safe than sorry.") |
| 80 |
show("arena_ready") |
| 81 |
else |
| 82 |
Npc:says(_"Information: The arena is already started.") |
| 83 |
show("arena_info_rules", "arena_info_where") hide("arena_ready") |
| 84 |
end |
| 85 |
else |
| 86 |
Npc:says_random(_"Hello.", _"Hi.") |
| 87 |
|
| 88 |
local salutations = { |
| 89 |
_"Salutations: Welcome to the arena.", |
| 90 |
_"Salutations: M.I.K.E. says hello." |
| 91 |
} |
| 92 |
if (arena_ranking ~= nil) then |
| 93 |
table.insert(salutations, _"Salutations: Greeting, Fighter.") |
| 94 |
end |
| 95 |
|
| 96 |
Npc:says_random(table.unpack(salutations)) |
| 97 |
end |
| 98 |
end |
| 99 |
|
| 100 |
show("tasks", "end") |
| 101 |
hide("sandwich", "sandwich_sudo") |
| 102 |
end, |
| 103 |
{ |
| 104 |
id = "arena_enroll", |
| 105 |
text = _"I want to fight.", |
| 106 |
code = function() |
| 107 |
arena_enroll = true, |
| 108 |
Npc:says(_"Excellent: New challengers are greatly appreciated.") |
| 109 |
Npc:says(_"Registration: Patience, it will take a little moment.") |
| 110 |
Npc:says(_"[b]...Analysis of the bio-signature.[/b]") |
| 111 |
Npc:says(_"[b]...Processing the ranking value.[/b]") |
| 112 |
Npc:says(_"[b]...Saving personal characteristics.[/b]") |
| 113 |
-- TODO: Tux can choose a nickname. This can let's other NPC react to it. |
| 114 |
Npc:says(_"[b]...Fighter registered.[/b]") |
| 115 |
--; TRANSLATORS: %s = Tux:get_player_name() |
| 116 |
Npc:says(_"Compliment: %s is the new challenger.", Tux:get_player_name()) |
| 117 |
-- TODO: Detect the level of Tux to set a higher ranking. |
| 118 |
arena_ranking = "novice" |
| 119 |
--; TRANSLATORS: %s is the ranking of Tux in the arena. |
| 120 |
Npc:says(_"Information: Your ranking has been established to be '%s'.", tr_rankings[arena_ranking]) |
| 121 |
Npc:says(_"Planning: Arena matches are freely scheduled.") |
| 122 |
Npc:says(_"Advice: Begin fighting when you are ready.") |
| 123 |
show("arena_ready") hide("arena_enroll") |
| 124 |
end, |
| 125 |
}, |
| 126 |
{ |
| 127 |
id = "arena_ready", |
| 128 |
text = _"I'm ready to fight.", |
| 129 |
code = function() |
| 130 |
arena_current_level = nil |
| 131 |
arena_won = false |
| 132 |
arena_withdraw = false |
| 133 |
|
| 134 |
--; TRANSLATORS: %s is the ranking of Tux in the arena. |
| 135 |
Npc:says(_"Information: Your ranking has been established to be '%s'.", tr_rankings[arena_ranking]) |
| 136 |
|
| 137 |
if (not arena_info_rank) then |
| 138 |
Npc:says(_"Explanation: The arena is divided into three rank levels.") |
| 139 |
Npc:says(_"First: Novice - new to the arena and bot-fighting.") |
| 140 |
Npc:says(_"Second: Elite - you are a good fighter who already knows the routine.") |
| 141 |
Npc:says(_"Third: Champion - nothing can stop you, you seek the harder challenges.") |
| 142 |
Npc:says(_"Every time you win, you are raised to the next rank.") |
| 143 |
Npc:says(_"Advice: Last rank has the most difficult challenge.") |
| 144 |
arena_info_rank = true |
| 145 |
end |
| 146 |
|
| 147 |
if (arena_ranking == "champion") then |
| 148 |
Npc:says(_"Choice: You can fight at the 'Novice', 'Elite' and 'Champion' rank.") |
| 149 |
show("arena_novice", "arena_elite", "arena_champion") |
| 150 |
elseif (arena_ranking == "elite") then |
| 151 |
Npc:says(_"Choice: You can fight at the 'Novice' and 'Elite' rank.") |
| 152 |
show("arena_novice", "arena_elite") |
| 153 |
else |
| 154 |
Npc:says(_"Beginning: You can only fight at the 'Novice' rank.") |
| 155 |
show("arena_novice") |
| 156 |
end |
| 157 |
push_topic("arena") |
| 158 |
show("arena_none") |
| 159 |
end, |
| 160 |
}, |
| 161 |
{ |
| 162 |
id = "arena_novice", |
| 163 |
topic = "arena", |
| 164 |
text = _"Let's go at 'Novice' rank.", |
| 165 |
code = function() |
| 166 |
Npc:says(_"Accepted: You have chosen the 'Novice' rank.") |
| 167 |
start_arena("novice") |
| 168 |
end, |
| 169 |
}, |
| 170 |
{ |
| 171 |
id = "arena_elite", |
| 172 |
topic = "arena", |
| 173 |
text = _"Let's go at 'Elite' rank.", |
| 174 |
code = function() |
| 175 |
Npc:says(_"Accepted: You have chosen 'Elite' rank.") |
| 176 |
start_arena("elite") |
| 177 |
end, |
| 178 |
}, |
| 179 |
{ |
| 180 |
id = "arena_champion", |
| 181 |
topic = "arena", |
| 182 |
text = _"Let's go at 'Champion' rank.", |
| 183 |
code = function() |
| 184 |
Npc:says(_"Accepted: You have chosen 'Champion' rank.") |
| 185 |
start_arena("champion") |
| 186 |
end, |
| 187 |
}, |
| 188 |
{ |
| 189 |
id = "arena_none", |
| 190 |
topic = "arena", |
| 191 |
text = _"None for now.", |
| 192 |
code = function() |
| 193 |
Npc:says(_"Accepted: You will fight later.") |
| 194 |
--; TRANSLATORS: This sentence misrepresent the english adage 'Fortune favors the brave'. Use the equivalent adage of the language you translate. |
| 195 |
Npc:says(_"Advice: Fortune favors the cautious.") |
| 196 |
hide("arena_novice", "arena_elite", "arena_champion") |
| 197 |
pop_topic("arena") |
| 198 |
end, |
| 199 |
}, |
| 200 |
{ |
| 201 |
id = "arena_start", |
| 202 |
topic = "arena", |
| 203 |
code = function() |
| 204 |
arena_starting = true |
| 205 |
|
| 206 |
if (not arena_info_rules) then |
| 207 |
next("arena_info_rules") |
| 208 |
arena_info_rules = true |
| 209 |
else |
| 210 |
next("arena_start2") |
| 211 |
end |
| 212 |
|
| 213 |
end, |
| 214 |
}, |
| 215 |
{ |
| 216 |
id = "arena_start2", |
| 217 |
topic = "arena", |
| 218 |
code = function() |
| 219 |
-- TODO: Provide information about the current wave |
| 220 |
|
| 221 |
-- TODO: Clean the arena of bot from previous fight. |
| 222 |
|
| 223 |
Npc:says(_"Preparation: Patience, it will take a little moment.") |
| 224 |
Npc:says(_"[b]...Accessing the matrix.[/b]") |
| 225 |
Npc:says(_"[b]...Initializing the environment.[/b]") |
| 226 |
Npc:says(_"[b]...Reprogramming the Arena.[/b]") |
| 227 |
Npc:says(_"Excellent: The Arena is ready.") |
| 228 |
|
| 229 |
if (not arena_info_where) then |
| 230 |
next("arena_info_where") |
| 231 |
arena_info_where = true |
| 232 |
else |
| 233 |
-- TODO: Provide 'Protip' to Tux. |
| 234 |
next("arena_start3") |
| 235 |
end |
| 236 |
end |
| 237 |
}, |
| 238 |
{ |
| 239 |
id = "arena_start3", |
| 240 |
topic = "arena", |
| 241 |
code = function() |
| 242 |
arena_starting = false |
| 243 |
|
| 244 |
pop_topic("arena") |
| 245 |
hide("arena_ready", "arena_novice", "arena_elite", "arena_champion") |
| 246 |
end_dialog() |
| 247 |
end, |
| 248 |
}, |
| 249 |
{ |
| 250 |
id = "arena_info_rules", |
| 251 |
text = _"Can you explain again?", |
| 252 |
echo_text = false, |
| 253 |
code = function() |
| 254 |
if (not arena_starting) then |
| 255 |
Tux:says(_"Can you explain again?", "NO_WAIT") |
| 256 |
end |
| 257 |
|
| 258 |
Npc:says(_"Instruction: You will fight multiple waves of bots.") |
| 259 |
Npc:says(_"Second: The wave will end when all bots are dead.") |
| 260 |
Npc:says(_"Third: Wave will be only started when you stay on the multicolor floor lamp.") |
| 261 |
Npc:says(_"Fourth: You can only withdraw between waves with the terminal at the entry.") |
| 262 |
Npc:says(_"Warning: Few waves have B.O.S.S.", "NO_WAIT") |
| 263 |
Npc:says(_"Bot Of Special Shock.") |
| 264 |
Npc:says(_"Important: B.O.S.S. are more powerful. You will be signaled to take care.") |
| 265 |
|
| 266 |
if (arena_starting) then |
| 267 |
next("arena_start2") |
| 268 |
end |
| 269 |
end, |
| 270 |
}, |
| 271 |
{ |
| 272 |
id = "arena_info_where", |
| 273 |
text = _"Where I need to go?", |
| 274 |
echo_text = false, |
| 275 |
code = function() |
| 276 |
if (not arena_starting) then |
| 277 |
Tux:says(_"Where I need to go?", "NO_WAIT") |
| 278 |
end |
| 279 |
|
| 280 |
Npc:says(_"Information: The arena is on your west in the corridor.") |
| 281 |
Npc:says(_"Direction: Continue straight ahead after the locker room.") |
| 282 |
Npc:says(_"Advice: If you see a large area surrounded by barrier, you are here.") |
| 283 |
|
| 284 |
if (arena_starting) then |
| 285 |
next("arena_start3") |
| 286 |
end |
| 287 |
end, |
| 288 |
}, |
| 289 |
{ |
| 290 |
id = "tasks", |
| 291 |
text = _"What are your tasks?", |
| 292 |
code = function() |
| 293 |
Npc:says(_"First: Control of incoming droid.") |
| 294 |
Npc:says(_"Second: Prepare the arena installation.") |
| 295 |
Npc:says(_"Third: Save and analyse combat data.") |
| 296 |
Npc:says(_"Important: Make sandwiches.") |
| 297 |
hide("tasks") show("sandwich") |
| 298 |
end, |
| 299 |
}, |
| 300 |
{ |
| 301 |
id = "sandwich", |
| 302 |
text = _"Make me a sandwich.", |
| 303 |
code = function() |
| 304 |
if (tux_has_joined_guard) then |
| 305 |
-- TODO: Make ingredient available. :) |
| 306 |
Npc:says(_"Problem: Ingredients are not available.") |
| 307 |
else |
| 308 |
Npc:says(_"Refusal: Only authorized personal can give orders.") |
| 309 |
show("sandwich_sudo") |
| 310 |
end |
| 311 |
hide("sandwich") |
| 312 |
end, |
| 313 |
}, |
| 314 |
{ |
| 315 |
id = "sandwich_sudo", |
| 316 |
text = _"sudo make me a sandwich", |
| 317 |
code = function() |
| 318 |
Npc:says(_"Annoyance: The droid is not a terminal.") |
| 319 |
hide("sandwich_sudo") |
| 320 |
end, |
| 321 |
}, |
| 322 |
{ |
| 323 |
id = "botnode1", |
| 324 |
text = _"You're not like the droids above.", |
| 325 |
code = function() |
| 326 |
Npc:says(_"I am a 571 model droid, designed for crew management.") |
| 327 |
if (tux_has_joined_guard or arena_ranking == "champion") then |
| 328 |
Npc:says(_"Do you wish any information about the 500s class?") |
| 329 |
hide("botnode1") show("botnode2", "botnode3") |
| 330 |
else |
| 331 |
Npc:says(_"Advice: If you meet a droid from the 500s class, run away, they'll kill you.") |
| 332 |
Npc:says(_"Warning: This is all you need to know.") |
| 333 |
Npc:says(_"Important: Access to this info will be disclosed when you become Elite, or a Red Guard Member.") |
| 334 |
end |
| 335 |
end, |
| 336 |
}, |
| 337 |
{ |
| 338 |
id = "botnode2", |
| 339 |
text = _"Which bots are on 500s class?", |
| 340 |
code = function() |
| 341 |
Npc:says(_"The 500s class is mostly composed by melee ranged, crew drones.", "NO_WAIT") |
| 342 |
Npc:says(_"They were designed to do all sort of tasks on a ship, except for the Harvester.") |
| 343 |
Npc:says(_"The [b]516[/b] was there for simple flight checks only. It's no longer supplied.") |
| 344 |
Npc:says(_"The [b]571[/b] is the replacement of the 516, and can be defined as a simple, jack-of-all-trades standard drone. According to data logs, they were in nearly every ship built before the Great Assault.") |
| 345 |
Npc:says(_"There is also the [b]598[/b], a highly sophisticated droid able to control the Robo-Freighter by itself.") |
| 346 |
Npc:says(_"The [b]543 Harvester[/b] is the exception. It was designed for logging, but right now, instead of harvesting trees, it may be harvesting people. If this is the case, it's advised to run away as fast as you can.") |
| 347 |
hide("botnode2") |
| 348 |
end, |
| 349 |
}, |
| 350 |
{ |
| 351 |
id = "botnode3", |
| 352 |
text = _"Shouldn't you be hostile?", |
| 353 |
code = function() |
| 354 |
--; TRANSLATORS: “Mike's” does not reefer to this bot in specific, but all Arena Management bots. |
| 355 |
Npc:says(_"Mike's currently does not uses MegaSys default firmware.", "NO_WAIT") |
| 356 |
Npc:says(_"I am running under [b]botnet-for-workgroups-3.11d[/b] Kernel.") |
| 357 |
Npc:says(_"So do not worry, I won't suddenly start attacking you.") |
| 358 |
--Tux:says(_"Yes, after all, you could just send arena bots after me, couldn't you?") |
| 359 |
hide("botnode3") |
| 360 |
end, |
| 361 |
}, |
| 362 |
{ |
| 363 |
id = "end", |
| 364 |
text = _"...", |
| 365 |
echo_text = false, |
| 366 |
code = function() |
| 367 |
-- TODO. Make Mike ask Tux to be more polite, and quit with a "good bye". |
| 368 |
-- A idea from jesusalva is to allows the traditional linarian salute. |
| 369 |
end_dialog() |
| 370 |
end, |
| 371 |
}, |
| 372 |
} |