Commit MetaInfo

Revision3186dea7ec365e74c5c02365120eb998a0f899d5 (tree)
Time2020-08-28 06:20:46
AuthorSHIRAKATA Kentaro <argrath@ub32...>
CommiterSHIRAKATA Kentaro

Log Message

fix #40657

Change Summary

Incremental Difference

--- a/ChangeLog.j
+++ b/ChangeLog.j
@@ -1,5 +1,6 @@
11 * 次の問題を修正
22 * X11環境で日本語入力ができない (#40562)
3+ * 一部のオプションで英語のフルネームを使えない (#40657)
34
45 Sat Apr 18 2020 Kentaro Shirakata <argrath@ub32.org>
56
--- a/include/you.h
+++ b/include/you.h
@@ -104,6 +104,9 @@ struct u_roleplay {
104104 /*** Unified structure containing role information ***/
105105 struct Role {
106106 /*** Strings that name various things ***/
107+#if 1 /*JP*/
108+ struct RoleName opt; /* オプション指定文字列 */
109+#endif
107110 struct RoleName name; /* the role's name (from u_init.c) */
108111 struct RoleName rank[9]; /* names for experience levels (from botl.c) */
109112 const char *lgod, *ngod, *cgod; /* god names (from pray.c) */
@@ -180,6 +183,9 @@ extern struct Role urole;
180183
181184 struct Race {
182185 /*** Strings that name various things ***/
186+#if 1 /*JP*/
187+ const char *opt; /* オプション指定文字列 */
188+#endif
183189 const char *noun; /* noun ("human", "elf") */
184190 const char *adj; /* adjective ("human", "elven") */
185191 const char *coll; /* collective ("humanity", "elvenkind") */
@@ -230,6 +236,9 @@ struct Gender {
230236 const char *him; /* him/her/it */
231237 const char *his; /* his/her/its */
232238 const char *filecode; /* file code */
239+#if 1 /*JP*/
240+ const char *opt; /* オプション指定文字列 */
241+#endif
233242 short allow; /* equivalent ROLE_ mask */
234243 };
235244 #define ROLE_GENDERS 2 /* number of permitted player genders
@@ -254,6 +263,9 @@ struct Align {
254263 const char *noun; /* law/balance/chaos */
255264 const char *adj; /* lawful/neutral/chaotic */
256265 const char *filecode; /* file code */
266+#if 1 /*JP*/
267+ const char *opt; /* オプション指定文字列 */
268+#endif
257269 short allow; /* equivalent ROLE_ mask */
258270 aligntyp value; /* equivalent A_ value */
259271 };
--- a/src/role.c
+++ b/src/role.c
@@ -30,8 +30,8 @@
3030 * God names use a leading underscore to flag goddesses.
3131 */
3232 const struct Role roles[] = {
33-#if 0 /*JP:T*/
3433 { { "Archeologist", 0 },
34+#if 0 /*JP:T*/
3535 { { "Digger", 0 },
3636 { "Field Worker", 0 },
3737 { "Investigator", 0 },
@@ -43,7 +43,7 @@ const struct Role roles[] = {
4343 { "Curator", 0 } },
4444 "Quetzalcoatl", "Camaxtli", "Huhetotl", /* Central American */
4545 #else
46- { { "考古学者", 0 },
46+ { "考古学者", 0 },
4747 { { "鉱員", 0 },
4848 { "労働者", 0 },
4949 { "調査者", 0 },
@@ -91,8 +91,8 @@ const struct Role roles[] = {
9191 A_INT,
9292 SPE_MAGIC_MAPPING,
9393 -4 },
94-#if 0 /*JP:T*/
9594 { { "Barbarian", 0 },
95+#if 0 /*JP:T*/
9696 { { "Plunderer", "Plunderess" },
9797 { "Pillager", 0 },
9898 { "Bandit", 0 },
@@ -104,7 +104,7 @@ const struct Role roles[] = {
104104 { "Conqueror", "Conqueress" } },
105105 "Mitra", "Crom", "Set", /* Hyborian */
106106 #else
107- { { "野蛮人", 0 },
107+ { "野蛮人", 0 },
108108 { { "盗賊", 0 },
109109 { "略奪者", 0 },
110110 { "悪漢", 0 },
@@ -152,8 +152,8 @@ const struct Role roles[] = {
152152 A_INT,
153153 SPE_HASTE_SELF,
154154 -4 },
155-#if 0 /*JP:T*/
156155 { { "Caveman", "Cavewoman" },
156+#if 0 /*JP:T*/
157157 { { "Troglodyte", 0 },
158158 { "Aborigine", 0 },
159159 { "Wanderer", 0 },
@@ -165,7 +165,7 @@ const struct Role roles[] = {
165165 { "Pioneer", 0 } },
166166 "Anu", "_Ishtar", "Anshar", /* Babylonian */
167167 #else
168- { { "洞窟人", 0 },
168+ { "洞窟人", 0 },
169169 { { "穴居人", 0 },
170170 { "原住民", 0 },
171171 { "放浪者", 0 },
@@ -213,8 +213,8 @@ const struct Role roles[] = {
213213 A_INT,
214214 SPE_DIG,
215215 -4 },
216-#if 0 /*JP:T*/
217216 { { "Healer", 0 },
217+#if 0 /*JP:T*/
218218 { { "Rhizotomist", 0 },
219219 { "Empiric", 0 },
220220 { "Embalmer", 0 },
@@ -226,7 +226,7 @@ const struct Role roles[] = {
226226 { "Chirurgeon", 0 } },
227227 "_Athena", "Hermes", "Poseidon", /* Greek */
228228 #else
229- { { "薬師", 0 },
229+ { "薬師", 0 },
230230 { { "見習い", 0 },
231231 { "医師見習い", 0 },
232232 { "看護師", "看護婦" },
@@ -273,8 +273,8 @@ const struct Role roles[] = {
273273 A_WIS,
274274 SPE_CURE_SICKNESS,
275275 -4 },
276-#if 0 /*JP:T*/
277276 { { "Knight", 0 },
277+#if 0 /*JP:T*/
278278 { { "Gallant", 0 },
279279 { "Esquire", 0 },
280280 { "Bachelor", 0 },
@@ -286,7 +286,7 @@ const struct Role roles[] = {
286286 { "Paladin", 0 } },
287287 "Lugh", "_Brigit", "Manannan Mac Lir", /* Celtic */
288288 #else
289- { { "騎士", 0 },
289+ { "騎士", 0 },
290290 { { "見習い", 0 },
291291 { "歩兵", 0 },
292292 { "戦士", 0 },
@@ -333,8 +333,8 @@ const struct Role roles[] = {
333333 A_WIS,
334334 SPE_TURN_UNDEAD,
335335 -4 },
336-#if 0 /*JP:T*/
337336 { { "Monk", 0 },
337+#if 0 /*JP:T*/
338338 { { "Candidate", 0 },
339339 { "Novice", 0 },
340340 { "Initiate", 0 },
@@ -346,7 +346,7 @@ const struct Role roles[] = {
346346 { "Master", 0 } },
347347 "Shan Lai Ching", "Chih Sung-tzu", "Huan Ti", /* Chinese */
348348 #else
349- { { "武闘家", 0 },
349+ { "武闘家", 0 },
350350 { { "入門希望者", 0 },
351351 { "初心者", 0 },
352352 { "入門者伝", 0 },
@@ -394,8 +394,8 @@ const struct Role roles[] = {
394394 A_WIS,
395395 SPE_RESTORE_ABILITY,
396396 -4 },
397-#if 0 /*JP:T*/
398397 { { "Priest", "Priestess" },
398+#if 0 /*JP:T*/
399399 { { "Aspirant", 0 },
400400 { "Acolyte", 0 },
401401 { "Adept", 0 },
@@ -407,7 +407,7 @@ const struct Role roles[] = {
407407 { "High Priest", "High Priestess" } },
408408 0, 0, 0, /* deities from a randomly chosen other role will be used */
409409 #else
410- { { "僧侶", "尼僧" },
410+ { "僧侶", "尼僧" },
411411 { { "修道者", "修道女" },
412412 { "侍者", 0 },
413413 { "侍祭", 0 },
@@ -457,8 +457,8 @@ const struct Role roles[] = {
457457 -4 },
458458 /* Note: Rogue precedes Ranger so that use of `-R' on the command line
459459 retains its traditional meaning. */
460-#if 0 /*JP:T*/
461460 { { "Rogue", 0 },
461+#if 0 /*JP:T*/
462462 { { "Footpad", 0 },
463463 { "Cutpurse", 0 },
464464 { "Rogue", 0 },
@@ -470,7 +470,7 @@ const struct Role roles[] = {
470470 { "Thief", 0 } },
471471 "Issek", "Mog", "Kos", /* Nehwon */
472472 #else
473- { { "盗賊", 0 },
473+ { "盗賊", 0 },
474474 { { "追いはぎ", 0 },
475475 { "ひったくり", 0 },
476476 { "スリ", 0 },
@@ -517,8 +517,8 @@ const struct Role roles[] = {
517517 A_INT,
518518 SPE_DETECT_TREASURE,
519519 -4 },
520-#if 0 /*JP:T*/
521520 { { "Ranger", 0 },
521+#if 0 /*JP:T*/
522522 {
523523 #if 0 /* OBSOLETE */
524524 {"Edhel", "Elleth"},
@@ -544,7 +544,7 @@ const struct Role roles[] = {
544544 { "Marksman", "Markswoman" } },
545545 "Mercury", "_Venus", "Mars", /* Roman/planets */
546546 #else
547- { { "レンジャー", 0 },
547+ { "レンジャー", 0 },
548548 { { "新米", 0 },
549549 { "見張り", 0 },
550550 { "先導", 0 },
@@ -592,8 +592,8 @@ const struct Role roles[] = {
592592 A_INT,
593593 SPE_INVISIBILITY,
594594 -4 },
595-#if 0 /*JP:T*/
596595 { { "Samurai", 0 },
596+#if 0 /*JP:T*/
597597 { { "Hatamoto", 0 }, /* Banner Knight */
598598 { "Ronin", 0 }, /* no allegiance */
599599 { "Ninja", "Kunoichi" }, /* secret society */
@@ -605,7 +605,7 @@ const struct Role roles[] = {
605605 { "Shogun", 0 } }, /* supreme commander, warlord */
606606 "_Amaterasu Omikami", "Raijin", "Susanowo", /* Japanese */
607607 #else
608- { { "侍", 0 },
608+ { "侍", 0 },
609609 { { "旗本", 0 }, /* Banner Knight */
610610 { "浪人", 0 }, /* no allegiance */
611611 { "忍者", "くノ一" }, /* secret society */
@@ -652,8 +652,8 @@ const struct Role roles[] = {
652652 A_INT,
653653 SPE_CLAIRVOYANCE,
654654 -4 },
655-#if 0 /*JP:T*/
656655 { { "Tourist", 0 },
656+#if 0 /*JP:T*/
657657 { { "Rambler", 0 },
658658 { "Sightseer", 0 },
659659 { "Excursionist", 0 },
@@ -665,7 +665,7 @@ const struct Role roles[] = {
665665 { "Adventurer", 0 } },
666666 "Blind Io", "_The Lady", "Offler", /* Discworld */
667667 #else
668- { { "観光客", 0 },
668+ { "観光客", 0 },
669669 { { "プー太郎", "プー子" },
670670 { "観光客", 0 },
671671 { "周遊旅行者", 0 },
@@ -712,8 +712,8 @@ const struct Role roles[] = {
712712 A_INT,
713713 SPE_CHARM_MONSTER,
714714 -4 },
715-#if 0 /*JP:T*/
716715 { { "Valkyrie", 0 },
716+#if 0 /*JP:T*/
717717 { { "Stripling", 0 },
718718 { "Skirmisher", 0 },
719719 { "Fighter", 0 },
@@ -725,7 +725,7 @@ const struct Role roles[] = {
725725 { "Lord", "Lady" } },
726726 "Tyr", "Odin", "Loki", /* Norse */
727727 #else
728- { { "ワルキューレ", 0 },
728+ { "ワルキューレ", 0 },
729729 { { "見習い", 0 },
730730 { "歩兵", 0 },
731731 { "戦士", 0 },
@@ -772,8 +772,8 @@ const struct Role roles[] = {
772772 A_WIS,
773773 SPE_CONE_OF_COLD,
774774 -4 },
775-#if 0 /*JP:T*/
776775 { { "Wizard", 0 },
776+#if 0 /*JP:T*/
777777 { { "Evoker", 0 },
778778 { "Conjurer", 0 },
779779 { "Thaumaturge", 0 },
@@ -785,7 +785,7 @@ const struct Role roles[] = {
785785 { "Mage", 0 } },
786786 "Ptah", "Thoth", "Anhur", /* Egyptian */
787787 #else
788- { { "魔法使い", 0 },
788+ { "魔法使い", 0 },
789789 { { "手品師", 0 },
790790 { "奇術師", 0 },
791791 { "占い師", 0 },
@@ -834,7 +834,11 @@ const struct Role roles[] = {
834834 SPE_MAGIC_MISSILE,
835835 -4 },
836836 /* Array terminator */
837+#if 0 /*JP*/
837838 { { 0, 0 } }
839+#else
840+ { { 0, 0 }, { 0, 0 } }
841+#endif
838842 };
839843
840844 /* The player's role, created at runtime from initial
@@ -842,6 +846,9 @@ const struct Role roles[] = {
842846 */
843847 struct Role urole = {
844848 { "Undefined", 0 },
849+#if 1 /*JP*/
850+ { "Undefined", 0 },
851+#endif
845852 { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
846853 { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
847854 "L", "N", "C",
@@ -868,8 +875,8 @@ struct Role urole = {
868875 /* Table of all races */
869876 const struct Race races[] = {
870877 {
871-#if 0 /*JP:T*/
872878 "human",
879+#if 0 /*JP:T*/
873880 "human",
874881 "humanity",
875882 #else
@@ -900,8 +907,8 @@ const struct Race races[] = {
900907 { 1, 0, 2, 0, 2, 0 } /* Energy */
901908 },
902909 {
903-#if 0 /*JP:T*/
904910 "elf",
911+#if 0 /*JP:T*/
905912 "elven",
906913 "elvenkind",
907914 #else
@@ -927,8 +934,8 @@ const struct Race races[] = {
927934 { 2, 0, 3, 0, 3, 0 } /* Energy */
928935 },
929936 {
930-#if 0 /*JP:T*/
931937 "dwarf",
938+#if 0 /*JP:T*/
932939 "dwarven",
933940 "dwarvenkind",
934941 #else
@@ -954,8 +961,8 @@ const struct Race races[] = {
954961 { 0, 0, 0, 0, 0, 0 } /* Energy */
955962 },
956963 {
957-#if 0 /*JP:T*/
958964 "gnome",
965+#if 0 /*JP:T*/
959966 "gnomish",
960967 "gnomehood",
961968 #else
@@ -981,8 +988,8 @@ const struct Race races[] = {
981988 { 2, 0, 2, 0, 2, 0 } /* Energy */
982989 },
983990 {
984-#if 0 /*JP:T*/
985991 "orc",
992+#if 0 /*JP:T*/
986993 "orcish",
987994 "orcdom",
988995 #else
@@ -1015,6 +1022,9 @@ const struct Race races[] = {
10151022 * choices. This may be munged in role_init().
10161023 */
10171024 struct Race urace = {
1025+#if 1 /*JP*/
1026+ "something",
1027+#endif
10181028 "something",
10191029 "undefined",
10201030 "something",
@@ -1047,9 +1057,9 @@ const struct Gender genders[] = {
10471057 { "female", "she", "her", "her", "Fem", ROLE_FEMALE },
10481058 { "neuter", "it", "it", "its", "Ntr", ROLE_NEUTER }
10491059 #else
1050- { "男性", "彼", "彼", "彼の", "Mal", ROLE_MALE },
1051- { "女性", "彼女", "彼女", "彼女の", "Fem", ROLE_FEMALE },
1052- { "中性", "それ", "それ", "その", "Ntr", ROLE_NEUTER }
1060+ { "男性", "彼", "彼", "彼の", "Mal", "male", ROLE_MALE },
1061+ { "女性", "彼女", "彼女", "彼女の", "Fem", "female", ROLE_FEMALE },
1062+ { "中性", "それ", "それ", "その", "Ntr", "neuter", ROLE_NEUTER }
10531063 #endif
10541064 };
10551065
@@ -1061,10 +1071,10 @@ const struct Align aligns[] = {
10611071 { "chaos", "chaotic", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
10621072 { "evil", "unaligned", "Una", 0, A_NONE }
10631073 #else
1064- { "秩序", "秩序の", "Law", ROLE_LAWFUL, A_LAWFUL },
1065- { "中立", "中立の", "Neu", ROLE_NEUTRAL, A_NEUTRAL },
1066- { "混沌", "混沌の", "Cha", ROLE_CHAOTIC, A_CHAOTIC },
1067- { "無心", "無心の", "Una", 0, A_NONE }
1074+ { "秩序", "秩序の", "Law", "lawful", ROLE_LAWFUL, A_LAWFUL },
1075+ { "中立", "中立の", "Neu", "neutral", ROLE_NEUTRAL, A_NEUTRAL },
1076+ { "混沌", "混沌の", "Cha", "chaotic", ROLE_CHAOTIC, A_CHAOTIC },
1077+ { "無心", "無心の", "Una", "unaligned", 0, A_NONE }
10681078 #endif
10691079 };
10701080
@@ -1080,10 +1090,10 @@ STATIC_DCL int FDECL(role_gendercount, (int));
10801090 STATIC_DCL int FDECL(race_alignmentcount, (int));
10811091
10821092 /* used by str2XXX() */
1083-/*JP
10841093 static char NEARDATA randomstr[] = "random";
1085-*/
1086-static char NEARDATA randomstr[] = "ランダム";
1094+#if 1 /*JP*/
1095+static char NEARDATA randomstrj[] = "ランダム";
1096+#endif
10871097
10881098 boolean
10891099 validrole(rolenum)
@@ -1140,13 +1150,26 @@ const char *str;
11401150 /* Or the female name? */
11411151 if (roles[i].name.f && !strncmpi(str, roles[i].name.f, len))
11421152 return i;
1153+#if 1 /*JP*/
1154+ /* Does it match the male name? */
1155+ if (!strncmpi(str, roles[i].opt.m, len))
1156+ return i;
1157+ /* Or the female name? */
1158+ if (roles[i].opt.f && !strncmpi(str, roles[i].opt.f, len))
1159+ return i;
1160+#endif
11431161 /* Or the filecode? */
11441162 if (!strcmpi(str, roles[i].filecode))
11451163 return i;
11461164 }
11471165
11481166 if ((len == 1 && (*str == '*' || *str == '@'))
1167+#if 0 /*JP*/
11491168 || !strncmpi(str, randomstr, len))
1169+#else
1170+ || !strncmpi(str, randomstr, len)
1171+ || !strncmpi(str, randomstrj, len))
1172+#endif
11501173 return ROLE_RANDOM;
11511174
11521175 /* Couldn't find anything appropriate */
@@ -1206,13 +1229,23 @@ const char *str;
12061229 /* Does it match the noun? */
12071230 if (!strncmpi(str, races[i].noun, len))
12081231 return i;
1232+#if 1 /*JP*/
1233+ /* Does it match the noun? */
1234+ if (!strncmpi(str, races[i].opt, len))
1235+ return i;
1236+#endif
12091237 /* Or the filecode? */
12101238 if (!strcmpi(str, races[i].filecode))
12111239 return i;
12121240 }
12131241
12141242 if ((len == 1 && (*str == '*' || *str == '@'))
1243+#if 0 /*JP*/
12151244 || !strncmpi(str, randomstr, len))
1245+#else
1246+ || !strncmpi(str, randomstr, len)
1247+ || !strncmpi(str, randomstrj, len))
1248+#endif
12161249 return ROLE_RANDOM;
12171250
12181251 /* Couldn't find anything appropriate */
@@ -1273,12 +1306,22 @@ const char *str;
12731306 /* Does it match the adjective? */
12741307 if (!strncmpi(str, genders[i].adj, len))
12751308 return i;
1309+#if 1 /*JP*/
1310+ /* Does it match the adjective? */
1311+ if (!strncmpi(str, genders[i].opt, len))
1312+ return i;
1313+#endif
12761314 /* Or the filecode? */
12771315 if (!strcmpi(str, genders[i].filecode))
12781316 return i;
12791317 }
12801318 if ((len == 1 && (*str == '*' || *str == '@'))
1319+#if 0 /*JP*/
12811320 || !strncmpi(str, randomstr, len))
1321+#else
1322+ || !strncmpi(str, randomstr, len)
1323+ || !strncmpi(str, randomstrj, len))
1324+#endif
12821325 return ROLE_RANDOM;
12831326
12841327 /* Couldn't find anything appropriate */
@@ -1336,15 +1379,28 @@ const char *str;
13361379 /* Match as much of str as is provided */
13371380 len = strlen(str);
13381381 for (i = 0; i < ROLE_ALIGNS; i++) {
1382+#if 0 /*JP*/
13391383 /* Does it match the adjective? */
13401384 if (!strncmpi(str, aligns[i].adj, len))
13411385 return i;
1386+#else
1387+ /* Does it match the adjective? */
1388+ if (!strncmpi(str, aligns[i].noun, len))
1389+ return i;
1390+ if (!strncmpi(str, aligns[i].opt, len))
1391+ return i;
1392+#endif
13421393 /* Or the filecode? */
13431394 if (!strcmpi(str, aligns[i].filecode))
13441395 return i;
13451396 }
13461397 if ((len == 1 && (*str == '*' || *str == '@'))
1398+#if 0 /*JP*/
13471399 || !strncmpi(str, randomstr, len))
1400+#else
1401+ || !strncmpi(str, randomstr, len)
1402+ || !strncmpi(str, randomstrj, len))
1403+#endif
13481404 return ROLE_RANDOM;
13491405
13501406 /* Couldn't find anything appropriate */
Show on old repository browser