1 /* NetHack 3.6 role.c $NHDT-Date: 1547086250 2019/01/10 02:10:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
3 /*-Copyright (c) Robert Patrick Rankin, 2012. */
4 /* NetHack may be freely redistributed. See license for details. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 /*** Table of all roles ***/
14 /* According to AD&D, HD for some classes (ex. Wizard) should be smaller
15 * (4-sided for wizards). But this is not AD&D, and using the AD&D
16 * rule here produces an unplayable character. Thus I have used a minimum
17 * of an 10-sided hit die for everything. Another AD&D change: wizards get
18 * a minimum strength of 4 since without one you can't teleport or cast
21 * As the wizard has been updated (wizard patch 5 jun '96) their HD can be
22 * brought closer into line with AD&D. This forces wizards to use magic more
23 * and distance themselves from their attackers. --LSZ
25 * With the introduction of races, some hit points and energy
26 * has been reallocated for each race. The values assigned
27 * to the roles has been reduced by the amount allocated to
30 * God names use a leading underscore to flag goddesses.
32 const struct Role roles[] = {
34 { { "Archeologist", 0 },
36 { "Field Worker", 0 },
37 { "Investigator", 0 },
41 { "Speleologist", 0 },
44 "Quetzalcoatl", "Camaxtli", "Huhetotl", /* Central American */
46 { { "
\8dl
\8cÃ
\8aw
\8eÒ", 0 },
48 { "
\98J
\93
\8eÒ", 0 },
49 { "
\92²
\8d¸
\8eÒ", 0 },
50 { "
\94
\8c@
\8eÒ", 0 },
51 { "
\8c@
\8dí
\8eÒ", 0 },
52 { "
\92T
\8c\9f\8eÒ", 0 },
53 { "
\93´
\8cA
\8aw
\8eÒ", 0 },
54 { "
\94ü
\8fp
\8eû
\8fW
\8eÒ", 0 },
56 "
\83P
\83c
\83A
\83\8b\83J
\83g
\83\8b", "
\83J
\83}
\83L
\83V
\83g
\83\8a", "
\83t
\83w
\83g
\83g
\83\8b", /* Central American */
60 "the College of Archeology",
61 "the Tomb of the Toltec Kings",
63 "
\8dl
\8cÃ
\8aw
\91å
\8aw",
64 "
\83g
\83\8b\83e
\83J
\89¤
\89Æ
\82Ì
\95æ",
71 PM_MINION_OF_HUHETOTL,
77 MH_HUMAN | MH_DWARF | MH_GNOME | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL
79 /* Str Int Wis Dex Con Cha */
80 { 7, 10, 10, 7, 7, 7 },
81 { 20, 20, 20, 10, 20, 10 },
82 /* Init Lower Higher */
83 { 11, 0, 0, 8, 1, 0 }, /* Hit points */
96 { { "Plunderer", "Plunderess" },
103 { "Chieftain", "Chieftainess" },
104 { "Conqueror", "Conqueress" } },
105 "Mitra", "Crom", "Set", /* Hyborian */
107 { { "
\96ì
\94Ø
\90l", 0 },
108 { { "
\93\90\91¯", 0 },
109 { "
\97ª
\92D
\8eÒ", 0 },
112 { "
\90N
\97ª
\8eÒ", 0 },
114 { "
\8eE
\9dC
\8eÒ", 0 },
116 { "
\90ª
\95\9e\8eÒ", 0 } },
117 "
\83~
\83g
\83\89", "
\83N
\83\8d\83\80", "
\83Z
\83g", /* Hyborian */
121 "the Camp of the Duali Tribe",
124 "
\83f
\83\85\83A
\83\8a\91°
\82Ì
\83L
\83\83\83\93\83v",
125 "
\83f
\83\85\83A
\83\8a\91°
\82Ì
\83I
\83A
\83V
\83X",
137 ART_HEART_OF_AHRIMAN,
138 MH_HUMAN | MH_ORC | ROLE_MALE | ROLE_FEMALE | ROLE_NEUTRAL
140 /* Str Int Wis Dex Con Cha */
141 { 16, 7, 7, 15, 16, 6 },
142 { 30, 6, 7, 20, 30, 7 },
143 /* Init Lower Higher */
144 { 14, 0, 0, 10, 2, 0 }, /* Hit points */
145 { 1, 0, 0, 1, 0, 1 },
156 { { "Caveman", "Cavewoman" },
157 { { "Troglodyte", 0 },
166 "Anu", "_Ishtar", "Anshar", /* Babylonian */
168 { { "
\93´
\8cA
\90l", 0 },
169 { { "
\8c\8a\8b\8f\90l", 0 },
170 { "
\8c´
\8fZ
\96¯", 0 },
171 { "
\95ú
\98Q
\8eÒ", 0 },
172 { "
\95\82\98Q
\8eÒ", 0 },
173 { "
\97·
\8ds
\8eÒ", 0 },
174 { "
\95ú
\97V
\8eÒ", 0 },
175 { "
\97V
\96q
\96¯", 0 },
176 { "
\97¬
\98Q
\8eÒ", 0 },
177 { "
\90æ
\8bì
\8eÒ", 0 } },
178 "
\83A
\83k", "_
\83C
\83V
\83\85\83^
\83\8b", "
\83A
\83\93\83V
\83\83\83\8b", /* Babylonian */
182 "the Caves of the Ancestors",
185 "
\91¾
\8cÃ
\82Ì
\93´
\8cA",
186 "
\97³
\82Ì
\89B
\82ê
\89Æ",
198 ART_SCEPTRE_OF_MIGHT,
199 MH_HUMAN | MH_DWARF | MH_GNOME | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL
201 /* Str Int Wis Dex Con Cha */
202 { 10, 7, 7, 7, 8, 6 },
203 { 30, 6, 7, 20, 30, 7 },
204 /* Init Lower Higher */
205 { 14, 0, 0, 8, 2, 0 }, /* Hit points */
206 { 1, 0, 0, 1, 0, 1 },
218 { { "Rhizotomist", 0 },
222 { "Medicus ossium", "Medica ossium" },
224 { "Magister", "Magistra" },
226 { "Chirurgeon", 0 } },
227 "_Athena", "Hermes", "Poseidon", /* Greek */
230 { { "
\8c©
\8fK
\82¢", 0 },
231 { "
\88ã
\8et
\8c©
\8fK
\82¢", 0 },
232 { "
\8aÅ
\8cì
\8et", "
\8aÅ
\8cì
\95w" },
233 { "
\88ã
\8et
\8f\95\8eè", 0 },
234 { "
\96ò
\95¨
\8eå
\94C", 0 },
235 { "
\8a¿
\95û
\88ã", 0 },
236 { "
\88ã
\8et
\8eå
\94C", 0 },
237 { "
\93à
\89È
\88ã", 0 },
238 { "
\8aO
\89È
\88ã", 0 } },
239 "_
\83A
\83e
\83i", "
\83w
\83\8b\83\81\83X", "
\83|
\83Z
\83C
\83h
\83\93", /* Greek */
243 "the Temple of Epidaurus",
244 "the Temple of Coeus",
246 "
\83G
\83s
\83_
\83E
\83\8d\83X
\8e\9b\89@",
247 "
\83R
\83C
\83I
\83X
\8e\9b\89@",
259 ART_STAFF_OF_AESCULAPIUS,
260 MH_HUMAN | MH_GNOME | ROLE_MALE | ROLE_FEMALE | ROLE_NEUTRAL,
261 /* Str Int Wis Dex Con Cha */
262 { 7, 7, 13, 7, 11, 16 },
263 { 15, 20, 20, 15, 25, 5 },
264 /* Init Lower Higher */
265 { 11, 0, 0, 8, 1, 0 }, /* Hit points */
266 { 1, 4, 0, 1, 0, 2 },
284 { "Chevalier", "Chevaliere" },
285 { "Seignieur", "Dame" },
287 "Lugh", "_Brigit", "Manannan Mac Lir", /* Celtic */
290 { { "
\8c©
\8fK
\82¢", 0 },
294 { "
\8fd
\90í
\8em", 0 },
296 { "
\8fd
\8bR
\8em", 0 },
297 { "
\8cM
\8bR
\8em", 0 },
298 { "
\90¹
\8bR
\8em", 0 } },
299 "
\83\8b\81[
\83t", "_
\83u
\83\8a\83W
\83b
\83g", "
\83}
\83i
\83\93\83i
\83\93\81E
\83}
\83N
\83\8a\81[
\83\8b", /* Celtic */
306 "
\83L
\83\83\83\81\83\8d\83b
\83g
\8fé",
307 "
\83K
\83\89\83X
\82Ì
\93\87",
319 ART_MAGIC_MIRROR_OF_MERLIN,
320 MH_HUMAN | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL,
321 /* Str Int Wis Dex Con Cha */
322 { 13, 7, 14, 8, 10, 17 },
323 { 30, 15, 15, 10, 20, 10 },
324 /* Init Lower Higher */
325 { 14, 0, 0, 8, 2, 0 }, /* Hit points */
326 { 1, 4, 0, 1, 0, 2 },
338 { { "Candidate", 0 },
341 { "Student of Stones", 0 },
342 { "Student of Waters", 0 },
343 { "Student of Metals", 0 },
344 { "Student of Winds", 0 },
345 { "Student of Fire", 0 },
347 "Shan Lai Ching", "Chih Sung-tzu", "Huan Ti", /* Chinese */
349 { { "
\95\90\93¬
\89Æ", 0 },
350 { { "
\93ü
\96å
\8aó
\96]
\8eÒ", 0 },
351 { "
\8f\89\90S
\8eÒ", 0 },
352 { "
\93ü
\96å
\8eÒ
\93`", 0 },
353 { "
\93y
\82Ì
\8fK
\82¢
\8eè", 0 },
354 { "
\90\85\82Ì
\8fK
\82¢
\8eè", 0 },
355 { "
\8bà
\82Ì
\8fK
\82¢
\8eè", 0 },
356 { "
\96Ø
\82Ì
\8fK
\82¢
\8eè", 0 },
357 { "
\89Î
\82Ì
\8fK
\82¢
\8eè", 0 },
358 { "
\96Æ
\8b\96\8aF
\93`", 0 } },
359 "
\8eR
\97\8b\90¸", "
\90Ô
\8f¼
\8eq", "
\89©
\92é", /* Chinese */
363 "the Monastery of Chan-Sune",
364 "the Monastery of the Earth-Lord",
366 "
\83`
\83\83\83\93\81E
\83X
\81[
\8fC
\93¹
\89@",
367 "
\92n
\89¤
\82Ì
\8fC
\93¹
\89@",
379 ART_EYES_OF_THE_OVERWORLD,
380 MH_HUMAN | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL | ROLE_NEUTRAL
382 /* Str Int Wis Dex Con Cha */
383 { 10, 7, 8, 8, 7, 7 },
384 { 25, 10, 20, 20, 15, 10 },
385 /* Init Lower Higher */
386 { 12, 0, 0, 8, 1, 0 }, /* Hit points */
387 { 2, 2, 0, 2, 0, 2 },
398 { { "Priest", "Priestess" },
402 { "Priest", "Priestess" },
404 { "Canon", "Canoness" },
406 { "Patriarch", "Matriarch" },
407 { "High Priest", "High Priestess" } },
408 0, 0, 0, /* deities from a randomly chosen other role will be used */
410 { { "
\91m
\97µ", "
\93ò
\91m" },
411 { { "
\8fC
\93¹
\8eÒ", "
\8fC
\93¹
\8f\97" },
414 { "
\91m
\97µ", "
\93ò
\91m" },
415 { "
\8f\95\94C
\8ei
\8dÕ", 0 },
416 { "
\90¹
\8eÒ", "
\90¹
\8f\97" },
418 { "
\91å
\8ei
\8b³", 0 },
419 { "
\91å
\91m
\8fã", 0 } },
420 0, 0, 0, /* deities from a randomly chosen other role will be used */
425 "the Temple of Nalzok",
427 "
\88Ì
\91å
\82È
\82é
\8e\9b\89@",
428 "
\83i
\83\8b\83]
\83N
\8e\9b\89@",
440 ART_MITRE_OF_HOLINESS,
441 MH_HUMAN | MH_ELF | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL | ROLE_NEUTRAL
443 /* Str Int Wis Dex Con Cha */
444 { 7, 7, 10, 7, 7, 7 },
445 { 15, 10, 30, 15, 20, 10 },
446 /* Init Lower Higher */
447 { 12, 0, 0, 8, 1, 0 }, /* Hit points */
448 { 4, 3, 0, 2, 0, 2 },
458 /* Note: Rogue precedes Ranger so that use of `-R' on the command line
459 retains its traditional meaning. */
469 { "Magsman", "Magswoman" },
471 "Issek", "Mog", "Kos", /* Nehwon */
473 { { "
\93\90\91¯", 0 },
474 { { "
\92Ç
\82¢
\82Í
\82¬", 0 },
475 { "
\82Ð
\82Á
\82½
\82
\82è", 0 },
477 { "
\82²
\82ë
\82Â
\82«", 0 },
478 { "
\82±
\82»
\82Ç
\82ë", 0 },
482 { "
\91å
\93D
\96_", 0 } },
483 "
\83C
\83Z
\83b
\83N", "
\83\82\83O", "
\83R
\83X", /* Nehwon */
487 "the Thieves' Guild Hall",
488 "the Assassins' Guild Hall",
490 "
\93\90\91¯
\83M
\83\8b\83h",
491 "
\88Ã
\8eE
\8eÒ
\83M
\83\8b\83h",
496 PM_MASTER_OF_THIEVES,
503 ART_MASTER_KEY_OF_THIEVERY,
504 MH_HUMAN | MH_ORC | ROLE_MALE | ROLE_FEMALE | ROLE_CHAOTIC,
505 /* Str Int Wis Dex Con Cha */
506 { 7, 7, 7, 10, 7, 6 },
507 { 20, 10, 10, 30, 20, 10 },
508 /* Init Lower Higher */
509 { 10, 0, 0, 8, 1, 0 }, /* Hit points */
510 { 1, 0, 0, 1, 0, 1 },
525 {"Edhel", "Elleth"}, /* elf-maid */
526 {"Ohtar", "Ohtie"}, /* warrior */
527 {"Kano", "Kanie"}, /* commander (Q.) ['a] educated guess,
528 until further research- SAC */
529 {"Arandur"," Aranduriel"}, /* king's servant, minister (Q.) - guess */
530 {"Hir", "Hiril"}, /* lord, lady (S.) ['ir] */
531 {"Aredhel", "Arwen"}, /* noble elf, maiden (S.) */
532 {"Ernil", "Elentariel"}, /* prince (S.), elf-maiden (Q.) */
533 {"Elentar", "Elentari"}, /* Star-king, -queen (Q.) */
534 "Solonor Thelandira", "Aerdrie Faenya", "Lolth", /* Elven */
538 { "Trailblazer", 0 },
539 { "Reconnoiterer", "Reconnoiteress" },
541 { "Arbalester", 0 }, /* One skilled at crossbows */
543 { "Sharpshooter", 0 },
544 { "Marksman", "Markswoman" } },
545 "Mercury", "_Venus", "Mars", /* Roman/planets */
547 { { "
\83\8c\83\93\83W
\83\83\81[", 0 },
549 { "
\8c©
\92£
\82è", 0 },
553 { "
\8b|
\95º", 0 }, /* One skilled at crossbows */
554 { "
\92\86\8b\89\8b|
\95º", 0 },
555 { "
\8fã
\8b\89\8b|
\95º", 0 },
556 { "
\8fã
\8b\89\8b|
\95º", 0 } },
557 "
\83}
\81[
\83L
\83\85\83\8a\81[", "_
\83r
\81[
\83i
\83X", "
\83}
\81[
\83Y", /* Roman/planets */
562 "the cave of the wumpus",
564 "
\83I
\83\8a\83I
\83\93\82Ì
\83L
\83\83\83\93\83v",
565 "
\83\8f\83\93\83p
\83X
\82Ì
\93´
\8cA",
569 PM_LITTLE_DOG /* Orion & canis major */,
577 ART_LONGBOW_OF_DIANA,
578 MH_HUMAN | MH_ELF | MH_GNOME | MH_ORC | ROLE_MALE | ROLE_FEMALE
579 | ROLE_NEUTRAL | ROLE_CHAOTIC,
580 /* Str Int Wis Dex Con Cha */
581 { 13, 13, 13, 9, 13, 7 },
582 { 30, 10, 10, 20, 20, 10 },
583 /* Init Lower Higher */
584 { 13, 0, 0, 6, 1, 0 }, /* Hit points */
585 { 1, 0, 0, 1, 0, 1 },
597 { { "Hatamoto", 0 }, /* Banner Knight */
598 { "Ronin", 0 }, /* no allegiance */
599 { "Ninja", "Kunoichi" }, /* secret society */
600 { "Joshu", 0 }, /* heads a castle */
601 { "Ryoshu", 0 }, /* has a territory */
602 { "Kokushu", 0 }, /* heads a province */
603 { "Daimyo", 0 }, /* a samurai lord */
604 { "Kuge", 0 }, /* Noble of the Court */
605 { "Shogun", 0 } }, /* supreme commander, warlord */
606 "_Amaterasu Omikami", "Raijin", "Susanowo", /* Japanese */
609 { { "
\8aø
\96{", 0 }, /* Banner Knight */
610 { "
\98Q
\90l", 0 }, /* no allegiance */
611 { "
\94E
\8eÒ", "
\82
\83m
\88ê" }, /* secret society */
612 { "
\8fé
\8eå", 0 }, /* heads a castle */
613 { "
\97Ì
\8eå", 0 }, /* has a territory */
614 { "
\97Ì
\8eå", 0 }, /* heads a province */
615 { "
\91å
\96¼", "
\8d\98\8c³" }, /* a samurai lord */
616 { "
\8cö
\89Æ", 0 }, /* Noble of the Court */
617 { "
\8cö
\89Æ", "
\91å
\89\9c" } }, /* supreme commander, warlord */
618 "_
\93V
\8fÆ
\91å
\90_", "
\97\8b\90_", "
\90{
\8d²
\94V
\92j", /* Japanese */
622 "the Castle of the Taro Clan",
623 "the Shogun's Castle",
625 "
\91¾
\98Y
\88ê
\91°
\82Ì
\8fé",
638 ART_TSURUGI_OF_MURAMASA,
639 MH_HUMAN | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL,
640 /* Str Int Wis Dex Con Cha */
641 { 10, 8, 7, 10, 17, 6 },
642 { 30, 10, 8, 30, 14, 8 },
643 /* Init Lower Higher */
644 { 13, 0, 0, 8, 1, 0 }, /* Hit points */
645 { 1, 0, 0, 1, 0, 1 },
659 { "Excursionist", 0 },
660 { "Peregrinator", "Peregrinatrix" },
665 { "Adventurer", 0 } },
666 "Blind Io", "_The Lady", "Offler", /* Discworld */
668 { { "
\8aÏ
\8cõ
\8bq", 0 },
669 { { "
\83v
\81[
\91¾
\98Y", "
\83v
\81[
\8eq" },
670 { "
\8aÏ
\8cõ
\8bq", 0 },
671 { "
\8eü
\97V
\97·
\8ds
\8eÒ", 0 },
672 { "
\95Õ
\97ð
\8eÒ", 0 },
673 { "
\97·
\8ds
\8eÒ", 0 },
675 { "
\8dq
\8aC
\8eÒ", 0 },
676 { "
\92T
\8c\9f\89Æ", 0 },
677 { "
\96`
\8c¯
\8eÒ", 0 } },
678 "
\96Ó
\96Ú
\82Ì
\83C
\83I", "_
\81\83\8f\97\90_
\81\84", "
\83I
\83t
\83\89\81[", /* Discworld */
683 "the Thieves' Guild Hall",
685 "
\83A
\83\93\83N
\83\82\83\8b\83|
\81[
\83N",
686 "
\93\90\91¯
\83M
\83\8b\83h",
693 PM_MASTER_OF_THIEVES,
698 ART_YENDORIAN_EXPRESS_CARD,
699 MH_HUMAN | ROLE_MALE | ROLE_FEMALE | ROLE_NEUTRAL,
700 /* Str Int Wis Dex Con Cha */
701 { 7, 10, 6, 7, 7, 10 },
702 { 15, 10, 10, 15, 30, 20 },
703 /* Init Lower Higher */
704 { 8, 0, 0, 8, 0, 0 }, /* Hit points */
705 { 1, 0, 0, 1, 0, 1 },
717 { { "Stripling", 0 },
720 { "Man-at-arms", "Woman-at-arms" },
722 { "Swashbuckler", 0 },
723 { "Hero", "Heroine" },
725 { "Lord", "Lady" } },
726 "Tyr", "Odin", "Loki", /* Norse */
728 { { "
\83\8f\83\8b\83L
\83\85\81[
\83\8c", 0 },
729 { { "
\8c©
\8fK
\82¢", 0 },
733 { "
\90í
\93¬
\95º", 0 },
734 { "
\8dU
\8c\82\95º", 0 },
736 { "
\90æ
\93±
\8eÒ", 0 },
737 { "
\83\8d\81[
\83h", "
\83\8c\83f
\83B" } },
738 "
\83`
\83\85\81[
\83\8b", "
\83I
\81[
\83f
\83B
\83\93", "
\83\8d\83L", /* Norse */
742 "the Shrine of Destiny",
743 "the cave of Surtur",
745 "
\89^
\96½
\82Ì
\90¹
\93°",
746 "
\83X
\83\8b\83g
\82Ì
\93´
\8cA",
750 NON_PM /*PM_WINTER_WOLF_CUB*/,
759 MH_HUMAN | MH_DWARF | ROLE_FEMALE | ROLE_LAWFUL | ROLE_NEUTRAL,
760 /* Str Int Wis Dex Con Cha */
761 { 10, 7, 7, 7, 10, 7 },
762 { 30, 6, 7, 20, 30, 7 },
763 /* Init Lower Higher */
764 { 14, 0, 0, 8, 2, 0 }, /* Hit points */
765 { 1, 0, 0, 1, 0, 1 },
779 { "Thaumaturge", 0 },
781 { "Enchanter", "Enchantress" },
782 { "Sorcerer", "Sorceress" },
783 { "Necromancer", 0 },
786 "Ptah", "Thoth", "Anhur", /* Egyptian */
788 { { "
\96\82\96@
\8eg
\82¢", 0 },
789 { { "
\8eè
\95i
\8et", 0 },
790 { "
\8aï
\8fp
\8et", 0 },
791 { "
\90è
\82¢
\8et", 0 },
792 { "
\97ì
\8a´
\8et", 0 },
793 { "
\8f¢
\8a«
\8et", 0 },
794 { "
\97d
\8fp
\8et", 0 },
795 { "
\96\82\8fp
\8et", 0 },
796 { "
\96\82\96@
\8eg
\82¢", 0 },
797 { "
\91å
\96\82\96@
\8eg
\82¢", 0 } },
798 "
\83v
\83^
\83n", "
\83g
\81[
\83g", "
\83A
\83\93\83t
\83\8b", /* Egyptian */
803 "the Tower of Darkness",
805 "
\8cÇ
\8d\82\82Ì
\93\83",
806 "
\88Ã
\8d\95\82Ì
\93\83",
811 PM_NEFERET_THE_GREEN,
818 ART_EYE_OF_THE_AETHIOPICA,
819 MH_HUMAN | MH_ELF | MH_GNOME | MH_ORC | ROLE_MALE | ROLE_FEMALE
820 | ROLE_NEUTRAL | ROLE_CHAOTIC,
821 /* Str Int Wis Dex Con Cha */
822 { 7, 10, 7, 7, 7, 7 },
823 { 10, 30, 10, 20, 20, 10 },
824 /* Init Lower Higher */
825 { 10, 0, 0, 8, 1, 0 }, /* Hit points */
826 { 4, 3, 0, 2, 0, 3 },
836 /* Array terminator */
840 /* The player's role, created at runtime from initial
841 * choices. This may be munged in role_init().
843 struct Role urole = {
845 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
846 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
848 "Xxx", "home", "locate",
849 NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM,
851 /* Str Int Wis Dex Con Cha */
852 { 7, 7, 7, 7, 7, 7 },
853 { 20, 15, 15, 20, 20, 10 },
854 /* Init Lower Higher */
855 { 10, 0, 0, 8, 1, 0 }, /* Hit points */
856 { 2, 0, 0, 2, 0, 3 },
868 /* Table of all races */
869 const struct Race races[] = {
884 { "
\92j", "
\8f\97" },
890 MH_HUMAN | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL | ROLE_NEUTRAL
895 /* Str Int Wis Dex Con Cha */
896 { 3, 3, 3, 3, 3, 3 },
897 { STR18(100), 18, 18, 18, 18, 18 },
898 /* Init Lower Higher */
899 { 2, 0, 0, 2, 1, 0 }, /* Hit points */
900 { 1, 0, 2, 0, 2, 0 } /* Energy */
909 "
\83G
\83\8b\83t
\82Ì",
918 MH_ELF | ROLE_MALE | ROLE_FEMALE | ROLE_CHAOTIC,
922 /* Str Int Wis Dex Con Cha */
923 { 3, 3, 3, 3, 3, 3 },
924 { 18, 20, 20, 18, 16, 18 },
925 /* Init Lower Higher */
926 { 1, 0, 0, 1, 1, 0 }, /* Hit points */
927 { 2, 0, 3, 0, 3, 0 } /* Energy */
935 "
\83h
\83\8f\81[
\83t",
936 "
\83h
\83\8f\81[
\83t
\82Ì",
937 "
\83h
\83\8f\81[
\83t",
945 MH_DWARF | ROLE_MALE | ROLE_FEMALE | ROLE_LAWFUL,
949 /* Str Int Wis Dex Con Cha */
950 { 3, 3, 3, 3, 3, 3 },
951 { STR18(100), 16, 16, 20, 20, 16 },
952 /* Init Lower Higher */
953 { 4, 0, 0, 3, 2, 0 }, /* Hit points */
954 { 0, 0, 0, 0, 0, 0 } /* Energy */
963 "
\83m
\81[
\83\80\82Ì",
972 MH_GNOME | ROLE_MALE | ROLE_FEMALE | ROLE_NEUTRAL,
976 /* Str Int Wis Dex Con Cha */
977 { 3, 3, 3, 3, 3, 3 },
978 { STR18(50), 19, 18, 18, 18, 18 },
979 /* Init Lower Higher */
980 { 1, 0, 0, 1, 0, 0 }, /* Hit points */
981 { 2, 0, 2, 0, 2, 0 } /* Energy */
999 MH_ORC | ROLE_MALE | ROLE_FEMALE | ROLE_CHAOTIC,
1002 MH_HUMAN | MH_ELF | MH_DWARF,
1003 /* Str Int Wis Dex Con Cha */
1004 { 3, 3, 3, 3, 3, 3 },
1005 { STR18(50), 16, 16, 18, 18, 16 },
1006 /* Init Lower Higher */
1007 { 1, 0, 0, 1, 0, 0 }, /* Hit points */
1008 { 1, 0, 1, 0, 1, 0 } /* Energy */
1010 /* Array terminator */
1014 /* The player's race, created at runtime from initial
1015 * choices. This may be munged in role_init().
1017 struct Race urace = {
1031 /* Str Int Wis Dex Con Cha */
1032 { 3, 3, 3, 3, 3, 3 },
1033 { STR18(100), 18, 18, 18, 18, 18 },
1034 /* Init Lower Higher */
1035 { 2, 0, 0, 2, 1, 0 }, /* Hit points */
1036 { 1, 0, 2, 0, 2, 0 } /* Energy */
1039 /* Table of all genders */
1041 - steed.c kick_steed() He[]
\82É
\92l
\82ª
\83R
\83s
\81[
\82³
\82ê
\82é
\82Ì
\82Å
\92·
\82³
\82ð
\95Ï
\82¦
\82½
\82Æ
\82«
\82É
\82Í
1042 \8aY
\93\96\95\94\82à
\97v
\8fC
\90³
\81B
1044 const struct Gender genders[] = {
1046 { "male", "he", "him", "his", "Mal", ROLE_MALE },
1047 { "female", "she", "her", "her", "Fem", ROLE_FEMALE },
1048 { "neuter", "it", "it", "its", "Ntr", ROLE_NEUTER }
1050 { "
\92j
\90«", "
\94Þ", "
\94Þ", "
\94Þ
\82Ì", "Mal", ROLE_MALE },
1051 { "
\8f\97\90«", "
\94Þ
\8f\97", "
\94Þ
\8f\97", "
\94Þ
\8f\97\82Ì", "Fem", ROLE_FEMALE },
1052 { "
\92\86\90«", "
\82»
\82ê", "
\82»
\82ê", "
\82»
\82Ì", "Ntr", ROLE_NEUTER }
1056 /* Table of all alignments */
1057 const struct Align aligns[] = {
1059 { "law", "lawful", "Law", ROLE_LAWFUL, A_LAWFUL },
1060 { "balance", "neutral", "Neu", ROLE_NEUTRAL, A_NEUTRAL },
1061 { "chaos", "chaotic", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
1062 { "evil", "unaligned", "Una", 0, A_NONE }
1064 { "
\92\81\8f\98", "
\92\81\8f\98\82Ì", "Law", ROLE_LAWFUL, A_LAWFUL },
1065 { "
\92\86\97§", "
\92\86\97§
\82Ì", "Neu", ROLE_NEUTRAL, A_NEUTRAL },
1066 { "
\8d¬
\93×", "
\8d¬
\93×
\82Ì", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
1067 { "
\96³
\90S", "
\96³
\90S
\82Ì", "Una", 0, A_NONE }
1073 boolean roles[SIZE(roles)];
1077 STATIC_DCL int NDECL(randrole_filtered);
1078 STATIC_DCL char *FDECL(promptsep, (char *, int));
1079 STATIC_DCL int FDECL(role_gendercount, (int));
1080 STATIC_DCL int FDECL(race_alignmentcount, (int));
1082 /* used by str2XXX() */
1084 static char NEARDATA randomstr[] = "random";
1086 static char NEARDATA randomstr[] = "
\83\89\83\93\83_
\83\80";
1092 return (boolean) (rolenum >= 0 && rolenum < SIZE(roles) - 1);
1096 randrole(for_display)
1097 boolean for_display;
1099 int res = SIZE(roles) - 1;
1102 res = rn2_on_display_rng(res);
1111 int i, n = 0, set[SIZE(roles)];
1113 /* this doesn't rule out impossible combinations but attempts to
1114 honor all the filter masks */
1115 for (i = 0; i < SIZE(roles); ++i)
1116 if (ok_role(i, ROLE_NONE, ROLE_NONE, ROLE_NONE)
1117 && ok_race(i, ROLE_RANDOM, ROLE_NONE, ROLE_NONE)
1118 && ok_gend(i, ROLE_NONE, ROLE_RANDOM, ROLE_NONE)
1119 && ok_align(i, ROLE_NONE, ROLE_NONE, ROLE_RANDOM))
1121 return n ? set[rn2(n)] : randrole(FALSE);
1131 if (!str || !str[0])
1134 /* Match as much of str as is provided */
1136 for (i = 0; roles[i].name.m; i++) {
1137 /* Does it match the male name? */
1138 if (!strncmpi(str, roles[i].name.m, len))
1140 /* Or the female name? */
1141 if (roles[i].name.f && !strncmpi(str, roles[i].name.f, len))
1143 /* Or the filecode? */
1144 if (!strcmpi(str, roles[i].filecode))
1148 if ((len == 1 && (*str == '*' || *str == '@'))
1149 || !strncmpi(str, randomstr, len))
1152 /* Couldn't find anything appropriate */
1157 validrace(rolenum, racenum)
1158 int rolenum, racenum;
1160 /* Assumes validrole */
1161 return (boolean) (racenum >= 0 && racenum < SIZE(races) - 1
1162 && (roles[rolenum].allow & races[racenum].allow
1172 /* Count the number of valid races */
1173 for (i = 0; races[i].noun; i++)
1174 if (roles[rolenum].allow & races[i].allow & ROLE_RACEMASK)
1177 /* Pick a random race */
1178 /* Use a factor of 100 in case of bad random number generators */
1180 n = rn2(n * 100) / 100;
1181 for (i = 0; races[i].noun; i++)
1182 if (roles[rolenum].allow & races[i].allow & ROLE_RACEMASK) {
1189 /* This role has no permitted races? */
1190 return rn2(SIZE(races) - 1);
1200 if (!str || !str[0])
1203 /* Match as much of str as is provided */
1205 for (i = 0; races[i].noun; i++) {
1206 /* Does it match the noun? */
1207 if (!strncmpi(str, races[i].noun, len))
1209 /* Or the filecode? */
1210 if (!strcmpi(str, races[i].filecode))
1214 if ((len == 1 && (*str == '*' || *str == '@'))
1215 || !strncmpi(str, randomstr, len))
1218 /* Couldn't find anything appropriate */
1223 validgend(rolenum, racenum, gendnum)
1224 int rolenum, racenum, gendnum;
1226 /* Assumes validrole and validrace */
1227 return (boolean) (gendnum >= 0 && gendnum < ROLE_GENDERS
1228 && (roles[rolenum].allow & races[racenum].allow
1229 & genders[gendnum].allow & ROLE_GENDMASK));
1233 randgend(rolenum, racenum)
1234 int rolenum, racenum;
1238 /* Count the number of valid genders */
1239 for (i = 0; i < ROLE_GENDERS; i++)
1240 if (roles[rolenum].allow & races[racenum].allow & genders[i].allow
1244 /* Pick a random gender */
1247 for (i = 0; i < ROLE_GENDERS; i++)
1248 if (roles[rolenum].allow & races[racenum].allow & genders[i].allow
1256 /* This role/race has no permitted genders? */
1257 return rn2(ROLE_GENDERS);
1267 if (!str || !str[0])
1270 /* Match as much of str as is provided */
1272 for (i = 0; i < ROLE_GENDERS; i++) {
1273 /* Does it match the adjective? */
1274 if (!strncmpi(str, genders[i].adj, len))
1276 /* Or the filecode? */
1277 if (!strcmpi(str, genders[i].filecode))
1280 if ((len == 1 && (*str == '*' || *str == '@'))
1281 || !strncmpi(str, randomstr, len))
1284 /* Couldn't find anything appropriate */
1289 validalign(rolenum, racenum, alignnum)
1290 int rolenum, racenum, alignnum;
1292 /* Assumes validrole and validrace */
1293 return (boolean) (alignnum >= 0 && alignnum < ROLE_ALIGNS
1294 && (roles[rolenum].allow & races[racenum].allow
1295 & aligns[alignnum].allow & ROLE_ALIGNMASK));
1299 randalign(rolenum, racenum)
1300 int rolenum, racenum;
1304 /* Count the number of valid alignments */
1305 for (i = 0; i < ROLE_ALIGNS; i++)
1306 if (roles[rolenum].allow & races[racenum].allow & aligns[i].allow
1310 /* Pick a random alignment */
1313 for (i = 0; i < ROLE_ALIGNS; i++)
1314 if (roles[rolenum].allow & races[racenum].allow & aligns[i].allow
1322 /* This role/race has no permitted alignments? */
1323 return rn2(ROLE_ALIGNS);
1333 if (!str || !str[0])
1336 /* Match as much of str as is provided */
1338 for (i = 0; i < ROLE_ALIGNS; i++) {
1339 /* Does it match the adjective? */
1340 if (!strncmpi(str, aligns[i].adj, len))
1342 /* Or the filecode? */
1343 if (!strcmpi(str, aligns[i].filecode))
1346 if ((len == 1 && (*str == '*' || *str == '@'))
1347 || !strncmpi(str, randomstr, len))
1350 /* Couldn't find anything appropriate */
1354 /* is rolenum compatible with any racenum/gendnum/alignnum constraints? */
1356 ok_role(rolenum, racenum, gendnum, alignnum)
1357 int rolenum, racenum, gendnum, alignnum;
1362 if (rolenum >= 0 && rolenum < SIZE(roles) - 1) {
1363 if (rfilter.roles[rolenum])
1365 allow = roles[rolenum].allow;
1366 if (racenum >= 0 && racenum < SIZE(races) - 1
1367 && !(allow & races[racenum].allow & ROLE_RACEMASK))
1369 if (gendnum >= 0 && gendnum < ROLE_GENDERS
1370 && !(allow & genders[gendnum].allow & ROLE_GENDMASK))
1372 if (alignnum >= 0 && alignnum < ROLE_ALIGNS
1373 && !(allow & aligns[alignnum].allow & ROLE_ALIGNMASK))
1377 /* random; check whether any selection is possible */
1378 for (i = 0; i < SIZE(roles) - 1; i++) {
1379 if (rfilter.roles[i])
1381 allow = roles[i].allow;
1382 if (racenum >= 0 && racenum < SIZE(races) - 1
1383 && !(allow & races[racenum].allow & ROLE_RACEMASK))
1385 if (gendnum >= 0 && gendnum < ROLE_GENDERS
1386 && !(allow & genders[gendnum].allow & ROLE_GENDMASK))
1388 if (alignnum >= 0 && alignnum < ROLE_ALIGNS
1389 && !(allow & aligns[alignnum].allow & ROLE_ALIGNMASK))
1397 /* pick a random role subject to any racenum/gendnum/alignnum constraints */
1398 /* If pickhow == PICK_RIGID a role is returned only if there is */
1399 /* a single possibility */
1401 pick_role(racenum, gendnum, alignnum, pickhow)
1402 int racenum, gendnum, alignnum, pickhow;
1405 int roles_ok = 0, set[SIZE(roles)];
1407 for (i = 0; i < SIZE(roles) - 1; i++) {
1408 if (ok_role(i, racenum, gendnum, alignnum)
1409 && ok_race(i, (racenum >= 0) ? racenum : ROLE_RANDOM,
1411 && ok_gend(i, racenum,
1412 (gendnum >= 0) ? gendnum : ROLE_RANDOM, alignnum)
1413 && ok_race(i, racenum,
1414 gendnum, (alignnum >= 0) ? alignnum : ROLE_RANDOM))
1415 set[roles_ok++] = i;
1417 if (roles_ok == 0 || (roles_ok > 1 && pickhow == PICK_RIGID))
1419 return set[rn2(roles_ok)];
1422 /* is racenum compatible with any rolenum/gendnum/alignnum constraints? */
1424 ok_race(rolenum, racenum, gendnum, alignnum)
1425 int rolenum, racenum, gendnum, alignnum;
1430 if (racenum >= 0 && racenum < SIZE(races) - 1) {
1431 if (rfilter.mask & races[racenum].selfmask)
1433 allow = races[racenum].allow;
1434 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1435 && !(allow & roles[rolenum].allow & ROLE_RACEMASK))
1437 if (gendnum >= 0 && gendnum < ROLE_GENDERS
1438 && !(allow & genders[gendnum].allow & ROLE_GENDMASK))
1440 if (alignnum >= 0 && alignnum < ROLE_ALIGNS
1441 && !(allow & aligns[alignnum].allow & ROLE_ALIGNMASK))
1445 /* random; check whether any selection is possible */
1446 for (i = 0; i < SIZE(races) - 1; i++) {
1447 if (rfilter.mask & races[i].selfmask)
1449 allow = races[i].allow;
1450 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1451 && !(allow & roles[rolenum].allow & ROLE_RACEMASK))
1453 if (gendnum >= 0 && gendnum < ROLE_GENDERS
1454 && !(allow & genders[gendnum].allow & ROLE_GENDMASK))
1456 if (alignnum >= 0 && alignnum < ROLE_ALIGNS
1457 && !(allow & aligns[alignnum].allow & ROLE_ALIGNMASK))
1465 /* Pick a random race subject to any rolenum/gendnum/alignnum constraints.
1466 If pickhow == PICK_RIGID a race is returned only if there is
1467 a single possibility. */
1469 pick_race(rolenum, gendnum, alignnum, pickhow)
1470 int rolenum, gendnum, alignnum, pickhow;
1475 for (i = 0; i < SIZE(races) - 1; i++) {
1476 if (ok_race(rolenum, i, gendnum, alignnum))
1479 if (races_ok == 0 || (races_ok > 1 && pickhow == PICK_RIGID))
1481 races_ok = rn2(races_ok);
1482 for (i = 0; i < SIZE(races) - 1; i++) {
1483 if (ok_race(rolenum, i, gendnum, alignnum)) {
1493 /* is gendnum compatible with any rolenum/racenum/alignnum constraints? */
1494 /* gender and alignment are not comparable (and also not constrainable) */
1496 ok_gend(rolenum, racenum, gendnum, alignnum)
1497 int rolenum, racenum, gendnum;
1498 int alignnum UNUSED;
1503 if (gendnum >= 0 && gendnum < ROLE_GENDERS) {
1504 if (rfilter.mask & genders[gendnum].allow)
1506 allow = genders[gendnum].allow;
1507 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1508 && !(allow & roles[rolenum].allow & ROLE_GENDMASK))
1510 if (racenum >= 0 && racenum < SIZE(races) - 1
1511 && !(allow & races[racenum].allow & ROLE_GENDMASK))
1515 /* random; check whether any selection is possible */
1516 for (i = 0; i < ROLE_GENDERS; i++) {
1517 if (rfilter.mask & genders[i].allow)
1519 allow = genders[i].allow;
1520 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1521 && !(allow & roles[rolenum].allow & ROLE_GENDMASK))
1523 if (racenum >= 0 && racenum < SIZE(races) - 1
1524 && !(allow & races[racenum].allow & ROLE_GENDMASK))
1532 /* pick a random gender subject to any rolenum/racenum/alignnum constraints */
1533 /* gender and alignment are not comparable (and also not constrainable) */
1534 /* If pickhow == PICK_RIGID a gender is returned only if there is */
1535 /* a single possibility */
1537 pick_gend(rolenum, racenum, alignnum, pickhow)
1538 int rolenum, racenum, alignnum, pickhow;
1543 for (i = 0; i < ROLE_GENDERS; i++) {
1544 if (ok_gend(rolenum, racenum, i, alignnum))
1547 if (gends_ok == 0 || (gends_ok > 1 && pickhow == PICK_RIGID))
1549 gends_ok = rn2(gends_ok);
1550 for (i = 0; i < ROLE_GENDERS; i++) {
1551 if (ok_gend(rolenum, racenum, i, alignnum)) {
1561 /* is alignnum compatible with any rolenum/racenum/gendnum constraints? */
1562 /* alignment and gender are not comparable (and also not constrainable) */
1564 ok_align(rolenum, racenum, gendnum, alignnum)
1565 int rolenum, racenum;
1572 if (alignnum >= 0 && alignnum < ROLE_ALIGNS) {
1573 if (rfilter.mask & aligns[alignnum].allow)
1575 allow = aligns[alignnum].allow;
1576 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1577 && !(allow & roles[rolenum].allow & ROLE_ALIGNMASK))
1579 if (racenum >= 0 && racenum < SIZE(races) - 1
1580 && !(allow & races[racenum].allow & ROLE_ALIGNMASK))
1584 /* random; check whether any selection is possible */
1585 for (i = 0; i < ROLE_ALIGNS; i++) {
1586 if (rfilter.mask & aligns[i].allow)
1588 allow = aligns[i].allow;
1589 if (rolenum >= 0 && rolenum < SIZE(roles) - 1
1590 && !(allow & roles[rolenum].allow & ROLE_ALIGNMASK))
1592 if (racenum >= 0 && racenum < SIZE(races) - 1
1593 && !(allow & races[racenum].allow & ROLE_ALIGNMASK))
1601 /* Pick a random alignment subject to any rolenum/racenum/gendnum constraints;
1602 alignment and gender are not comparable (and also not constrainable).
1603 If pickhow == PICK_RIGID an alignment is returned only if there is
1604 a single possibility. */
1606 pick_align(rolenum, racenum, gendnum, pickhow)
1607 int rolenum, racenum, gendnum, pickhow;
1612 for (i = 0; i < ROLE_ALIGNS; i++) {
1613 if (ok_align(rolenum, racenum, gendnum, i))
1616 if (aligns_ok == 0 || (aligns_ok > 1 && pickhow == PICK_RIGID))
1618 aligns_ok = rn2(aligns_ok);
1619 for (i = 0; i < ROLE_ALIGNS; i++) {
1620 if (ok_align(rolenum, racenum, gendnum, i)) {
1635 /* Some roles are limited to a single race, alignment, or gender and
1636 * calling this routine prior to XXX_player_selection() will help
1637 * prevent an extraneous prompt that actually doesn't allow
1638 * you to choose anything further. Note the use of PICK_RIGID which
1639 * causes the pick_XX() routine to return a value only if there is one
1640 * single possible selection, otherwise it returns ROLE_NONE.
1643 if (flags.initrole == ROLE_RANDOM) {
1644 /* If the role was explicitly specified as ROLE_RANDOM
1645 * via -uXXXX-@ or OPTIONS=role:random then choose the role
1646 * in here to narrow down later choices.
1648 flags.initrole = pick_role(flags.initrace, flags.initgend,
1649 flags.initalign, PICK_RANDOM);
1650 if (flags.initrole < 0)
1651 flags.initrole = randrole_filtered();
1653 if (flags.initrace == ROLE_RANDOM
1654 && (tmp = pick_race(flags.initrole, flags.initgend,
1655 flags.initalign, PICK_RANDOM)) != ROLE_NONE)
1656 flags.initrace = tmp;
1657 if (flags.initalign == ROLE_RANDOM
1658 && (tmp = pick_align(flags.initrole, flags.initrace,
1659 flags.initgend, PICK_RANDOM)) != ROLE_NONE)
1660 flags.initalign = tmp;
1661 if (flags.initgend == ROLE_RANDOM
1662 && (tmp = pick_gend(flags.initrole, flags.initrace,
1663 flags.initalign, PICK_RANDOM)) != ROLE_NONE)
1664 flags.initgend = tmp;
1666 if (flags.initrole != ROLE_NONE) {
1667 if (flags.initrace == ROLE_NONE)
1668 flags.initrace = pick_race(flags.initrole, flags.initgend,
1669 flags.initalign, PICK_RIGID);
1670 if (flags.initalign == ROLE_NONE)
1671 flags.initalign = pick_align(flags.initrole, flags.initrace,
1672 flags.initgend, PICK_RIGID);
1673 if (flags.initgend == ROLE_NONE)
1674 flags.initgend = pick_gend(flags.initrole, flags.initrace,
1675 flags.initalign, PICK_RIGID);
1684 boolean reslt = TRUE;
1686 if ((i = str2role(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
1687 rfilter.roles[i] = TRUE;
1688 else if ((i = str2race(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
1689 rfilter.mask |= races[i].selfmask;
1690 else if ((i = str2gend(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
1691 rfilter.mask |= genders[i].allow;
1692 else if ((i = str2align(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
1693 rfilter.mask |= aligns[i].allow;
1706 for (i = 0; i < SIZE(roles); ++i)
1707 if (rfilter.roles[i])
1717 for (i = 0; i < SIZE(roles); ++i)
1718 rfilter.roles[i] = FALSE;
1728 STATIC_VAR char pa[NUM_BP], post_attribs;
1731 promptsep(buf, num_post_attribs)
1733 int num_post_attribs;
1736 const char *conjuct = "and ";
1738 if (num_post_attribs > 1 && post_attribs < num_post_attribs
1739 && post_attribs > 1)
1743 if (!post_attribs && num_post_attribs > 1)
1744 Strcat(buf, conjuct);
1746 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í "A, B, and C"
\82Æ
\82¢
\82¤
\8f\88\97\9d\82Í
\95s
\97v */
1747 if(num_post_attribs > post_attribs){
1748 Strcat(buf, "
\81C");
1756 role_gendercount(rolenum)
1761 if (validrole(rolenum)) {
1762 if (roles[rolenum].allow & ROLE_MALE)
1764 if (roles[rolenum].allow & ROLE_FEMALE)
1766 if (roles[rolenum].allow & ROLE_NEUTER)
1773 race_alignmentcount(racenum)
1778 if (racenum != ROLE_NONE && racenum != ROLE_RANDOM) {
1779 if (races[racenum].allow & ROLE_CHAOTIC)
1781 if (races[racenum].allow & ROLE_LAWFUL)
1783 if (races[racenum].allow & ROLE_NEUTRAL)
1790 root_plselection_prompt(suppliedbuf, buflen, rolenum, racenum, gendnum,
1793 int buflen, rolenum, racenum, gendnum, alignnum;
1795 int k, gendercount = 0, aligncount = 0;
1798 static char err_ret[] = " character's";
1800 static char err_ret[] = "
\83L
\83\83\83\89\83N
\83^
\81[
\82Ì";
1802 boolean donefirst = FALSE;
1805 if (!suppliedbuf || buflen < 1)
1808 /* initialize these static variables each time this is called */
1810 for (k = 0; k < NUM_BP; ++k)
1813 *suppliedbuf = '\0';
1815 /* How many alignments are allowed for the desired race? */
1816 if (racenum != ROLE_NONE && racenum != ROLE_RANDOM)
1817 aligncount = race_alignmentcount(racenum);
1819 if (alignnum != ROLE_NONE && alignnum != ROLE_RANDOM
1820 && ok_align(rolenum, racenum, gendnum, alignnum)) {
1821 /* if race specified, and multiple choice of alignments for it */
1822 if ((racenum >= 0) && (aligncount > 1)) {
1827 Strcat(buf, aligns[alignnum].adj);
1836 Strcat(buf, aligns[alignnum].adj);
1842 /* in case we got here by failing the ok_align() test */
1843 if (alignnum != ROLE_RANDOM)
1844 alignnum = ROLE_NONE;
1845 /* if alignment not specified, but race is specified
1846 and only one choice of alignment for that race then
1847 don't include it in the later list */
1848 if ((((racenum != ROLE_NONE && racenum != ROLE_RANDOM)
1849 && ok_race(rolenum, racenum, gendnum, alignnum))
1850 && (aligncount > 1))
1851 || (racenum == ROLE_NONE || racenum == ROLE_RANDOM)) {
1858 /* How many genders are allowed for the desired role? */
1859 if (validrole(rolenum))
1860 gendercount = role_gendercount(rolenum);
1862 if (gendnum != ROLE_NONE && gendnum != ROLE_RANDOM) {
1863 if (validrole(rolenum)) {
1864 /* if role specified, and multiple choice of genders for it,
1865 and name of role itself does not distinguish gender */
1866 if ((rolenum != ROLE_NONE) && (gendercount > 1)
1867 && !roles[rolenum].name.f) {
1872 Strcat(buf, genders[gendnum].adj);
1882 Strcat(buf, genders[gendnum].adj);
1888 /* if gender not specified, but role is specified
1889 and only one choice of gender then
1890 don't include it in the later list */
1891 if ((validrole(rolenum) && (gendercount > 1))
1892 || !validrole(rolenum)) {
1897 /* <your lawful female> */
1899 if (racenum != ROLE_NONE && racenum != ROLE_RANDOM) {
1900 if (validrole(rolenum)
1901 && ok_race(rolenum, racenum, gendnum, alignnum)) {
1906 Strcat(buf, (rolenum == ROLE_NONE) ? races[racenum].noun
1907 : races[racenum].adj);
1911 } else if (!validrole(rolenum)) {
1916 Strcat(buf, races[racenum].noun);
1928 /* <your lawful female gnomish> || <your lawful female gnome> */
1930 if (validrole(rolenum)) {
1935 if (gendnum != ROLE_NONE) {
1936 if (gendnum == 1 && roles[rolenum].name.f)
1937 Strcat(buf, roles[rolenum].name.f);
1939 Strcat(buf, roles[rolenum].name.m);
1941 if (roles[rolenum].name.f) {
1942 Strcat(buf, roles[rolenum].name.m);
1944 Strcat(buf, roles[rolenum].name.f);
1946 Strcat(buf, roles[rolenum].name.m);
1951 } else if (rolenum == ROLE_NONE) {
1956 if ((racenum == ROLE_NONE || racenum == ROLE_RANDOM)
1957 && !validrole(rolenum)) {
1963 Strcat(buf, "character");
1965 Strcat(buf, "
\83L
\83\83\83\89\83N
\83^
\81[");
1970 /* <your lawful female gnomish cavewoman> || <your lawful female gnome>
1971 * || <your lawful female character>
1973 if (buflen > (int) (strlen(buf) + 1)) {
1974 Strcpy(suppliedbuf, buf);
1981 build_plselection_prompt(buf, buflen, rolenum, racenum, gendnum, alignnum)
1983 int buflen, rolenum, racenum, gendnum, alignnum;
1986 const char *defprompt = "Shall I pick a character for you? [ynaq] ";
1988 const char *defprompt = "
\93K
\93\96\82É
\83L
\83\83\83\89\83N
\83^
\81[
\82ð
\91I
\82ñ
\82Å
\82æ
\82¢
\82Å
\82·
\82©
\81H[ynaq] ";
1989 int num_post_attribs = 0;
1991 char tmpbuf[BUFSZ], *p;
1996 if (buflen < QBUFSZ)
1997 return (char *) defprompt;
2000 Strcpy(tmpbuf, "Shall I pick ");
2001 if (racenum != ROLE_NONE || validrole(rolenum))
2002 Strcat(tmpbuf, "your ");
2004 Strcat(tmpbuf, "a ");
2010 (void) root_plselection_prompt(eos(tmpbuf), buflen - strlen(tmpbuf),
2011 rolenum, racenum, gendnum, alignnum);
2012 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\95s
\97v*/
2013 /* "Shall I pick a character's role, race, gender, and alignment for you?"
2014 plus " [ynaq] (y)" is a little too long for a conventional 80 columns;
2015 also, "pick a character's <anything>" sounds a bit stilted */
2016 strsubst(tmpbuf, "pick a character", "pick character");
2019 Sprintf(buf, "%s", s_suffix(tmpbuf));
2021 Sprintf(buf, "%s
\82Ì", tmpbuf);
2023 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\95s
\97v*/
2024 /* don't bother splitting caveman/cavewoman or priest/priestess
2025 in order to apply possessive suffix to both halves, but do
2026 change "priest/priestess'" to "priest/priestess's" */
2027 if ((p = strstri(buf, "priest/priestess'")) != 0
2028 && p[sizeof "priest/priestess'" - sizeof ""] == '\0')
2029 strkitten(buf, 's');
2032 /* buf should now be:
2033 * <your lawful female gnomish cavewoman's>
2034 * || <your lawful female gnome's>
2035 * || <your lawful female character's>
2037 * Now append the post attributes to it
2039 num_post_attribs = post_attribs;
2040 if (!num_post_attribs) {
2041 /* some constraints might have been mutually exclusive, in which case
2042 some prompting that would have been omitted is needed after all */
2043 if (flags.initrole == ROLE_NONE && !pa[BP_ROLE])
2044 pa[BP_ROLE] = ++post_attribs;
2045 if (flags.initrace == ROLE_NONE && !pa[BP_RACE])
2046 pa[BP_RACE] = ++post_attribs;
2047 if (flags.initalign == ROLE_NONE && !pa[BP_ALIGN])
2048 pa[BP_ALIGN] = ++post_attribs;
2049 if (flags.initgend == ROLE_NONE && !pa[BP_GEND])
2050 pa[BP_GEND] = ++post_attribs;
2051 num_post_attribs = post_attribs;
2053 if (num_post_attribs) {
2055 (void) promptsep(eos(buf), num_post_attribs);
2057 Strcat(buf, "race");
2059 Strcat(buf, "
\8eí
\91°");
2062 (void) promptsep(eos(buf), num_post_attribs);
2064 Strcat(buf, "role");
2066 Strcat(buf, "
\90E
\8bÆ");
2069 (void) promptsep(eos(buf), num_post_attribs);
2071 Strcat(buf, "gender");
2073 Strcat(buf, "
\90«
\95Ê");
2076 (void) promptsep(eos(buf), num_post_attribs);
2078 Strcat(buf, "alignment");
2080 Strcat(buf, "
\91®
\90«");
2084 Strcat(buf, " for you? [ynaq] ");
2086 Strcat(buf, "
\82ð
\93K
\93\96\82É
\91I
\82ñ
\82Å
\82æ
\82ë
\82µ
\82¢
\82Å
\82·
\82©
\81H[ynq] ");
2102 /* some generic user names will be ignored in favor of prompting */
2103 if (sysopt.genericusers) {
2104 if (*sysopt.genericusers == '*') {
2107 i = (int) strlen(plname);
2108 if ((sptr = strstri(sysopt.genericusers, plname)) != 0
2109 && (sptr == sysopt.genericusers || sptr[-1] == ' ')
2110 && (sptr[i] == ' ' || sptr[i] == '\0'))
2111 *plname = '\0'; /* call askname() */
2117 askname(); /* fill plname[] if necessary, or set defer_plname */
2119 /* Look for tokens delimited by '-' */
2120 if ((eptr = index(plname, '-')) != (char *) 0)
2123 /* Isolate the next token */
2125 if ((eptr = index(sptr, '-')) != (char *) 0)
2128 /* Try to match it to something */
2129 if ((i = str2role(sptr)) != ROLE_NONE)
2131 else if ((i = str2race(sptr)) != ROLE_NONE)
2133 else if ((i = str2gend(sptr)) != ROLE_NONE)
2135 else if ((i = str2align(sptr)) != ROLE_NONE)
2136 flags.initalign = i;
2138 } while (!*plname && !iflags.defer_plname);
2140 /* commas in the plname confuse the record file, convert to spaces */
2141 for (sptr = plname; *sptr; sptr++) {
2147 /* show current settings for name, role, race, gender, and alignment
2148 in the specified window */
2150 role_selection_prolog(which, where)
2155 static const char NEARDATA choosing[] = " choosing now",
2157 static const char NEARDATA choosing[] = "
\8c»
\8dÝ
\91I
\91ð
\92\86",
2159 not_yet[] = " not yet specified",
2161 not_yet[] = "
\96¢
\91I
\91ð",
2163 rand_choice[] = " random";
2165 rand_choice[] = "
\83\89\83\93\83_
\83\80";
2167 int r, c, g, a, allowmask;
2172 a = flags.initalign;
2174 allowmask = roles[r].allow;
2175 if ((allowmask & ROLE_RACEMASK) == MH_HUMAN)
2176 c = 0; /* races[human] */
2177 else if (c >= 0 && !(allowmask & ROLE_RACEMASK & races[c].allow))
2179 if ((allowmask & ROLE_GENDMASK) == ROLE_MALE)
2180 g = 0; /* role forces male (hypothetical) */
2181 else if ((allowmask & ROLE_GENDMASK) == ROLE_FEMALE)
2182 g = 1; /* role forces female (valkyrie) */
2183 if ((allowmask & ROLE_ALIGNMASK) == AM_LAWFUL)
2184 a = 0; /* aligns[lawful] */
2185 else if ((allowmask & ROLE_ALIGNMASK) == AM_NEUTRAL)
2186 a = 1; /* aligns[neutral] */
2187 else if ((allowmask & ROLE_ALIGNMASK) == AM_CHAOTIC)
2188 a = 2; /* alings[chaotic] */
2191 allowmask = races[c].allow;
2192 if ((allowmask & ROLE_ALIGNMASK) == AM_LAWFUL)
2193 a = 0; /* aligns[lawful] */
2194 else if ((allowmask & ROLE_ALIGNMASK) == AM_NEUTRAL)
2195 a = 1; /* aligns[neutral] */
2196 else if ((allowmask & ROLE_ALIGNMASK) == AM_CHAOTIC)
2197 a = 2; /* alings[chaotic] */
2198 /* [c never forces gender] */
2200 /* [g and a don't constrain anything sufficiently
2201 to narrow something done to a single choice] */
2204 Sprintf(buf, "%12s ", "name:");
2206 Sprintf(buf, "%12s ", "
\96¼
\91O:");
2207 Strcat(buf, (which == RS_NAME) ? choosing : !*plname ? not_yet : plname);
2208 putstr(where, 0, buf);
2210 Sprintf(buf, "%12s ", "role:");
2212 Sprintf(buf, "%12s ", "
\90E
\8bÆ:");
2213 Strcat(buf, (which == RS_ROLE) ? choosing : (r == ROLE_NONE)
2215 : (r == ROLE_RANDOM)
2218 if (r >= 0 && roles[r].name.f) {
2219 /* distinct female name [caveman/cavewoman, priest/priestess] */
2221 /* female specified; replace male role name with female one */
2222 Sprintf(index(buf, ':'), ": %s", roles[r].name.f);
2224 /* gender unspecified; append slash and female role name */
2225 Sprintf(eos(buf), "/%s", roles[r].name.f);
2227 putstr(where, 0, buf);
2229 Sprintf(buf, "%12s ", "race:");
2231 Sprintf(buf, "%12s ", "
\8eí
\91°:");
2232 Strcat(buf, (which == RS_RACE) ? choosing : (c == ROLE_NONE)
2234 : (c == ROLE_RANDOM)
2237 putstr(where, 0, buf);
2239 Sprintf(buf, "%12s ", "gender:");
2241 Sprintf(buf, "%12s ", "
\90«
\95Ê:");
2242 Strcat(buf, (which == RS_GENDER) ? choosing : (g == ROLE_NONE)
2244 : (g == ROLE_RANDOM)
2247 putstr(where, 0, buf);
2249 Sprintf(buf, "%12s ", "alignment:");
2251 Sprintf(buf, "%12s ", "
\91®
\90«:");
2252 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\96¼
\8e\8c\82ª
\8e©
\91R*/
2253 Strcat(buf, (which == RS_ALGNMNT) ? choosing : (a == ROLE_NONE)
2255 : (a == ROLE_RANDOM)
2259 Strcat(buf, (which == RS_ALGNMNT) ? choosing : (a == ROLE_NONE)
2261 : (a == ROLE_RANDOM)
2265 putstr(where, 0, buf);
2268 /* add a "pick alignment first"-type entry to the specified menu */
2270 role_menu_extra(which, where, preselect)
2275 static NEARDATA const char RS_menu_let[] = {
2280 '[', /* alignment */
2284 const char *what = 0, *constrainer = 0, *forcedvalue = 0;
2285 int f = 0, r, c, g, a, i, allowmask;
2302 for (i = 0; i < SIZE(roles); ++i)
2303 if (i != f && !rfilter.roles[i])
2305 if (i == SIZE(roles)) {
2307 constrainer = "filter";
2309 constrainer = "
\8di
\82è
\8d\9e\82Ý";
2311 forcedvalue = "role";
2313 forcedvalue = "
\90E
\8bÆ";
2322 c = ROLE_NONE; /* override player's setting */
2324 allowmask = roles[r].allow & ROLE_RACEMASK;
2325 if (allowmask == MH_HUMAN)
2326 c = 0; /* races[human] */
2329 constrainer = "role";
2331 constrainer = "
\90E
\8bÆ";
2332 forcedvalue = races[c].noun;
2334 && (allowmask & ~rfilter.mask) == races[f].selfmask) {
2335 /* if there is only one race choice available due to user
2336 options disallowing others, race menu entry is disabled */
2338 constrainer = "filter";
2340 constrainer = "
\8di
\82è
\8d\9e\82Ý";
2342 forcedvalue = "race";
2344 forcedvalue = "
\8eí
\91°";
2356 allowmask = roles[r].allow & ROLE_GENDMASK;
2357 if (allowmask == ROLE_MALE)
2358 g = 0; /* genders[male] */
2359 else if (allowmask == ROLE_FEMALE)
2360 g = 1; /* genders[female] */
2363 constrainer = "role";
2365 constrainer = "
\90E
\8bÆ";
2366 forcedvalue = genders[g].adj;
2368 && (allowmask & ~rfilter.mask) == genders[f].allow) {
2369 /* if there is only one gender choice available due to user
2370 options disallowing other, gender menu entry is disabled */
2372 constrainer = "filter";
2374 constrainer = "
\8di
\82è
\8d\9e\82Ý";
2376 forcedvalue = "gender";
2378 forcedvalue = "
\90«
\95Ê";
2387 f = flags.initalign;
2390 allowmask = roles[r].allow & ROLE_ALIGNMASK;
2391 if (allowmask == AM_LAWFUL)
2392 a = 0; /* aligns[lawful] */
2393 else if (allowmask == AM_NEUTRAL)
2394 a = 1; /* aligns[neutral] */
2395 else if (allowmask == AM_CHAOTIC)
2396 a = 2; /* aligns[chaotic] */
2399 constrainer = "role";
2401 constrainer = "
\90E
\8bÆ";
2403 if (c >= 0 && !constrainer) {
2404 allowmask = races[c].allow & ROLE_ALIGNMASK;
2405 if (allowmask == AM_LAWFUL)
2406 a = 0; /* aligns[lawful] */
2407 else if (allowmask == AM_NEUTRAL)
2408 a = 1; /* aligns[neutral] */
2409 else if (allowmask == AM_CHAOTIC)
2410 a = 2; /* aligns[chaotic] */
2413 constrainer = "race";
2415 constrainer = "
\8eí
\91°";
2417 if (f >= 0 && !constrainer
2418 && (ROLE_ALIGNMASK & ~rfilter.mask) == aligns[f].allow) {
2419 /* if there is only one alignment choice available due to user
2420 options disallowing others, algn menu entry is disabled */
2422 constrainer = "filter";
2424 constrainer = "
\8di
\82è
\8d\9e\82Ý";
2426 forcedvalue = "alignment";
2428 forcedvalue = "
\91®
\90«";
2431 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\96¼
\8e\8c\82ª
\8e©
\91R*/
2432 forcedvalue = aligns[a].adj;
2434 forcedvalue = aligns[a].noun;
2439 any = zeroany; /* zero out all bits */
2442 /* use four spaces of padding to fake a grayed out menu choice */
2444 Sprintf(buf, "%4s%s forces %s", "", constrainer, forcedvalue);
2446 Sprintf(buf, "%4s
\82±
\82Ì%s
\82Å
\82Í%s
\82Ì
\82Ý", "", constrainer, forcedvalue);
2447 add_menu(where, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
2450 any.a_int = RS_menu_arg(which);
2452 Sprintf(buf, "Pick%s %s first", (f >= 0) ? " another" : "", what);
2454 Sprintf(buf, "%s%s
\82ð
\90æ
\82É
\91I
\82Ô", (f >= 0) ? "
\91¼
\82Ì" : "", what);
2455 add_menu(where, NO_GLYPH, &any, RS_menu_let[which], 0, ATR_NONE, buf,
2457 } else if (which == RS_filter) {
2458 any.a_int = RS_menu_arg(RS_filter);
2460 add_menu(where, NO_GLYPH, &any, '~', 0, ATR_NONE,
2461 "Reset role/race/&c filtering", MENU_UNSELECTED);
2463 add_menu(where, NO_GLYPH, &any, '~', 0, ATR_NONE,
2464 "
\90E
\8bÆ/
\8eí
\91°
\82È
\82Ç
\82Ì
\8di
\82è
\8d\9e\82Ý
\82ð
\89ð
\8f\9c\82·
\82é", MENU_UNSELECTED);
2466 } else if (which == ROLE_RANDOM) {
2467 any.a_int = ROLE_RANDOM;
2469 add_menu(where, NO_GLYPH, &any, '*', 0, ATR_NONE, "Random",
2470 preselect ? MENU_SELECTED : MENU_UNSELECTED);
2472 add_menu(where, NO_GLYPH, &any, '*', 0, ATR_NONE, "
\83\89\83\93\83_
\83\80",
2475 } else if (which == ROLE_NONE) {
2476 any.a_int = ROLE_NONE;
2478 add_menu(where, NO_GLYPH, &any, 'q', 0, ATR_NONE, "Quit",
2479 preselect ? MENU_SELECTED : MENU_UNSELECTED);
2481 add_menu(where, NO_GLYPH, &any, 'q', 0, ATR_NONE, "
\94²
\82¯
\82é",
2485 impossible("role_menu_extra: bad arg (%d)", which);
2490 * Special setup modifications here:
2492 * Unfortunately, this is going to have to be done
2493 * on each newgame or restore, because you lose the permonst mods
2494 * across a save/restore. :-)
2496 * 1 - The Rogue Leader is the Tourist Nemesis.
2497 * 2 - Priests start with a random alignment - convert the leader and
2499 * 3 - Priests also get their of deities from a randomly chosen role.
2500 * 4 - [obsolete] Elves can have one of two different leaders,
2501 * but can't work it out here because it requires hacking the
2502 * level file data (see sp_lev.c).
2504 * This code also replaces quest_init().
2510 struct permonst *pm;
2512 /* Strip the role letter out of the player name.
2513 * This is included for backwards compatibility.
2517 /* Check for a valid role. Try flags.initrole first. */
2518 if (!validrole(flags.initrole)) {
2519 /* Try the player letter second */
2520 if ((flags.initrole = str2role(pl_character)) < 0)
2521 /* None specified; pick a random role */
2522 flags.initrole = randrole_filtered();
2525 /* We now have a valid role index. Copy the role name back. */
2526 /* This should become OBSOLETE */
2527 Strcpy(pl_character, roles[flags.initrole].name.m);
2528 pl_character[PL_CSIZ - 1] = '\0';
2530 /* Check for a valid race */
2531 if (!validrace(flags.initrole, flags.initrace))
2532 flags.initrace = randrace(flags.initrole);
2534 /* Check for a valid gender. If new game, check both initgend
2535 * and female. On restore, assume flags.female is correct. */
2536 if (flags.pantheon == -1) { /* new game */
2537 if (!validgend(flags.initrole, flags.initrace, flags.female))
2538 flags.female = !flags.female;
2540 if (!validgend(flags.initrole, flags.initrace, flags.initgend))
2541 /* Note that there is no way to check for an unspecified gender. */
2542 flags.initgend = flags.female;
2544 /* Check for a valid alignment */
2545 if (!validalign(flags.initrole, flags.initrace, flags.initalign))
2546 /* Pick a random alignment */
2547 flags.initalign = randalign(flags.initrole, flags.initrace);
2548 alignmnt = aligns[flags.initalign].value;
2550 /* Initialize urole and urace */
2551 urole = roles[flags.initrole];
2552 urace = races[flags.initrace];
2554 /* Fix up the quest leader */
2555 if (urole.ldrnum != NON_PM) {
2556 pm = &mons[urole.ldrnum];
2557 pm->msound = MS_LEADER;
2558 pm->mflags2 |= (M2_PEACEFUL);
2559 pm->mflags3 |= M3_CLOSE;
2560 pm->maligntyp = alignmnt * 3;
2561 /* if gender is random, we choose it now instead of waiting
2562 until the leader monster is created */
2563 quest_status.ldrgend =
2564 is_neuter(pm) ? 2 : is_female(pm) ? 1 : is_male(pm)
2569 /* Fix up the quest guardians */
2570 if (urole.guardnum != NON_PM) {
2571 pm = &mons[urole.guardnum];
2572 pm->mflags2 |= (M2_PEACEFUL);
2573 pm->maligntyp = alignmnt * 3;
2576 /* Fix up the quest nemesis */
2577 if (urole.neminum != NON_PM) {
2578 pm = &mons[urole.neminum];
2579 pm->msound = MS_NEMESIS;
2580 pm->mflags2 &= ~(M2_PEACEFUL);
2581 pm->mflags2 |= (M2_NASTY | M2_STALK | M2_HOSTILE);
2582 pm->mflags3 &= ~(M3_CLOSE);
2583 pm->mflags3 |= M3_WANTSARTI | M3_WAITFORU;
2584 /* if gender is random, we choose it now instead of waiting
2585 until the nemesis monster is created */
2586 quest_status.nemgend = is_neuter(pm) ? 2 : is_female(pm) ? 1
2587 : is_male(pm) ? 0 : (rn2(100) < 50);
2590 /* Fix up the god names */
2591 if (flags.pantheon == -1) { /* new game */
2592 flags.pantheon = flags.initrole; /* use own gods */
2593 while (!roles[flags.pantheon].lgod) /* unless they're missing */
2594 flags.pantheon = randrole(FALSE);
2597 urole.lgod = roles[flags.pantheon].lgod;
2598 urole.ngod = roles[flags.pantheon].ngod;
2599 urole.cgod = roles[flags.pantheon].cgod;
2601 /* 0 or 1; no gods are neuter, nor is gender randomized */
2603 quest_status.godgend = !strcmpi(align_gtitle(alignmnt), "goddess");
2605 quest_status.godgend = !strcmpi(align_gtitle(alignmnt), "
\8f\97\90_");
2609 * Disable this fixup so that mons[] can be const. The only
2610 * place where it actually matters for the hero is in set_uasmon()
2611 * and that can use mons[race] rather than mons[role] for this
2612 * particular property. Despite the comment, it is checked--where
2613 * needed--via instrinsic 'Infravision' which set_uasmon() manages.
2615 /* Fix up infravision */
2616 if (mons[urace.malenum].mflags3 & M3_INFRAVISION) {
2617 /* although an infravision intrinsic is possible, infravision
2618 * is purely a property of the physical race. This means that we
2619 * must put the infravision flag in the player's current race
2620 * (either that or have separate permonst entries for
2621 * elven/non-elven members of each class). The side effect is that
2622 * all NPCs of that class will have (probably bogus) infravision,
2623 * but since infravision has no effect for NPCs anyway we can
2626 mons[urole.malenum].mflags3 |= M3_INFRAVISION;
2627 if (urole.femalenum != NON_PM)
2628 mons[urole.femalenum].mflags3 |= M3_INFRAVISION;
2632 /* Artifacts are fixed in hack_artifacts() */
2643 switch (Role_switch) {
2645 return "Salutations"; /* Olde English */
2647 return (mtmp && mtmp->data == &mons[PM_SHOPKEEPER])
2649 : "Konnichi wa"; /* Japanese */
2651 return "Aloha"; /* Hawaiian */
2655 (mtmp && mtmp->data == &mons[PM_MAIL_DAEMON]) ? "Hallo" :
2657 "Velkommen"; /* Norse */
2663 \82 \82¢
\82³
\82Â
\82Í
\93ú
\96{
\8cê
\82Æ
\82µ
\82Ä
\8e©
\91R
\82É
\82È
\82é
\82æ
\82¤
\91å
\82«
\82
\8ed
\97l
\82ð
\95Ï
\8dX
2665 static char helo_buf[BUFSZ];
2667 switch (Role_switch) {
2669 Sprintf(helo_buf, "
\82æ
\82
\82¼
\8eQ
\82Á
\82½%s
\82æ", plname);
2672 Sprintf(helo_buf, "
\82æ
\82
\82¼
\8eQ
\82ç
\82ê
\82½%s
\82æ", plname);
2675 Sprintf(helo_buf, "
\83A
\83\8d\81[
\83n%s", plname);
2678 Sprintf(helo_buf, "
\8d°
\82Ì
\8eç
\8cì
\8eÒ%s
\82æ", plname);
2681 Sprintf(helo_buf, "
\82æ
\82¤
\82±
\82»%s", plname);
2693 switch (Role_switch) {
2695 return "Fare thee well"; /* Olde English */
2697 return "Sayonara"; /* Japanese */
2699 return "Aloha"; /* Hawaiian */
2701 return "Farvel"; /* Norse */
2706 static char helo_buf[BUFSZ];
2708 switch (Role_switch) {
2710 Sprintf(helo_buf, "
\82³
\82ç
\82Î
\8chåi
\82È
\82é");
2713 Sprintf(helo_buf, "
\82³
\82ç
\82Î
\95\90\8em
\93¹
\82ð
\8eu
\82·");
2716 Sprintf(helo_buf, "
\83A
\83\8d\81[
\83n");
2719 Sprintf(helo_buf, "
\82³
\82ç
\82Î
\8d°
\82Ì
\8eç
\8cì
\8eÒ");
2722 Sprintf(helo_buf, "
\82³
\82æ
\82¤
\82È
\82ç");