OSDN Git Service

fix #40657
authorSHIRAKATA Kentaro <argrath@ub32.org>
Thu, 20 Aug 2020 11:39:57 +0000 (20:39 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Thu, 27 Aug 2020 21:20:46 +0000 (06:20 +0900)
ChangeLog.j
include/you.h
src/role.c

index 3289419..d6c311d 100644 (file)
@@ -1,5 +1,6 @@
        * \8e\9f\82Ì\96â\91è\82ð\8fC\90³
          * X11\8aÂ\8b«\82Å\93ú\96{\8cê\93ü\97Í\82ª\82Å\82«\82È\82¢ (#40562)
+         * \88ê\95\94\82Ì\83I\83v\83V\83\87\83\93\82Å\89p\8cê\82Ì\83t\83\8b\83l\81[\83\80\82ð\8eg\82¦\82È\82¢ (#40657)
 
 Sat Apr 18 2020  Kentaro Shirakata  <argrath@ub32.org>
 
index ad178a2..f0ee0ea 100644 (file)
@@ -104,6 +104,9 @@ struct u_roleplay {
 /*** Unified structure containing role information ***/
 struct Role {
     /*** Strings that name various things ***/
+#if 1 /*JP*/
+    struct RoleName opt;     /* \83I\83v\83V\83\87\83\93\8ew\92è\95\8e\9a\97ñ */
+#endif
     struct RoleName name;    /* the role's name (from u_init.c) */
     struct RoleName rank[9]; /* names for experience levels (from botl.c) */
     const char *lgod, *ngod, *cgod; /* god names (from pray.c) */
@@ -180,6 +183,9 @@ extern struct Role urole;
 
 struct Race {
     /*** Strings that name various things ***/
+#if 1 /*JP*/
+    const char *opt;      /* \83I\83v\83V\83\87\83\93\8ew\92è\95\8e\9a\97ñ */
+#endif
     const char *noun;           /* noun ("human", "elf") */
     const char *adj;            /* adjective ("human", "elven") */
     const char *coll;           /* collective ("humanity", "elvenkind") */
@@ -230,6 +236,9 @@ struct Gender {
     const char *him;      /* him/her/it */
     const char *his;      /* his/her/its */
     const char *filecode; /* file code */
+#if 1 /*JP*/
+    const char *opt;      /* \83I\83v\83V\83\87\83\93\8ew\92è\95\8e\9a\97ñ */
+#endif
     short allow;          /* equivalent ROLE_ mask */
 };
 #define ROLE_GENDERS 2    /* number of permitted player genders
@@ -254,6 +263,9 @@ struct Align {
     const char *noun;     /* law/balance/chaos */
     const char *adj;      /* lawful/neutral/chaotic */
     const char *filecode; /* file code */
+#if 1 /*JP*/
+    const char *opt;      /* \83I\83v\83V\83\87\83\93\8ew\92è\95\8e\9a\97ñ */
+#endif
     short allow;          /* equivalent ROLE_ mask */
     aligntyp value;       /* equivalent A_ value */
 };
index 92ddba2..504f599 100644 (file)
@@ -30,8 +30,8 @@
  * God names use a leading underscore to flag goddesses.
  */
 const struct Role roles[] = {
-#if 0 /*JP:T*/
     { { "Archeologist", 0 },
+#if 0 /*JP:T*/
       { { "Digger", 0 },
         { "Field Worker", 0 },
         { "Investigator", 0 },
@@ -43,7 +43,7 @@ const struct Role roles[] = {
         { "Curator", 0 } },
       "Quetzalcoatl", "Camaxtli", "Huhetotl", /* Central American */
 #else
-    { { "\8dl\8cÃ\8aw\8eÒ", 0 },
+      { "\8dl\8cÃ\8aw\8eÒ", 0 },
       { { "\8dz\88õ", 0 },
         { "\98J\93­\8eÒ", 0 },
         { "\92²\8d¸\8eÒ", 0 },
@@ -91,8 +91,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_MAGIC_MAPPING,
       -4 },
-#if 0 /*JP:T*/
     { { "Barbarian", 0 },
+#if 0 /*JP:T*/
       { { "Plunderer", "Plunderess" },
         { "Pillager", 0 },
         { "Bandit", 0 },
@@ -104,7 +104,7 @@ const struct Role roles[] = {
         { "Conqueror", "Conqueress" } },
       "Mitra", "Crom", "Set", /* Hyborian */
 #else
-    { { "\96ì\94Ø\90l", 0 },
+      { "\96ì\94Ø\90l", 0 },
       { { "\93\90\91¯", 0 },
         { "\97ª\92D\8eÒ", 0 },
         { "\88«\8a¿", 0 },
@@ -152,8 +152,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_HASTE_SELF,
       -4 },
-#if 0 /*JP:T*/
     { { "Caveman", "Cavewoman" },
+#if 0 /*JP:T*/
       { { "Troglodyte", 0 },
         { "Aborigine", 0 },
         { "Wanderer", 0 },
@@ -165,7 +165,7 @@ const struct Role roles[] = {
         { "Pioneer", 0 } },
       "Anu", "_Ishtar", "Anshar", /* Babylonian */
 #else
-    { { "\93´\8cA\90l", 0 },
+      { "\93´\8cA\90l", 0 },
       { { "\8c\8a\8b\8f\90l", 0 },
         { "\8c´\8fZ\96¯", 0 },
         { "\95ú\98Q\8eÒ", 0 },
@@ -213,8 +213,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_DIG,
       -4 },
-#if 0 /*JP:T*/
     { { "Healer", 0 },
+#if 0 /*JP:T*/
       { { "Rhizotomist", 0 },
         { "Empiric", 0 },
         { "Embalmer", 0 },
@@ -226,7 +226,7 @@ const struct Role roles[] = {
         { "Chirurgeon", 0 } },
       "_Athena", "Hermes", "Poseidon", /* Greek */
 #else
-    { { "\96ò\8et", 0 },
+      { "\96ò\8et", 0 },
       { { "\8c©\8fK\82¢", 0 },
         { "\88ã\8et\8c©\8fK\82¢", 0 },
         { "\8aÅ\8cì\8et", "\8aÅ\8cì\95w" },
@@ -273,8 +273,8 @@ const struct Role roles[] = {
       A_WIS,
       SPE_CURE_SICKNESS,
       -4 },
-#if 0 /*JP:T*/
     { { "Knight", 0 },
+#if 0 /*JP:T*/
       { { "Gallant", 0 },
         { "Esquire", 0 },
         { "Bachelor", 0 },
@@ -286,7 +286,7 @@ const struct Role roles[] = {
         { "Paladin", 0 } },
       "Lugh", "_Brigit", "Manannan Mac Lir", /* Celtic */
 #else
-    { { "\8bR\8em", 0 },
+      { "\8bR\8em", 0 },
       { { "\8c©\8fK\82¢", 0 },
         { "\95à\95º", 0 },
         { "\90í\8em", 0 },
@@ -333,8 +333,8 @@ const struct Role roles[] = {
       A_WIS,
       SPE_TURN_UNDEAD,
       -4 },
-#if 0 /*JP:T*/
     { { "Monk", 0 },
+#if 0 /*JP:T*/
       { { "Candidate", 0 },
         { "Novice", 0 },
         { "Initiate", 0 },
@@ -346,7 +346,7 @@ const struct Role roles[] = {
         { "Master", 0 } },
       "Shan Lai Ching", "Chih Sung-tzu", "Huan Ti", /* Chinese */
 #else
-    { { "\95\90\93¬\89Æ", 0 },
+      { "\95\90\93¬\89Æ", 0 },
       { { "\93ü\96å\8aó\96]\8eÒ", 0 },
         { "\8f\89\90S\8eÒ", 0 },
         { "\93ü\96å\8eÒ\93`", 0 },
@@ -394,8 +394,8 @@ const struct Role roles[] = {
       A_WIS,
       SPE_RESTORE_ABILITY,
       -4 },
-#if 0 /*JP:T*/
     { { "Priest", "Priestess" },
+#if 0 /*JP:T*/
       { { "Aspirant", 0 },
         { "Acolyte", 0 },
         { "Adept", 0 },
@@ -407,7 +407,7 @@ const struct Role roles[] = {
         { "High Priest", "High Priestess" } },
       0, 0, 0, /* deities from a randomly chosen other role will be used */
 #else
-    { { "\91m\97µ", "\93ò\91m" },
+      { "\91m\97µ", "\93ò\91m" },
       { { "\8fC\93¹\8eÒ", "\8fC\93¹\8f\97" },
         { "\8e\98\8eÒ", 0 },
         { "\8e\98\8dÕ", 0 },
@@ -457,8 +457,8 @@ const struct Role roles[] = {
       -4 },
     /* Note:  Rogue precedes Ranger so that use of `-R' on the command line
        retains its traditional meaning. */
-#if 0 /*JP:T*/
     { { "Rogue", 0 },
+#if 0 /*JP:T*/
       { { "Footpad", 0 },
         { "Cutpurse", 0 },
         { "Rogue", 0 },
@@ -470,7 +470,7 @@ const struct Role roles[] = {
         { "Thief", 0 } },
       "Issek", "Mog", "Kos", /* Nehwon */
 #else
-    { { "\93\90\91¯", 0 },
+      { "\93\90\91¯", 0 },
       { { "\92Ç\82¢\82Í\82¬", 0 },
         { "\82Ð\82Á\82½\82­\82è", 0 },
         { "\83X\83\8a", 0 },
@@ -517,8 +517,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_DETECT_TREASURE,
       -4 },
-#if 0 /*JP:T*/
     { { "Ranger", 0 },
+#if 0 /*JP:T*/
       {
 #if 0 /* OBSOLETE */
         {"Edhel",   "Elleth"},
@@ -544,7 +544,7 @@ const struct Role roles[] = {
         { "Marksman", "Markswoman" } },
       "Mercury", "_Venus", "Mars", /* Roman/planets */
 #else
-    { { "\83\8c\83\93\83W\83\83\81[", 0 },
+      { "\83\8c\83\93\83W\83\83\81[", 0 },
       { { "\90V\95Ä", 0 },
         { "\8c©\92£\82è", 0 },
         { "\90æ\93±", 0 },
@@ -592,8 +592,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_INVISIBILITY,
       -4 },
-#if 0 /*JP:T*/
     { { "Samurai", 0 },
+#if 0 /*JP:T*/
       { { "Hatamoto", 0 },       /* Banner Knight */
         { "Ronin", 0 },          /* no allegiance */
         { "Ninja", "Kunoichi" }, /* secret society */
@@ -605,7 +605,7 @@ const struct Role roles[] = {
         { "Shogun", 0 } },       /* supreme commander, warlord */
       "_Amaterasu Omikami", "Raijin", "Susanowo", /* Japanese */
 #else
-    { { "\8e\98", 0 },
+      { "\8e\98", 0 },
       { { "\8aø\96{", 0 },       /* Banner Knight */
         { "\98Q\90l", 0 },          /* no allegiance */
         { "\94E\8eÒ", "\82­\83m\88ê" }, /* secret society */
@@ -652,8 +652,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_CLAIRVOYANCE,
       -4 },
-#if 0 /*JP:T*/
     { { "Tourist", 0 },
+#if 0 /*JP:T*/
       { { "Rambler", 0 },
         { "Sightseer", 0 },
         { "Excursionist", 0 },
@@ -665,7 +665,7 @@ const struct Role roles[] = {
         { "Adventurer", 0 } },
       "Blind Io", "_The Lady", "Offler", /* Discworld */
 #else
-    { { "\8aÏ\8cõ\8bq", 0 },
+      { "\8aÏ\8cõ\8bq", 0 },
       { { "\83v\81[\91¾\98Y", "\83v\81[\8eq" },
         { "\8aÏ\8cõ\8bq", 0 },
         { "\8eü\97V\97·\8ds\8eÒ", 0 },
@@ -712,8 +712,8 @@ const struct Role roles[] = {
       A_INT,
       SPE_CHARM_MONSTER,
       -4 },
-#if 0 /*JP:T*/
     { { "Valkyrie", 0 },
+#if 0 /*JP:T*/
       { { "Stripling", 0 },
         { "Skirmisher", 0 },
         { "Fighter", 0 },
@@ -725,7 +725,7 @@ const struct Role roles[] = {
         { "Lord", "Lady" } },
       "Tyr", "Odin", "Loki", /* Norse */
 #else
-    { { "\83\8f\83\8b\83L\83\85\81[\83\8c", 0 },
+      { "\83\8f\83\8b\83L\83\85\81[\83\8c", 0 },
       { { "\8c©\8fK\82¢", 0 },
         { "\95à\95º", 0 },
         { "\90í\8em", 0 },
@@ -772,8 +772,8 @@ const struct Role roles[] = {
       A_WIS,
       SPE_CONE_OF_COLD,
       -4 },
-#if 0 /*JP:T*/
     { { "Wizard", 0 },
+#if 0 /*JP:T*/
       { { "Evoker", 0 },
         { "Conjurer", 0 },
         { "Thaumaturge", 0 },
@@ -785,7 +785,7 @@ const struct Role roles[] = {
         { "Mage", 0 } },
       "Ptah", "Thoth", "Anhur", /* Egyptian */
 #else
-    { { "\96\82\96@\8eg\82¢", 0 },
+      { "\96\82\96@\8eg\82¢", 0 },
       { { "\8eè\95i\8et", 0 },
         { "\8aï\8fp\8et", 0 },
         { "\90è\82¢\8et", 0 },
@@ -834,7 +834,11 @@ const struct Role roles[] = {
       SPE_MAGIC_MISSILE,
       -4 },
     /* Array terminator */
+#if 0 /*JP*/
     { { 0, 0 } }
+#else
+    { { 0, 0 }, { 0, 0 } }
+#endif
 };
 
 /* The player's role, created at runtime from initial
@@ -842,6 +846,9 @@ const struct Role roles[] = {
  */
 struct Role urole = {
     { "Undefined", 0 },
+#if 1 /*JP*/
+    { "Undefined", 0 },
+#endif
     { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
       { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
     "L", "N", "C",
@@ -868,8 +875,8 @@ struct Role urole = {
 /* Table of all races */
 const struct Race races[] = {
     {
-#if 0 /*JP:T*/
         "human",
+#if 0 /*JP:T*/
         "human",
         "humanity",
 #else
@@ -900,8 +907,8 @@ const struct Race races[] = {
         { 1, 0, 2, 0, 2, 0 }  /* Energy */
     },
     {
-#if 0 /*JP:T*/
         "elf",
+#if 0 /*JP:T*/
         "elven",
         "elvenkind",
 #else
@@ -927,8 +934,8 @@ const struct Race races[] = {
         { 2, 0, 3, 0, 3, 0 }  /* Energy */
     },
     {
-#if 0 /*JP:T*/
         "dwarf",
+#if 0 /*JP:T*/
         "dwarven",
         "dwarvenkind",
 #else
@@ -954,8 +961,8 @@ const struct Race races[] = {
         { 0, 0, 0, 0, 0, 0 }  /* Energy */
     },
     {
-#if 0 /*JP:T*/
         "gnome",
+#if 0 /*JP:T*/
         "gnomish",
         "gnomehood",
 #else
@@ -981,8 +988,8 @@ const struct Race races[] = {
         { 2, 0, 2, 0, 2, 0 }  /* Energy */
     },
     {
-#if 0 /*JP:T*/
         "orc",
+#if 0 /*JP:T*/
         "orcish",
         "orcdom",
 #else
@@ -1015,6 +1022,9 @@ const struct Race races[] = {
  * choices.  This may be munged in role_init().
  */
 struct Race urace = {
+#if 1 /*JP*/
+    "something",
+#endif
     "something",
     "undefined",
     "something",
@@ -1047,9 +1057,9 @@ const struct Gender genders[] = {
     { "female", "she", "her", "her", "Fem", ROLE_FEMALE },
     { "neuter", "it", "it", "its", "Ntr", ROLE_NEUTER }
 #else
-    { "\92j\90«", "\94Þ", "\94Þ", "\94Þ\82Ì", "Mal", ROLE_MALE },
-    { "\8f\97\90«", "\94Þ\8f\97", "\94Þ\8f\97", "\94Þ\8f\97\82Ì", "Fem", ROLE_FEMALE },
-    { "\92\86\90«", "\82»\82ê", "\82»\82ê", "\82»\82Ì", "Ntr", ROLE_NEUTER }
+    { "\92j\90«", "\94Þ", "\94Þ", "\94Þ\82Ì", "Mal", "male", ROLE_MALE },
+    { "\8f\97\90«", "\94Þ\8f\97", "\94Þ\8f\97", "\94Þ\8f\97\82Ì", "Fem", "female", ROLE_FEMALE },
+    { "\92\86\90«", "\82»\82ê", "\82»\82ê", "\82»\82Ì", "Ntr", "neuter", ROLE_NEUTER }
 #endif
 };
 
@@ -1061,10 +1071,10 @@ const struct Align aligns[] = {
     { "chaos", "chaotic", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
     { "evil", "unaligned", "Una", 0, A_NONE }
 #else
-    { "\92\81\8f\98", "\92\81\8f\98\82Ì", "Law", ROLE_LAWFUL, A_LAWFUL },
-    { "\92\86\97§", "\92\86\97§\82Ì", "Neu", ROLE_NEUTRAL, A_NEUTRAL },
-    { "\8d¬\93×", "\8d¬\93×\82Ì", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
-    { "\96³\90S", "\96³\90S\82Ì", "Una", 0, A_NONE }
+    { "\92\81\8f\98", "\92\81\8f\98\82Ì", "Law", "lawful", ROLE_LAWFUL, A_LAWFUL },
+    { "\92\86\97§", "\92\86\97§\82Ì", "Neu", "neutral", ROLE_NEUTRAL, A_NEUTRAL },
+    { "\8d¬\93×", "\8d¬\93×\82Ì", "Cha", "chaotic", ROLE_CHAOTIC, A_CHAOTIC },
+    { "\96³\90S", "\96³\90S\82Ì", "Una", "unaligned", 0, A_NONE }
 #endif
 };
 
@@ -1080,10 +1090,10 @@ STATIC_DCL int FDECL(role_gendercount, (int));
 STATIC_DCL int FDECL(race_alignmentcount, (int));
 
 /* used by str2XXX() */
-/*JP
 static char NEARDATA randomstr[] = "random";
-*/
-static char NEARDATA randomstr[] = "\83\89\83\93\83_\83\80";
+#if 1 /*JP*/
+static char NEARDATA randomstrj[] = "\83\89\83\93\83_\83\80";
+#endif
 
 boolean
 validrole(rolenum)
@@ -1140,13 +1150,26 @@ const char *str;
         /* Or the female name? */
         if (roles[i].name.f && !strncmpi(str, roles[i].name.f, len))
             return i;
+#if 1 /*JP*/
+        /* Does it match the male name? */
+        if (!strncmpi(str, roles[i].opt.m, len))
+            return i;
+        /* Or the female name? */
+        if (roles[i].opt.f && !strncmpi(str, roles[i].opt.f, len))
+            return i;
+#endif
         /* Or the filecode? */
         if (!strcmpi(str, roles[i].filecode))
             return i;
     }
 
     if ((len == 1 && (*str == '*' || *str == '@'))
+#if 0 /*JP*/
         || !strncmpi(str, randomstr, len))
+#else
+        || !strncmpi(str, randomstr, len)
+        || !strncmpi(str, randomstrj, len))
+#endif
         return ROLE_RANDOM;
 
     /* Couldn't find anything appropriate */
@@ -1206,13 +1229,23 @@ const char *str;
         /* Does it match the noun? */
         if (!strncmpi(str, races[i].noun, len))
             return i;
+#if 1 /*JP*/
+        /* Does it match the noun? */
+        if (!strncmpi(str, races[i].opt, len))
+            return i;
+#endif
         /* Or the filecode? */
         if (!strcmpi(str, races[i].filecode))
             return i;
     }
 
     if ((len == 1 && (*str == '*' || *str == '@'))
+#if 0 /*JP*/
         || !strncmpi(str, randomstr, len))
+#else
+        || !strncmpi(str, randomstr, len)
+        || !strncmpi(str, randomstrj, len))
+#endif
         return ROLE_RANDOM;
 
     /* Couldn't find anything appropriate */
@@ -1273,12 +1306,22 @@ const char *str;
         /* Does it match the adjective? */
         if (!strncmpi(str, genders[i].adj, len))
             return i;
+#if 1 /*JP*/
+        /* Does it match the adjective? */
+        if (!strncmpi(str, genders[i].opt, len))
+            return i;
+#endif
         /* Or the filecode? */
         if (!strcmpi(str, genders[i].filecode))
             return i;
     }
     if ((len == 1 && (*str == '*' || *str == '@'))
+#if 0 /*JP*/
         || !strncmpi(str, randomstr, len))
+#else
+        || !strncmpi(str, randomstr, len)
+        || !strncmpi(str, randomstrj, len))
+#endif
         return ROLE_RANDOM;
 
     /* Couldn't find anything appropriate */
@@ -1336,15 +1379,28 @@ const char *str;
     /* Match as much of str as is provided */
     len = strlen(str);
     for (i = 0; i < ROLE_ALIGNS; i++) {
+#if 0 /*JP*/
         /* Does it match the adjective? */
         if (!strncmpi(str, aligns[i].adj, len))
             return i;
+#else
+        /* Does it match the adjective? */
+        if (!strncmpi(str, aligns[i].noun, len))
+            return i;
+        if (!strncmpi(str, aligns[i].opt, len))
+            return i;
+#endif
         /* Or the filecode? */
         if (!strcmpi(str, aligns[i].filecode))
             return i;
     }
     if ((len == 1 && (*str == '*' || *str == '@'))
+#if 0 /*JP*/
         || !strncmpi(str, randomstr, len))
+#else
+        || !strncmpi(str, randomstr, len)
+        || !strncmpi(str, randomstrj, len))
+#endif
         return ROLE_RANDOM;
 
     /* Couldn't find anything appropriate */