Debian Codegraph @

data/storyline/act1/dialogs/c-net-nethack_sub.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
20 local Npc = FDrpg.get_npc()
21 local Tux = FDrpg.get_tux()
22
23 return {
24 {
25 id = "c-net-nethack_sub.everytime",
26 code = function()
27 if ((n_hp == nil) or (n_hp < 1)) then
28 next("c-net-nethack_sub.node0")
29 else
30 next("c-net-nethack_sub.node80")
31 end
32 end,
33 },
34 {
35 -- start a new nethack game
36 id = "c-net-nethack_sub.node0",
37 text = _"nethack",
38 echo_text = false,
39 code = function()
40 hide("c-net-nethack_sub.node0")
41 -- Start at level 1, amulet at level 7, win with amulet at level 1
42 n_yendor = "no"
43 n_level = 0 --level you are on
44 n_yendorlevel = 7+math.random(6) --level where you get the Amulet of Yendor!
45 if (won_nethack) then n_yendorlevel = n_yendorlevel*2 end
46 n_hp = 0 --your hitpoints
47 n_ac = 0 --your attack/armor
48 n_tricks = 0 --your tricks
49 n_emhp = 0 --enemy hitpoints
50 n_emac = 0 --enemy attack/armor
51 n_emname = ""--enemy name
52 n_emtype = 0 --enemy type 0-nothing, 1-easy, 2-medium, 3-hard
53 n_emiq = 100 --females need more health than this to use 'feminine wiles'
54
55 n_role = "" --your job
56 n_race = "" --your race
57 n_sex = "" --your sex
58 n_alignment = "" --your alignment
59 n_god = "" --your goddess
60 n_emgod = "" --your enemy god
61
62 Npc:says(_"Shall I pick a character's race, role, gender and alignment for you? [b][y/n][/b]", "NO_WAIT")
63 cli_says("> ", "NO_WAIT")
64 n_randomchoice = "no"
65 selection = 0
66 show("c-net-nethack_sub.node1", "c-net-nethack_sub.node2")
67 show("c-net-nethack_sub.node99") --Exit game option
68 end,
69 },
70 {
71 id = "c-net-nethack_sub.node1",
72 text = _"yes",
73 code = function()
74 n_randomchoice = "yes" --Pick nethack race, role, gender, alignment randomly
75 hide("c-net-nethack_sub.node1", "c-net-nethack_sub.node2")
76 next("c-net-nethack_sub.node8")
77 end,
78 },
79 {
80 id = "c-net-nethack_sub.node2",
81 text = _"no",
82 code = function()
83 hide("c-net-nethack_sub.node1", "c-net-nethack_sub.node2")
84 n_randomchoice = "no"
85 Npc:says(_"Choose your job.", "NO_WAIT")
86 cli_says("> ", "NO_WAIT")
87 show("c-net-nethack_sub.node3", "c-net-nethack_sub.node4", "c-net-nethack_sub.node5", "c-net-nethack_sub.node6", "c-net-nethack_sub.node7")
88 end,
89 },
90 {
91 id = "c-net-nethack_sub.node3",
92 text = _"Archaeologist",
93 code = function()
94 selection = 1
95 next("c-net-nethack_sub.node8")
96 end,
97 },
98 {
99 id = "c-net-nethack_sub.node4",
100 text = _"Rogue",
101 code = function()
102 selection = 2
103 next("c-net-nethack_sub.node8")
104 end,
105 },
106 {
107 id = "c-net-nethack_sub.node5",
108 text = _"Ranger",
109 code = function()
110 selection = 3
111 next("c-net-nethack_sub.node8")
112 end,
113 },
114 {
115 id = "c-net-nethack_sub.node6",
116 text = _"Tourist",
117 code = function()
118 selection = 4
119 next("c-net-nethack_sub.node8")
120 end,
121 },
122 {
123 id = "c-net-nethack_sub.node7",
124 text = _"Wizard",
125 code = function()
126 selection = 5
127 next("c-net-nethack_sub.node8")
128 end,
129 },
130 {
131 --hidden
132 id = "c-net-nethack_sub.node8",
133 text = "JOB ASSIGNMENT - BUG NODE 8 c-net sub nethack",
134 echo_text = false,
135 code = function()
136 hide("c-net-nethack_sub.node3", "c-net-nethack_sub.node4", "c-net-nethack_sub.node5", "c-net-nethack_sub.node6", "c-net-nethack_sub.node7")
137 if (selection == 0) then
138 selection = math.random(6)
139 end
140 --actual assignment --
141 if (selection == 1) then
142 n_role = _"Archaeologist"
143 n_hp = 0
144 n_tricks = 2
145 elseif (selection == 2) then
146 n_role = _"Rogue"
147 n_hp = 10
148 n_tricks = 2
149 elseif (selection == 3) then
150 n_role = _"Ranger"
151 n_hp = 20
152 n_tricks = 0
153 elseif (selection == 4) then
154 n_role = _"Tourist"
155 n_hp = -10
156 n_tricks = 0
157 elseif (selection == 5) then
158 n_role = _"Wizard"
159 n_hp = -20
160 n_tricks = 5
161 elseif (selection == 6) then -- Secret random-only job
162 n_role = _"Geologist"
163 n_hp = 15
164 n_tricks = 1
165 end
166
167 selection = 0
168
169 if (n_randomchoice == "no") then
170 Npc:says(_"Choose your race.", "NO_WAIT")
171 cli_says("> ", "NO_WAIT")
172 show("c-net-nethack_sub.node9", "c-net-nethack_sub.node10", "c-net-nethack_sub.node11", "c-net-nethack_sub.node12")
173 else
174 next("c-net-nethack_sub.node13")
175 end
176 end,
177 },
178 {
179 id = "c-net-nethack_sub.node9",
180 text = _"human",
181 code = function()
182 selection = 1
183 next("c-net-nethack_sub.node13")
184 end,
185 },
186 {
187 id = "c-net-nethack_sub.node10",
188 text = _"elf",
189 code = function()
190 selection = 2
191 next("c-net-nethack_sub.node13")
192 end,
193 },
194 {
195 id = "c-net-nethack_sub.node11",
196 text = _"gnome",
197 code = function()
198 selection = 3
199 next("c-net-nethack_sub.node13")
200 end,
201 },
202 {
203 id = "c-net-nethack_sub.node12",
204 text = _"orc",
205 code = function()
206 selection = 4
207 next("c-net-nethack_sub.node13")
208 end,
209 },
210 {
211 --hidden
212 id = "c-net-nethack_sub.node13",
213 code = function()
214 hide("c-net-nethack_sub.node9", "c-net-nethack_sub.node10", "c-net-nethack_sub.node11", "c-net-nethack_sub.node12")
215 if (selection == 0) then
216 selection = math.random(5)
217 end
218
219 --actual assignment --
220 if (selection == 1) then
221 n_race = _"human"
222 n_hp = n_hp + 100
223 n_ac = 2
224 n_tricks = n_tricks + 1
225 elseif (selection == 2) then
226 n_race = _"elf"
227 n_hp = n_hp + 90
228 n_ac = 1
229 n_tricks = n_tricks + 4
230 elseif (selection == 3) then
231 n_race = _"gnome"
232 n_hp = n_hp + 110
233 a_ac = 2
234 n_tricks = n_tricks + 2
235 elseif (selection == 4) then
236 n_race = _"orc"
237 n_hp = n_hp + 120
238 n_ac = 4
239 n_tricks = n_tricks - 1
240 elseif (selection == 5) then -- Secret random-only race
241 n_race = _"troglodyte"
242 n_hp = n_hp + 100
243 n_ac = 6
244 end
245
246 selection = 0
247 if (n_randomchoice == "no") then
248 Npc:says(_"Choose your gender.", "NO_WAIT")
249 cli_says("> ", "NO_WAIT")
250 show("c-net-nethack_sub.node14", "c-net-nethack_sub.node15")
251 else
252 next("c-net-nethack_sub.node16")
253 end
254 end,
255 },
256 {
257 id = "c-net-nethack_sub.node14",
258 text = _"male",
259 code = function()
260 selection = 1
261 next("c-net-nethack_sub.node16")
262 end,
263 },
264 {
265 id = "c-net-nethack_sub.node15",
266 text = _"female",
267 code = function()
268 selection = 2
269 next("c-net-nethack_sub.node16")
270 end,
271 },
272 {
273 --hidden
274 id = "c-net-nethack_sub.node16",
275 code = function()
276 hide("c-net-nethack_sub.node14", "c-net-nethack_sub.node15")
277 if (selection == 0) then
278 selection = math.random(2)
279 end
280
281 if (selection == 1) then
282 n_sex = _"male"
283 n_hp = n_hp + 10
284 else
285 n_sex = _"female"
286 end
287 next("c-net-nethack_sub.node20")
288 end,
289 },
290 {
291 --hidden
292 id = "c-net-nethack_sub.node20",
293 code = function()
294 -- Goddess/Gods don't give you a choice
295 local random_var = math.random(3)
296 if (random_var == 1) then n_alignment = _"a good"
297 elseif (random_var == 2) then n_alignment = _"a chaotic"
298 elseif (random_var == 3) then n_alignment = _"an evil"
299 end
300
301 random_var = math.random(3)
302 if (random_var == 1) then
303 n_god = "Inara"
304 n_tricks = n_tricks - 1
305 elseif (random_var == 2) then
306 n_god = "Freyja"
307 n_hp = n_hp + 10
308 elseif (random_var == 3) then
309 n_god = "Shakti"
310 n_ac = n_ac + 1
311 end
312
313 random_var = math.random(3)
314 if (random_var == 1) then
315 n_emgod = "Loki"
316 n_tricks = n_tricks - 1
317 elseif (random_var == 2) then
318 n_emgod = "Sutekh"
319 n_hp = n_hp - 10
320 elseif (random_var == 3) then
321 n_emgod = "Imkhullu"
322 n_ac = n_ac - 1
323 end
324
325 if (n_ac<1) then n_ac = 0 end
326 if (n_tricks<1) then n_tricks = 1 end
327
328 --; TRANSLATORS: you are $alignment, $sex, $race, $role
329 Npc:says(_"Hello, welcome to Nethack! You are %s %s %s %s.", n_alignment, n_sex, n_race, n_role, "NO_WAIT")
330 --; TRANSLATORS: both %s represent a name of a god
331 Npc:says(_"Your goddess, [b]%s[/b] desires the Amulet of Yendor, which the evil god [b]%s[/b] has hidden at the bottom of this dungeon.", n_god, n_emgod, "NO_WAIT")
332 Npc:says(_"Return with the [b]Amulet of Yendor[/b], and you shall be rewarded!", "NO_WAIT")
333 Npc:says(_"You are all alone on the surface. There is a stairway down.", "NO_WAIT")
334 show("c-net-nethack_sub.node63")
335 cli_says("> ", "NO_WAIT")
336 end,
337 },
338 {
339 -- Description + Random Encounter
340 id = "c-net-nethack_sub.node30",
341 code = function()
342 if (n_level < 0) then n_level = 0 end
343 hide("c-net-nethack_sub.node62", "c-net-nethack_sub.node63", "c-net-nethack_sub.node30")
344 if (n_level == n_yendorlevel) then -- At Yendor level
345 if (n_yendor == "no") then -- get yendor
346 Npc:says(_"The door closes behind you.", "NO_WAIT")
347 Npc:says(_"You find the [b]Amulet of Yendor[/b], and take it and suddenly feel a compulsion to go down, into the depths.", "NO_WAIT")
348 Npc:says(_"%s awaits you at the surface", n_god, "NO_WAIT")
349 n_yendor = "yes"
350 Npc:says(_"There is only an exit into the depths.", "NO_WAIT")
351 next("c-net-nethack_sub.node63")
352 else
353 Npc:says_random(_"You find nothing new here.",
354 _"You find a Fake Amulet of Yendor.",
355 _"You find emptiness.",
356 _"You find an empty room.", "NO_WAIT")
357 next("c-net-nethack_sub.node61")
358 end
359 elseif (n_level == 0) then -- At surface
360 if (n_yendor == "no") then
361 if(n_hp<70) then
362 n_hp = 70
363 Npc:says_random(_"You drink from the spring at the entrance to the cave.",
364 _"You make a quick trip to the hospital.", "NO_WAIT")
365 end
366 --; TRANSLATORS: %s = a god
367 Npc:says_random(string.format(_"%s looks at you with impatience and points you back to the entrance of the dungeon.", n_god),
368 --; TRANSLATORS: %s = a god
369 string.format(_"You find your goddess, %s, at lunch. She points back the way you came.", n_god),
370 --; TRANSLATORS: %s = a god
371 string.format(_"You come up and nearly catch %s bathing. You quickly head back the way you came.", n_god), "NO_WAIT")
372 hide("c-net-nethack_sub.node62")
373 next("c-net-nethack_sub.node63")
374 else -- have Amulet of Yendor -- WIN!
375 --; TRANSLATORS: %s = a god
376 Npc:says(_"You present the [b]Amulet of Yendor[/b] to [b]%s[/b] and you are rewarded with everlasting life.", n_god, "NO_WAIT")
377 Npc:says(_"You win!", "NO_WAIT")
378 --; TRANSLATORS: you ascended a $alignment, $sex, $race, $role in nethack
379 display_console_message(_"You ascended a %s %s %s %s in Nethack!", n_alignment, n_sex, n_race, n_role)
380 if (not won_nethack) then
381 won_nethack = true
382 Tux:improve_program("Hacking")
383 display_big_message(_"By ascending in Nethack, you have improved your Hacking ability!")
384 end
385 next("c-net-nethack_sub.node70")
386 end
387 else
388 --; TRANSLATORS: %s = n_level
389 Npc:says(_"You are on level [b]%s[/b]:", n_level, "NO_WAIT")
390 --Describe the level
391 Npc:says_random(_"You find yourself in a series of passages all alike.",
392 _"You find yourself in an underground office building.",
393 _"You find yourself in a labyrinth, with 1980's music playing mysteriously.",
394 _"You find yourself inside a Cretaceous limestone cave.",
395 _"You find yourself in an abandoned coal mine.",
396 _"You find yourself in a flooded room.",
397 _"You find yourself in a room filled with huge, transparent, hexagonal dipyramidal crystals.",
398 _"You find yourself in a passage filled with bones from the ancient past.",
399 _"You find yourself in a room filled with fresh bones.",
400 _"You find yourself in a room filled with rotting corpses.",
401 _"You find yourself in a goblin village.",
402 _"You find yourself in an abandoned gold mine.",
403 _"You find yourself. You are in a yoga room.",
404 _"You lose yourself in a misty passageway.",
405 _"You find yourself in a room filled with blinking lights.",
406 _"You find yourself in a lava tube.",
407 _"You find yourself lost in darkness.", "NO_WAIT")
408
409 --Random happenings:
410 local random_var = math.random(5)+n_level
411 -- Correct for superpowering:
412 if (n_hp > 100) then
413 level_correction = math.floor((n_hp - 100)/10 + (n_ac - 7))
414 if (level_correction - random_var > 0) then
415 random_var = random_var + math.random(level_correction - random_var)
416 end
417 end
418 if (random_var > 18) then
419 n_emtype = 6 -- even more difficult enemy
420 --get_random(...) returns a random argument
421 n_emname = get_random(_"angry woodchuck", _"platypus", _"duck", _"puffin", _"superintelligent slime mold", _"internet oracle")
422 n_emac = 10 + math.random(3)
423 n_emhp = 200 + math.random(20)
424 n_emiq = 200 + math.random(20)
425 elseif (random_var > 14) then
426 n_emtype = 5 -- extremely difficult enemy
427 n_emname = get_random(_"dragon", _"dwarf", _"basilisk", _"penguin", _"grue")
428 n_emac = 7 + math.random(3)
429 n_emhp = 150 + math.random(20)
430 n_emiq = 120 + math.random(20)
431 elseif (random_var > 11) then
432 n_emtype = 4 -- very difficult enemy
433 n_emname = get_random(_"balrog", _"daemon", _"demagogue", _"ex-girlfriend", _"jabberwock", _"ringwrath")
434 n_emac = 5 + math.random(3)
435 n_emhp = 130 + math.random(20)
436 n_emiq = 70 + math.random(20)
437 elseif (random_var > 9) then
438 n_emtype = 4 -- difficult enemy
439 n_emname = get_random(_"clippy", _"ghoul", _"ninja", _"sober pirate", _"cockatrice", _"chickatrice", _"mind flayer", _"marilith", _"vrock", _"nalfeshnee")
440 n_emac = 3 + math.random(3)
441 n_emhp = 120 + math.random(20)
442 n_emiq = 70 + math.random(20)
443 elseif (random_var > 7) then
444 n_emtype = 3 -- intermediate enemy
445 n_emname = get_random(_"politician", _"gremlin", _"incubus", _"succubus", _"awkward turtle", _"minotaur", _"goblin", _"shade", _"drunk pirate")
446 n_emac = 1 + math.random(3)
447 n_emhp = 90 + math.random(20)
448 n_emiq = 50 + math.random(20)
449 elseif (random_var > 5) then -- no enemy (free parking)!
450 n_emname = get_random(_"darkness", _"nothing", _"air", _"steam", _"shadow", _"chair", _"pet rock", _"bag of bones", _"inanimate carbon rod", _"mirage", _"hyperintelligent shade of blue")
451 n_emtype = 0 -- not an enemy
452 elseif (random_var > 3) then
453 n_emtype = 2 -- easy enemy
454 n_emname = get_random(_"woodchuck", _"MS employee", _"rooster", _"gnome", _"lawyer", _"wraith")
455 n_emac = math.random(3)
456 n_emhp = 51 + math.random(20)
457 n_emiq = 51 + math.random(20)
458 else
459 n_emtype = 1 -- very easy enemy
460 n_emname = get_random(_"bureaucrat", _"snail", _"banana slug")
461 n_emac = math.random(2)
462 n_emhp = 1 + math.random(20)
463 n_emiq = 1 + math.random(20)
464 end
465 --; TRANSLATORS: %s = enemy name
466 Npc:says_random(string.format(_"A wild [b]%s[/b] appears!", n_emname),
467 --; TRANSLATORS: %s = enemy name
468 string.format(_"You notice a [b]%s[/b] in front of you.", n_emname),
469 --; TRANSLATORS: %s = enemy name
470 string.format(_"You turn around and see a [b]%s[/b] right behind you!", n_emname),
471 --; TRANSLATORS: %s = enemy name
472 string.format(_"A [b]%s[/b] jumps out in front of you!", n_emname),
473 --; TRANSLATORS: %s = enemy name
474 string.format(_"You sneak up upon a [b]%s[/b].", n_emname), "NO_WAIT")
475 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
476 show("c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
477 if ( (n_tricks>0) or (n_sex == _"female") ) then show("c-net-nethack_sub.node52") end
478 cli_says("> ", "NO_WAIT")
479 end
480 end,
481 },
482 {
483 id = "c-net-nethack_sub.node50",
484 text = _"Attack",
485 code = function()
486 if (n_emtype == 0) then --inanimate object
487 Npc:says_random(string.format(_"You attack the inanimate %s.", n_emname),
488 _"You go to attack, but then think better.",
489 string.format(_"You charge the %s and strike a mighty blow...", n_emname),
490 _"You are puzzled as to what you plan to attack.",
491 string.format(_"You throw a fireball at the %s. It is super effective!", n_emname),
492 string.format(_"You attack the %s.", n_emname), "NO_WAIT")
493 next("c-net-nethack_sub.node61")
494 else
495 local damage = math.random((n_ac+1)*10)
496 if (damage > n_emac) then --check if you hit
497 --; TRANSLATORS %s1 = enemy name, %s2 = digit
498 Npc:says_random(string.format(_"Your fireball hits the %s causing %s damage.", n_emname, damage),
499 --; TRANSLATORS %s1 = enemy name, %s2 = digit
500 string.format(_"A bolt from your crossbow hits the %s causing %s damage.", n_emname, damage),
501 --; TRANSLATORS %s2 = digit
502 string.format(_"Your credit card causes a massive papercut of %s damage.", damage),
503 --; TRANSLATORS %s1 = enemy name, %s2 = digit
504 string.format(_"You freeze the middle of the %s causing %s damage.", n_emname, damage),
505 --; TRANSLATORS %s1 = enemy name, %s2 = digit
506 string.format(_"Your fist of wrath smites the %s causing internal bleeding and %s damage.", n_emname, damage),
507 --; TRANSLATORS %s1 = enemy name, %s2 = digit
508 string.format(_"You throw your bola at the %s, causing it to trip and take %s damage.", n_emname, damage), "NO_WAIT")
509 n_emhp = n_emhp - damage + n_emac
510 else -- no hit
511 --; TRANSLATORS: %s = enemy name
512 Npc:says_random(string.format(_"Your arrow misses the %s.", n_emname),
513 --; TRANSLATORS: %s = enemy name
514 string.format(_"Blow after blow is rained down upon the %s but they all miss.", n_emname),
515 --; TRANSLATORS: %s = enemy name
516 string.format(_"Your sword glances off the magical aura of the %s.", n_emname),
517 --; TRANSLATORS: %s = enemy name
518 string.format(_"Your really awesome attack took too long to power up, and the %s moved.", n_emname), "NO_WAIT")
519 end
520 next("c-net-nethack_sub.node60")
521 end
522 end,
523 },
524 {
525 id = "c-net-nethack_sub.node51",
526 text = _"Run",
527 code = function()
528 hide("c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node52", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
529 local random_var = math.random(3)
530 if (random_var > 2) then
531 Npc:says_random(_"You escape!",
532 _"You run away!",
533 _"You chicken out!", "NO_WAIT")
534 next("c-net-nethack_sub.node62")
535 n_level=n_level-1
536 elseif (random_var > 1) then
537 Npc:says_random(_"You escape!",
538 _"You run away!",
539 _"You chicken out!", "NO_WAIT")
540 next("c-net-nethack_sub.node63")
541 else
542 --; TRANSLATORS: %s = enemy name
543 Npc:says_random(string.format(_"The %s throws a bola at you, tripping you and stopping your escape", n_emname),
544 _"You stand there like a deer in the headlights.",
545 --; TRANSLATORS: %s = enemy name
546 string.format(_"You try to go, but the %s grabs you.", n_emname),
547 --; TRANSLATORS: %s = enemy god name
548 string.format(_"%s strikes you with fear, and you cannot move.", n_emgod),
549 --; TRANSLATORS: %s = enemy name
550 string.format(_"The %s tackles you and pins you to the floor.", n_emname),
551 _"You go to run, but you trip over your shoelace.", "NO_WAIT")
552 next("c-net-nethack_sub.node60")
553 end
554 end,
555 },
556 {
557 id = "c-net-nethack_sub.node52",
558 text = _"Trick",
559 code = function()
560 if (n_tricks>0) then
561 n_tricks = n_tricks - 1
562 if (math.random(3)>1) then
563 --; TRANSLATORS: %s = enemy name
564 Npc:says_random(string.format(_"You toss a rock. The sound distracts the %s", n_emname),
565 _"You toss a smoke-bomb and escape.",
566 --; TRANSLATORS: %s = enemy name
567 string.format(_"You stumble over a rock, creating a chain of reactions, ending in the tunnel collapsing on the %s.", n_emname),
568 _"You stab yourself with a fake dagger and pretend to be dead.",
569 --; TRANSLATORS: %s = enemy name
570 string.format(_"You walk like a duck, quack like a duck and swim like a duck. The %s figures you must be a duck.", n_emname),
571 _"You pretend to be a mime.",
572 _"You pull a rabbit from your top hat.", "NO_WAIT")
573 next("c-net-nethack_sub.node61")
574 else
575 --; TRANSLATORS: %s = enemy name
576 Npc:says_random(string.format(_"The %s is not impressed by your tricks.", n_emname),
577 --; TRANSLATORS: %s = enemy name
578 string.format("%s has seen this one before, and is not impressed.", n_emname),
579 --; TRANSLATORS: %s = enemy name
580 string.format(_"You try to act like a duck, but %s has an elephant and a lighter, and you don't want to be the punchline.", n_emname),
581 --; TRANSLATORS: %s = enemy name
582 string.format(_"%s sees your trick, and shows you an even better one.", n_emname), "NO_WAIT")
583 next("c-net-nethack_sub.node60")
584 end
585 elseif (n_sex == _"female") then
586 Npc:says(_"Not having any tricks left, you resort to you trying your feminine wiles.", "NO_WAIT")
587 if (n_hp > n_emiq) then
588 if (math.random(6)>1) then
589 --; TRANSLATORS: %s = enemy name
590 Npc:says_random(string.format(_"You succeed getting past the %s.", n_emname),
591 --; TRANSLATORS: %s = enemy name
592 string.format(_"You distract the %s long enough to escape.", n_emname),
593 --; TRANSLATORS: %s = enemy name
594 string.format(_"Your plight is noticed by a hero, who valiantly rescues you from the dastardly %s.", n_emname), "NO_WAIT")
595 next("c-net-nethack_sub.node61")
596 else
597 --; TRANSLATORS: %s = enemy name
598 Npc:says_random(string.format(_"The %s casts change gender on you.", n_emname),
599 --; TRANSLATORS: %s = enemy name
600 string.format(_"The %s curses you.", n_emname),
601 --; TRANSLATORS: %s = enemy name
602 string.format(_"The %s casts a polymorph spell.", n_emname),
603 _"The Random Number God strikes you, changing your gender.", "NO_WAIT")
604 n_sex = _"male"
605 --; TRANSLATORS n_alignment, n_sex, m_race, n_role,
606 Npc:says(_"You are now %s %s %s %s.", n_alignment, n_sex, n_race, n_role , "NO_WAIT")
607 next("c-net-nethack_sub.node60")
608 end
609 else
610 --; TRANSLATORS: %s = enemy name
611 Npc:says_random(string.format(_"The %s notes your physique, but has too high of an IQ to be impressed.", n_emname),
612 --; TRANSLATORS: %s = enemy name
613 string.format(_"%s might be more malleable if you were in better health.", n_emname), "NO_WAIT")
614 next("c-net-nethack_sub.node60")
615 end
616 else
617 next("c-net-nethack_sub.node60")
618 end
619 end,
620 },
621 {
622 id = "c-net-nethack_sub.node53",
623 text = _"Pray",
624 code = function()
625 local random_var = math.random(6)
626 if ( random_var == 6) then --16% chance:
627 Npc:says(_"Your goddess %s comes to your aid and gives you strength.", n_god, "NO_WAIT")
628 n_ac = n_ac + 2
629 n_hp = n_hp + 51
630 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
631 elseif ( random_var == 5 ) then --16% chance:
632 Npc:says(_"Your goddess %s comes to your aid and teaches you a new trick.", n_god, "NO_WAIT")
633 n_ac = n_ac + 2
634 n_tricks = n_tricks + 1
635 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
636 elseif (random_var > 2) then -- 54% chance:
637 Npc:says_random(string.format(_"Your enemy %s bestows some burdens upon you.", n_emgod),
638 string.format(_"%s overhears your prayers and curses you.", n_emgod),
639 _"While you were praying a leprechaun stole your sword.",
640 _"While you were praying a hermit crab moved into your helmet. It's his now.", "NO_WAIT")
641 n_ac = n_ac - 2
642 n_tricks = n_tricks - 1
643 if (n_ac < 1) then n_ac =0 end
644 if (n_tricks < 1) then n_tricks =0 end
645 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
646 else -- 54% chance:
647 Npc:says_random(_"Nothing happens.",
648 string.format(_"%s can't take your prayers right now, please leave a message...", n_god),
649 _"Twice nothing happens.",
650 string.format(_"%s left her cellphone at home today.", n_god),
651 _"Something, somewhere else happened.",
652 _"The Random Number God is not swayed by your petty prayers.", "NO_WAIT")
653 end
654 next("c-net-nethack_sub.node60")
655 end,
656 },
657 {
658 id = "c-net-nethack_sub.node54",
659 text = _"Xyzzy",
660 code = function()
661 if (math.random(10)>1) then --90% chance:
662 Npc:says_random(_"Nothing happens.",
663 _"Surprisingly, nothing happens.",
664 _"You are shocked, SHOCKED, to find nothing happens.",
665 _"Time was frozen then unfrozen but for you, nothing happens.",
666 _"Unexpectedly, nothing happens.",
667 _"You wait for a moment, then, suddenly, nothing happens.",
668 _"Twice nothing happens.", "NO_WAIT")
669 if (n_emtype == 0) then
670 Npc:says_random(_"You take a short nap.",
671 _"You meditate.",
672 _"You check your e-mail.",
673 _"You sip a cup of late-afternoon tea in quiet retrospection.",
674 _"You take a power nap.",
675 _"You take a long nap.",
676 _"You take a cat nap.", "NO_WAIT")
677 n_temphp = n_hp + math.random(51)
678 if (n_temphp < 256) then
679 n_hp = n_temphp
680 else
681 if (n_hp < 256) then n_hp = 256 end
682 end
683 Npc:says(_"You feel refreshed.", "NO_WAIT")
684 --; TRANSLATORS: n_ac n_tricks n_hp
685 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
686 next("c-net-nethack_sub.node61")
687 else
688 next("c-net-nethack_sub.node60")
689 end
690 else --10% chance:
691 Npc:says_random(_"Suddenly you find yourself teleported to the next level.",
692 _"Everything goes black.",
693 _"Everything goes white.",
694 _"Suddenly, there is nothing.",
695 _"Surprisingly, something happens.",
696 _"Everything goes cold and dark.",
697 _"You feel a sharp pain in your neck, and everything goes blue.", "NO_WAIT")
698 if (math.random(2) > 1) then
699 n_level = n_level + 3
700 else
701 n_level = n_level - 3
702 end
703 next("c-net-nethack_sub.node30")
704 end
705 end,
706 },
707 {
708 id = "c-net-nethack_sub.node60",
709 code = function()
710 hide("c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node52", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
711 if (n_emtype == 0) then
712 next("c-net-nethack_sub.node61")
713 else
714 if (n_emhp < 1) then
715 --; TRANSLATORS %s = enemy name
716 Npc:says_random(string.format(_"The %s passed out.", n_emname),
717 --; TRANSLATORS %s = enemy name
718 string.format(_"The %s suddenly is gone.", n_emname),
719 --; TRANSLATORS %s = enemy name
720 string.format(_"The %s ran away.", n_emname),
721 --; TRANSLATORS %s = enemy name
722 string.format(_"You push the %s off a convenient cliff.", n_emname), "NO_WAIT")
723 -- Rewards:
724 local random_var = math.random(1,4)
725 if (random_var == 4) then --Improve AC
726 Npc:says_random(_"You find prayer beads invoking the goodwill of the Random Number God.",
727 _"You find a lightning rod.",
728 _"You find a sword of greater death.",
729 _"You find a vorpal dagger.",
730 _"You find a breast plate of awesome.",
731 _"You find a spell of doom.",
732 _"You find a helmet of fire.",
733 _"You find a left boot of anti-fungus.",
734 _"You find a right boot of speed.",
735 _"You find a shank.",
736 _"You find a kevlar vest.",
737 _"You find a Hawaiian t-shirt.",
738 _"You find a credit card.",
739 _"You find a sharpened pencil.",
740 _"You find a broken glass bottle.",
741 _"You find a 'weapon'.", "NO_WAIT")
742 n_ac = n_ac + (math.random(n_emtype + 1) +1)
743 elseif (random_var == 3) then --Improve HP
744 Npc:says_random(_"You find a bandage and put it on.",
745 _"A nurse patches some of your wounds.",
746 --; TRANSLATORS: %s = god name
747 string.format(_"You drink a bottle of greater healing. %s sends some salve to sooth your wounds.", n_god),
748 _"You find an aloe vera plant.",
749 _"You apply some sunscreen from your backpack.",
750 _"You decide that you are healthier than you thought.", "NO_WAIT")
751 n_hp = n_hp +(n_emtype * 10 * math.random(3))
752 Npc:says_random(_"Your health improves.",
753 _"You feel more vigorous.",
754 _"Your arm spontaneously regenerates.",
755 _"Your leg grows back.",
756 _"Your acne clears up.",
757 _"You stop hemorrhaging blood.", "NO_WAIT")
758 elseif (random_var == 2) then --Get a trick!
759 Npc:says_random(_"You find a top hat with a rabbit.",
760 _"You find a deck of cards.",
761 _"You find a coin with two heads.",
762 _"You find a stick with two snakes wrapped around it.",
763 _"You find a magic wand.",
764 _"You find a skipping stone.",
765 _"You find a trick dagger.", "NO_WAIT")
766 n_tricks=n_tricks+1
767
768 elseif(random_var == 1) then --Status change
769 random_var = math.random(1,5)
770 if (random_var == 1) then --become good
771 Npc:says(_"You reform your wicked ways, and join the side of good.", "NO_WAIT")
772 --; TRANSLATORS: %s = enemy god name
773 Npc:says_random(string.format(_"%s is unhappy about this.", n_emgod),
774 --; TRANSLATORS: %s = god name
775 string.format(_"%s likes this.", n_god), "NO_WAIT")
776 n_alignment = _"a good"
777 elseif (random_var == 2) then --become evil
778 Npc:says(_"The urge to sin fills you, you now are evil!", "NO_WAIT")
779 --; TRANSLATORS %s = enemy god name
780 Npc:says_random(string.format(_"%s is happy about this.", n_emgod),
781 --; TRANSLATORS: %s = god name
782 string.format(_"%s is unhappy about this.", n_god), "NO_WAIT")
783 n_alignment=_"an evil"
784 elseif (random_var == 3) then --become neutral
785 Npc:says(_"You decide that good and evil are two sides of the same coin, so you take the coin.", "NO_WAIT")
786 n_alignment = _"a neutral"
787 --; TRANSLATORS: %s 1 = god name %s 2 = enemy god name
788 Npc:says(_"Both %s and %s don't know how to feel about this.", n_god, n_emgod, "NO_WAIT")
789 else --change gender
790 Npc:says_random(_"You put on a tarnished belt, and you feel something strange happen.",
791 _"You have been cursed.",
792 _"You have been blessed.",
793 _"You drink from a sparkling well, and something weird happens.",
794 _"You try on the shiny necklace you find.", "NO_WAIT")
795
796 if (n_sex == _"female") then n_sex=_"male" else n_sex=_"female" end
797 end
798 --; TRANSLATORS: you ascended a $alignment, $sex, $race, $role in nethack
799 Npc:says(_"You are now %s %s %s %s.", n_alignment, n_sex, n_race, n_role, "NO_WAIT")
800 end
801 n_emtype = 0 --no more monsters
802 else
803 damage = math.random((n_emac+1)*10)
804 if (damage > n_ac) then
805 --; TRANSLATORS: enemy name, damage (digit)
806 Npc:says_random(string.format(_"The devious %s stabs you, causing %s damage.", n_emname, damage-n_ac),
807 --; TRANSLATORS: enemy name, damage (digit)
808 string.format(_"You suffer %s damage as the %s tosses you up into the air like a ragdoll.", damage-n_ac, n_emname),
809 --; TRANSLATORS: enemy name, damage (digit)
810 string.format(_"The %s breathes fire at you, burning your map and causing %s damage.", n_emname, damage-n_ac),
811 --; TRANSLATORS: enemy name, damage (digit)
812 string.format(_"The %s throws an exploding banana at you, but you duck, so it only causes %s damage.", n_emname, damage-n_ac),
813 --; TRANSLATORS: enemy name, damage (digit)
814 string.format(_"The %s hits you with its best shot, causing %s damage.", n_emname, damage-n_ac),
815 --; TRANSLATORS: enemy name, damage (digit)
816 string.format(_"The %s hits you against the wall, causing %s of hurt.", n_emname, damage-n_ac),
817 --; TRANSLATORS: enemy name, damage (digit)
818 string.format(_"The %s snipes you with an arrow causing %s damage.", n_emname, damage-n_ac),
819 --; TRANSLATORS: enemy name, damage (digit)
820 string.format(_"The %s bites you causing %s damage.", n_emname, damage-n_ac), "NO_WAIT")
821 n_hp = n_hp - damage + n_ac
822 else
823 Npc:says_random(string.format(_"You dodge a blow from the %s.", n_emname),
824 string.format(_"%s tries to hit you, but misses.", n_emname),
825 string.format(_"%s blow hits your cap of cool, causing no damage.", n_emname),
826 string.format(_"%s pokes you really hard. You are annoyed.", n_emname),
827 string.format(_"%s takes a swing at you, but can't reach you from there.", n_emname), "NO_WAIT")
828 end
829 end
830
831 -- Did you survive?
832 if (n_hp < 1) then --No :-(
833 Npc:says_random(_"You died.",
834 _"A Valkyrie carries you off to Valhalla.",
835 _"Hermes, with Death and Sleep, asks if you've seen his Caduceus anywhere, and then brings you to the river Leith.",
836 _"Your soul finds itself travelling along the path of the moon, far away from your broken body.",
837 _"You are fully one with everything. Your battered body no longer concerns you.",
838 _"You failed to enlist the Random Number God to your side. You died.", "NO_WAIT")
839 Npc:says(_"Game over.", "NO_WAIT")
840 next("c-net-nethack_sub.node70")
841 else --Yes :-)
842 --; TRANSLATORS: all numbers
843 Npc:says(_"Your stats are: [b]%s[/b] attack/armor, [b]%s[/b] tricks, and [b]%s[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
844 if (n_emhp < 1) then
845 next("c-net-nethack_sub.node61")
846 else
847 show("c-net-nethack_sub.node50", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
848
849 if (math.random(3)>2) then
850 show("c-net-nethack_sub.node51")
851 end --you can't always run
852
853 if ((n_tricks>0) or (n_sex == _"female")) then
854 show("c-net-nethack_sub.node52")
855 end
856
857 cli_says("> ", "NO_WAIT")
858 end
859 end
860 end
861 end,
862 },
863 {
864 id = "c-net-nethack_sub.node61",
865 code = function()
866 hide("c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node52", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
867 if ((n_yendor == "yes") and (math.random(3)>2)) then --have the Amulet of Yendor
868 --; TRANSLATORS: digit
869 Npc:says(_"You come to the end of level %s and the [b]Amulet of Yendor[/b] compels you down, deeper into the depths.", n_level, "NO_WAIT")
870 next("c-net-nethack_sub.node63")
871 else --still need the Amulet of Yendor
872 --; TRANSLATORS: digit
873 Npc:says(_"You come to the end of level %s and see a way up and a way down. Which do you choose?", n_level, "NO_WAIT")
874 if (math.random(3)>1) then show("c-net-nethack_sub.node53") end
875 show("c-net-nethack_sub.node62", "c-net-nethack_sub.node63")
876 cli_says("> ", "NO_WAIT")
877 end
878 end,
879 },
880 {
881 id = "c-net-nethack_sub.node62",
882 text = _"Go Up",
883 code = function()
884 Npc:says_random(_"You climb up the ladder with care.",
885 _"You shimmy up the crevasse.",
886 _"You ascend the Gothic staircase.",
887 _"You untie the balloon.",
888 _"You wave your arms vigorously and slowly levitate up.",
889 _"You grab a nice rope someone left, and climb up it.",
890 _"Using magic, you cut foot and handholds into the rock, and use them.",
891 _"Reaching a state of total ONE-ness with the world, you break your earthly bonds, and rise upwards.",
892 _"You climb the cliff-face.",
893 _"You jump up, and pull yourself up to the next level.", "NO_WAIT")
894 n_level=n_level-1
895 next("c-net-nethack_sub.node30")
896 end,
897 },
898 {
899 id = "c-net-nethack_sub.node63",
900 text = _"Go Down",
901 code = function()
902 Npc:says_random(_"You rappel down the pit to the level below.",
903 _"You lower yourself using footholds cut long ago into the living earth.",
904 _"You take the staircase down to the lower level.",
905 _"By playing with the levers before you, you teleport into the depths below.",
906 _"You take out a shovel and start digging. Eventually you hit rock bottom.",
907 _"You carefully climb down the ladder.",
908 _"You jump into the darkness and land in the depths.", "NO_WAIT")
909 n_level=n_level+1
910 next("c-net-nethack_sub.node30")
911 end,
912 },
913 {
914 id = "c-net-nethack_sub.node70",
915 code = function()
916 n_hp = 0
917 hide("c-net-nethack_sub.node20", "c-net-nethack_sub.node62", "c-net-nethack_sub.node63", "c-net-nethack_sub.node30", "c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node52", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54", "c-net-nethack_sub.node60", "c-net-nethack_sub.node99")
918 next("after-c-net-nethack_sub")
919 end,
920 },
921 {
922 id = "c-net-nethack_sub.node80",
923 code = function()
924 --; TRNSLATORS: n_alignment, n_role, n_race, n_sex, n_god, n_level
925 Npc:says(_"Save game detected: %s %s %s %s in service to [b]%s[/b] on level [b]%d[/b].", n_alignment, n_role, n_race, n_sex, n_god, n_level, "NO_WAIT")
926 if (n_yendor == "yes") then
927 Npc:says(_"Save game has the [b]Amulet of Yendor[/b]!", "NO_WAIT")
928 end
929 cli_says("> ", "NO_WAIT")
930 show("c-net-nethack_sub.node81", "c-net-nethack_sub.node82", "c-net-nethack_sub.node83", "c-net-nethack_sub.node99")
931 end,
932 },
933 {
934 id = "c-net-nethack_sub.node81",
935 text = _"Show stats",
936 code = function()
937 --; TRANSLATORS: n_ac, n_tricks, n_hp
938 Npc:says(_"[b]%d[/b] attack/armor, [b]%d[/b] tricks, and [b]%d[/b] health", n_ac, n_tricks, n_hp, "NO_WAIT")
939 cli_says("> ", "NO_WAIT")
940 hide("c-net-nethack_sub.node81")
941 end,
942 },
943 {
944 id = "c-net-nethack_sub.node82",
945 text = _"Load Character",
946 code = function()
947 --; TRANSLATORS: both god names
948 Npc:says_random(string.format(_"[b]%s[/b], the enemy of your goddess [b]%s[/b], plans your demise with glee.", n_emgod, n_god),
949 --; TRANSLATORS: god name
950 string.format(_"The vile god [b]%s[/b] cackles that you will again flee from the dungeon in terror!", n_emgod),
951 --; TRANSLATORS: both god names
952 string.format(_"[b]%s[/b] blesses your return to the dungeon.", n_god), "NO_WAIT")
953 hide("c-net-nethack_sub.node81", "c-net-nethack_sub.node82", "c-net-nethack_sub.node83")
954 if (n_level < 1) then
955 next("c-net-nethack_sub.node30")
956 elseif (n_emhp < 1) then
957 next("c-net-nethack_sub.node61")
958 else
959 next("c-net-nethack_sub.node84")
960 end
961 end,
962 },
963 {
964 id = "c-net-nethack_sub.node83",
965 text = _"New Game",
966 code = function()
967 hide("c-net-nethack_sub.node81", "c-net-nethack_sub.node82", "c-net-nethack_sub.node83")
968 next("c-net-nethack_sub.node0")
969 end,
970 },
971 {
972 id = "c-net-nethack_sub.node84",
973 code = function()
974 --; TRANSLATORS: n_ac, n_tricks, n_hp
975 Npc:says(_"Your stats are: [b]%d[/b] attack/armor, [b]%d[/b] tricks, and [b]%d[/b] health.", n_ac, n_tricks, n_hp, "NO_WAIT")
976 --; TRANSLATORS: n_emname
977 Npc:says(_"A [b]%s[/b] is before you. What do you do?", n_emname, "NO_WAIT")
978 show("c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54")
979 if ((n_tricks>0) or (n_sex == _"female")) then show("c-net-nethack_sub.node52") end
980 cli_says("> ", "NO_WAIT")
981 end,
982 },
983 {
984 id = "c-net-nethack_sub.node99",
985 text = _"End Game",
986 code = function()
987 hide("c-net-nethack_sub.node20", "c-net-nethack_sub.node62", "c-net-nethack_sub.node63", "c-net-nethack_sub.node30", "c-net-nethack_sub.node50", "c-net-nethack_sub.node51", "c-net-nethack_sub.node52", "c-net-nethack_sub.node53", "c-net-nethack_sub.node54", "c-net-nethack_sub.node60", "c-net-nethack_sub.node99")
988 next("after-c-net-nethack_sub")
989 end,
990 },
991 }