X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Finit1.c;h=effa64260e9442f2f701086e8400ecd730025075;hb=efc142f5457acea2f3a823af0b6a42b851072f31;hp=f290234416bbf0333321a6fd58671ea0b0941d49;hpb=6ab2a63c654f0dac144165aba0f3bbe04495934d;p=hengband%2Fhengband.git diff --git a/src/init1.c b/src/init1.c index f29023441..effa64260 100644 --- a/src/init1.c +++ b/src/init1.c @@ -1,29 +1,25 @@ -/* File: init1.c */ - -/* - * Copyright (c) 1997 Ben Harrison - * +/*! + * @file init1.c + * @brief ã²ã¼ã ãã¼ã¿åæå1 / Initialization (part 1) -BEN- + * @date 2014/01/28 + * @author + *
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke * This software may be copied and distributed for educational, research, * and not for profit purposes provided that this copyright and statement * are included in all such copies. Other copyrights may also apply. - */ - -/* Purpose: Initialization (part 1) -BEN- */ - -#include "angband.h" - - -/* + * 2014 Deskull rearranged comment for Doxygen.\n + *+ * @details + *
* This file is used to initialize various variables and arrays for the * Angband game. Note the use of "fd_read()" and "fd_write()" to bypass * the common limitation of "read()" and "write()" to only 32767 bytes * at a time. - * * Several of the arrays for Angband are built from "template" files in * the "lib/file" directory, from which quick-load binary "image" files * are constructed whenever they are not present in the "lib/data" * directory, or if those files become obsolete, if we are allowed. - * * Warning -- the "ascii" file parsers use a minor hack to collect the * name and text information in a single pass. Thus, the game will not * be able to load any template file with more than 20K of names or 60K @@ -36,12 +32,24 @@ * "*.raw" files in "lib/data", and then quit, and recompile without * defining ALLOW_TEMPLATES, which will both save 20K and prevent people * from changing the ascii template files in potentially dangerous ways. - * + * ãã¼ãã¨ãã¦è¨é²ï¼ALLOW_TEMPLATESãå®ç¾©ããã¦ããªãå ´åã + * ãã®ãã¡ã¤ã«ã®ã³ã¼ãã®å¤ãã¯ã³ã³ãã¤ã«åºåãããæ¬ã²ã¼ã 㯠+ * æ£è¦ã®ããã¤ããªãã³ãã¬ã¼ããã¡ã¤ã«ããlib/dataãã¡ã¤ã«å ã« + * åå¨ããªãéãèµ·åããªããªããä¸æ¹ALLOW_TEMPLATESãå®ç¾©ããã¦ãã + * ãªãã°ï¼åº¦ã²ã¼ã ãèµ·åãããã¨ã«*.rawãã¡ã¤ã«ç¾¤ãä½æãããçµäºæã«ã¯ + * ALLOW_TEMPLATEã®å®ç¾©ã«é¢ä¿ãªããªã³ã³ãã¤ã«ããããããã«ãã20K(ãã¤ãï¼) + * ã®ãã¼ã¿ãä¿åããããã¬ã¤ã¤ã¼ãæ½å¨çã«å±éºãªæ¹æ³ã§asciiæåã® + * ãã³ãã¬ã¼ããã¡ã¤ã«ãå¤æ´ãããã¨ã妨ãããã¨ãã§ããã * The code could actually be removed and placed into a "stand-alone" * program, but that feels a little silly, especially considering some * of the platforms that we currently support. + **/ +#include "angband.h" + + + #ifdef ALLOW_TEMPLATES #include "init.h" @@ -49,7 +57,8 @@ /*** Helper arrays for parsing ascii template files ***/ -/* +/*! + * ã¢ã³ã¹ã¿ã¼ã®æææ段ãã¼ã¯ã³ã®å®ç¾© / * Monster Blow Methods */ static cptr r_info_blow_method[] = @@ -84,7 +93,8 @@ static cptr r_info_blow_method[] = }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ã®ææå±æ§ãã¼ã¯ã³ã®å®ç¾© / * Monster Blow Effects */ static cptr r_info_blow_effect[] = @@ -128,8 +138,8 @@ static cptr r_info_blow_effect[] = NULL }; - -/* +/*! + * å°å½¢å±æ§ãã¼ã¯ã³ã®å®ç¾© / * Feature info flags */ static cptr f_info_flags[] = @@ -253,7 +263,8 @@ static cptr f_info_flags[] = }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©1 / * Monster race flags */ static cptr r_info_flags1[] = @@ -292,7 +303,8 @@ static cptr r_info_flags1[] = "XXX3" }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©2 / * Monster race flags */ static cptr r_info_flags2[] = @@ -331,7 +343,8 @@ static cptr r_info_flags2[] = "QUANTUM" }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©3 / * Monster race flags */ static cptr r_info_flags3[] = @@ -370,7 +383,8 @@ static cptr r_info_flags3[] = "NO_SLEEP" }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©4 / * Monster race flags */ static cptr r_info_flags4[] = @@ -409,10 +423,11 @@ static cptr r_info_flags4[] = "BR_DISI", }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³(çºååè½å1) / * Monster race flags */ -static cptr r_info_flags5[] = +static cptr r_a_ability_flags1[] = { "BA_ACID", "BA_ELEC", @@ -448,10 +463,11 @@ static cptr r_info_flags5[] = "HOLD" }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³(çºååè½å2) / * Monster race flags */ -static cptr r_info_flags6[] = +static cptr r_a_ability_flags2[] = { "HASTE", "HAND_DOOM", @@ -487,8 +503,89 @@ static cptr r_info_flags6[] = "S_UNIQUE" }; +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³(çºååè½å3) / + * Monster race flags + */ +static cptr r_a_ability_flags3[] = +{ + "XXXA3X00", + "XXXA3X01", + "XXXA3X02", + "XXXA3X03", + "XXXA3X04", + "XXXA3X05", + "XXXA3X06", + "XXXA3X07", + "XXXA3X08", + "XXXA3X09", + "XXXA3X10", + "XXXA3X11", + "XXXA3X12", + "XXXA3X13", + "XXXA3X14", + "XXXA3X15", + "XXXA3X16", + "XXXA3X17", + "XXXA3X18", + "XXXA3X19", + "XXXA3X20", + "XXXA3X21", + "XXXA3X22", + "XXXA3X23", + "XXXA3X24", + "XXXA3X25", + "XXXA3X26", + "XXXA3X27", + "XXXA3X28", + "XXXA3X29", + "XXXA3X30", + "XXXA3X31", +}; + +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³(çºååè½å4) / + * Monster race flags + */ +static cptr r_a_ability_flags4[] = +{ + "XXXA4X00", + "XXXA4X01", + "XXXA4X02", + "XXXA4X03", + "XXXA4X04", + "XXXA4X05", + "XXXA4X06", + "XXXA4X07", + "XXXA4X08", + "XXXA4X09", + "XXXA4X10", + "XXXA4X11", + "XXXA4X12", + "XXXA4X13", + "XXXA4X14", + "XXXA4X15", + "XXXA4X16", + "XXXA4X17", + "XXXA4X18", + "XXXA4X19", + "XXXA4X20", + "XXXA4X21", + "XXXA4X22", + "XXXA4X23", + "XXXA4X24", + "XXXA4X25", + "XXXA4X26", + "XXXA4X27", + "XXXA4X28", + "XXXA4X29", + "XXXA4X30", + "XXXA4X31", +}; + -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©7 / * Monster race flags */ static cptr r_info_flags7[] = @@ -527,7 +624,8 @@ static cptr r_info_flags7[] = "XXX7X31", }; -/* +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©8 / * Monster race flags */ static cptr r_info_flags8[] = @@ -567,8 +665,9 @@ static cptr r_info_flags8[] = }; -/* - * Monster race flags - Drops +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©9 / + * Monster race flags */ static cptr r_info_flags9[] = { @@ -608,8 +707,9 @@ static cptr r_info_flags9[] = }; -/* - * Monster race flags - Resistances +/*! + * ã¢ã³ã¹ã¿ã¼ç¹æ§ãã¼ã¯ã³ã®å®ç¾©R(èæ§) / + * Monster race flags */ static cptr r_info_flagsr[] = { @@ -648,7 +748,8 @@ static cptr r_info_flagsr[] = }; -/* +/*! + * ãªãã¸ã§ã¯ãåºæ¬ç¹æ§ãã¼ã¯ã³ã®å®ç¾© / * Object flags */ static cptr k_info_flags[] = @@ -701,7 +802,7 @@ static cptr k_info_flags[] = "THROW", "REFLECT", "FREE_ACT", - "HOLD_LIFE", + "HOLD_EXP", "RES_ACID", "RES_ELEC", "RES_FIRE", @@ -798,6 +899,10 @@ static cptr k_info_flags[] = "SLOW_REGEN", }; +/*! + * ãªãã¸ã§ã¯ãçæç¹æ§ãã¼ã¯ã³ã®å®ç¾© / + * Object flags + */ static cptr k_info_gen_flags[] = { "INSTA_ART", @@ -834,7 +939,8 @@ static cptr k_info_gen_flags[] = "XXX", }; -/* +/*! + * ãã³ã¸ã§ã³ç¹æ§ãã¼ã¯ã³ã®å®ç¾© / * Dungeon flags */ static cptr d_info_flags1[] = @@ -874,9 +980,15 @@ static cptr d_info_flags1[] = }; -/* +/*! + * @brief ãã¼ã¿ã®å¯å¤æååæ å ±ãããã¹ãã¨ãã¦ä¿ç®¡ãã / * Add a text to the text-storage and store offset to it. - * + * @param offset æååä¿ç®¡ãã¤ã³ã¿ããã®ãªãã»ãã + * @param head ããã¹ãä¿ç®¡ãããæ å ±ã®æ§é ä½åç §ãã¤ã³ã¿ + * @param buf ä¿ç®¡æåå + * @param normal_text ããã¹ãã®æ£è¦åãè¡ã + * @return + * ç¡äºä¿ç®¡ãã§ãããTRUEãè¿ãã * Returns FALSE when there isn't enough space available to store * the text. */ @@ -931,11 +1043,16 @@ static bool add_text(u32b *offset, header *head, cptr buf, bool normal_text) } -/* +/*! + * @brief ãã¼ã¿ã®å¯å¤æååæ å ±ãååã¨ãã¦ä¿ç®¡ãã / * Add a name to the name-storage and return an offset to it. - * + * @param offset æååä¿ç®¡ãã¤ã³ã¿ããã®ãªãã»ãã + * @param head ããã¹ãä¿ç®¡ãããæ å ±ã®æ§é ä½åç §ãã¤ã³ã¿ + * @param buf ä¿ç®¡æåå + * @return + * ç¡äºä¿ç®¡ãã§ãããTRUEãè¿ãã * Returns FALSE when there isn't enough space available to store - * the name. + * the text. */ static bool add_name(u32b *offset, header *head, cptr buf) { @@ -961,11 +1078,16 @@ static bool add_name(u32b *offset, header *head, cptr buf) } -/* +/*! + * @brief ãã¼ã¿ã®å¯å¤æååæ å ±ãã¿ã°ã¨ãã¦ä¿ç®¡ãã / * Add a tag to the tag-storage and return an offset to it. - * + * @param offset æååä¿ç®¡ãã¤ã³ã¿ããã®ãªãã»ãã + * @param head ããã¹ãä¿ç®¡ãããæ å ±ã®æ§é ä½åç §ãã¤ã³ã¿ + * @param buf ä¿ç®¡æåå + * @return + * ç¡äºä¿ç®¡ãã§ãããTRUEãè¿ãã * Returns FALSE when there isn't enough space available to store - * the name. + * the text. */ static bool add_tag(s16b *offset, header *head, cptr buf) { @@ -1003,9 +1125,12 @@ static bool add_tag(s16b *offset, header *head, cptr buf) } -/* +/*! + * @brief ã·ã³ãã«1æåãã«ã©ã¼IDã«å¤æ´ãã / * Convert a "color letter" into an "actual" color * The colors are: dwsorgbuDWvyRGBU, as shown below + * @param c ã·ã³ãã«æå + * @return ã«ã©ã¼ID */ byte color_char_to_attr(char c) { @@ -1038,8 +1163,14 @@ byte color_char_to_attr(char c) /*** Initialize from ascii template files ***/ -/* +/*! + * @brief ãã¼ã¹é¢æ°ã«åºã¥ãã¦ãã¼ã¿ãã¡ã¤ã«ãããã¼ã¿ãèªã¿åã / * Initialize an "*_info" array, by parsing an ascii "template" file + * @param fp èªã¿åãã«ä½¿ããã¡ã¤ã«ãã¤ã³ã¿ + * @param buf èªã¿åãã«ä½¿ããããã¡é å + * @param head ãããæ§é ä½ + * @param parse_info_txt_line ãã¼ã¹é¢æ° + * @return ã¨ã©ã¼ã³ã¼ã */ errr init_info_txt(FILE *fp, char *buf, header *head, parse_info_txt_func parse_info_txt_line) @@ -1104,8 +1235,12 @@ errr init_info_txt(FILE *fp, char *buf, header *head, } -/* +/*! + * @brief Vaultæ å ±(v_info)ã®ãã¼ã¹é¢æ° / * Initialize the "v_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_v_info(char *buf, header *head) { @@ -1186,9 +1321,12 @@ errr parse_v_info(char *buf, header *head) } - -/* +/*! + * @brief è·æ¥æè½æ å ±(s_info)ã®ãã¼ã¹é¢æ° / * Initialize the "s_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_s_info(char *buf, header *head) { @@ -1268,8 +1406,12 @@ errr parse_s_info(char *buf, header *head) } -/* +/*! + * @brief è·æ¥éæ³æ å ±(m_info)ã®ãã¼ã¹é¢æ° / * Initialize the "m_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_m_info(char *buf, header *head) { @@ -1396,8 +1538,13 @@ errr parse_m_info(char *buf, header *head) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(æ±ç¨) / * Grab one flag from a textual string + * @param flags ããããã©ã°ã追å ããå ã®åç §ãã¤ã³ã¿ + * @param names ãã¼ã¯ã³å®ç¾©é å + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_flag(u32b *flags, cptr names[], cptr what) { @@ -1417,8 +1564,12 @@ static errr grab_one_flag(u32b *flags, cptr names[], cptr what) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ãï¼å°å½¢æ å ±åãï¼ / * Grab one flag in an feature_type from a textual string + * @param f_ptr å°å½¢æ å ±ãä¿ç®¡ããå ã®æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_feat_flag(feature_type *f_ptr, cptr what) { @@ -1435,19 +1586,20 @@ static errr grab_one_feat_flag(feature_type *f_ptr, cptr what) } /* Oops */ -#ifdef JP - msg_format("̤ÃΤÎÃÏ·Á¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown feature flag '%s'.", what); -#endif + msg_format(_("æªç¥ã®å°å½¢ãã©ã° '%s'ã", "Unknown feature flag '%s'."), what); /* Error */ return PARSE_ERROR_GENERIC; } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°(ã¹ãã¼ã)ãä¸ã¤å¾ãï¼å°å½¢æ å ±åã2ï¼ / * Grab an action in an feature_type from a textual string + * @param f_ptr å°å½¢æ å ±ãä¿ç®¡ããå ã®æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @param count ã¹ãã¼ãã®ä¿åå ID + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_feat_action(feature_type *f_ptr, cptr what, int count) { @@ -1464,19 +1616,19 @@ static errr grab_one_feat_action(feature_type *f_ptr, cptr what, int count) } /* Oops */ -#ifdef JP - msg_format("̤ÃΤÎÃÏ·Á¥¢¥¯¥·¥ç¥ó '%s'¡£", what); -#else - msg_format("Unknown feature action '%s'.", what); -#endif + msg_format(_("æªç¥ã®å°å½¢ã¢ã¯ã·ã§ã³ '%s'ã", "Unknown feature action '%s'."), what); /* Error */ return PARSE_ERROR_GENERIC; } -/* +/*! + * @brief å°å½¢æ å ±(f_info)ã®ãã¼ã¹é¢æ° / * Initialize the "f_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_f_info(char *buf, header *head) { @@ -1759,8 +1911,11 @@ errr parse_f_info(char *buf, header *head) } -/* +/*! + * @brief å°å½¢ã¿ã°ããIDãå¾ã / * Convert a fake tag to a real feat index + * @param str ã¿ã°æåå + * @return å°å½¢ID */ s16b f_tag_to_index(cptr str) { @@ -1781,8 +1936,11 @@ s16b f_tag_to_index(cptr str) } -/* +/*! + * @brief å°å½¢ã¿ã°ããIDãå¾ã / * Search for real index corresponding to this fake tag + * @param feat ã¿ã°æåå + * @return ãªã */ static void search_real_feat(s16b *feat) { @@ -1803,16 +1961,15 @@ static void search_real_feat(s16b *feat) } /* Undefined tag */ -#ifdef JP - msg_format("̤ÄêµÁ¤Î¥¿¥° '%s'¡£", f_tag + (-(*feat))); -#else - msg_format("%s is undefined.", f_tag + (-(*feat))); -#endif + msg_format(_("æªå®ç¾©ã®ã¿ã° '%s'ã", "%s is undefined."), f_tag + (-(*feat))); } -/* +/*! + * @brief å°å½¢æ å ±ã®å種ã¿ã°ããIDã¸å¤æãã¦çµæãåãã / * Retouch fake tags of f_info + * @param head ãããæ§é ä½ + * @return ãªã */ void retouch_f_info(header *head) { @@ -1833,8 +1990,12 @@ void retouch_f_info(header *head) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ãã¼ã¹ã¢ã¤ãã ç¨) / * Grab one flag in an object_kind from a textual string + * @param k_ptr ä¿ç®¡å ã®ãã¼ã¹ã¢ã¤ãã æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_kind_flag(object_kind *k_ptr, cptr what) { @@ -1854,19 +2015,17 @@ static errr grab_one_kind_flag(object_kind *k_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥ¢¥¤¥Æ¥à¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown object flag '%s'.", what); -#endif - + msg_format(_("æªç¥ã®ã¢ã¤ãã ã»ãã©ã° '%s'ã", "Unknown object flag '%s'."), what); /* Error */ return (1); } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(çºåè½åç¨) / * Grab one activation index flag + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return çºåè½åID */ static byte grab_one_activation_flag(cptr what) { @@ -1889,19 +2048,19 @@ static byte grab_one_activation_flag(cptr what) } /* Oops */ -#ifdef JP - msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown activation flag '%s'.", what); -#endif + msg_format(_("æªç¥ã®çºåã»ãã©ã° '%s'ã", "Unknown activation flag '%s'."), what); /* Error */ return (0); } -/* +/*! + * @brief ãã¼ã¹ã¢ã¤ãã (k_info)ã®ãã¼ã¹é¢æ° / * Initialize the "k_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_k_info(char *buf, header *head) { @@ -1971,8 +2130,8 @@ errr parse_k_info(char *buf, header *head) #ifdef JP - /* ±Ñ¸ì̾¤òÆɤà¥ë¡¼¥Á¥ó¤òÄɲà */ - /* 'E' ¤«¤é»Ï¤Þ¤ë¹Ô¤Ï±Ñ¸ì̾¤È¤·¤Æ¤¤¤ë */ + /* è±èªåãèªãã«ã¼ãã³ã追å */ + /* 'E' ããå§ã¾ãè¡ã¯è±èªåã¨ãã¦ãã */ else if (buf[0] == 'E') { /* nothing to do */ @@ -2083,7 +2242,6 @@ errr parse_k_info(char *buf, header *head) /* Process 'A' for "Allocation" (one line only) */ else if (buf[0] == 'A') { - int i; /* XXX XXX XXX Simply read each number following a colon */ for (i = 0, s = buf+1; s && (s[0] == ':') && s[1]; ++i) @@ -2174,9 +2332,12 @@ errr parse_k_info(char *buf, header *head) return (0); } - -/* - * Grab one flag in an artifact_type from a textual string +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã¼ãã£ãã¡ã¯ãç¨) / + * Grab one activation index flag + * @param a_ptr ä¿ç®¡å ã®ã¢ã¼ãã£ãã¡ã¯ãæ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ããã£ãå ´å1ãã¨ã©ã¼ããªãå ´å0ãè¿ã */ static errr grab_one_artifact_flag(artifact_type *a_ptr, cptr what) { @@ -2196,20 +2357,19 @@ static errr grab_one_artifact_flag(artifact_type *a_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown artifact flag '%s'.", what); -#endif - + msg_format(_("æªç¥ã®ä¼èª¬ã®ã¢ã¤ãã ã»ãã©ã° '%s'ã", "Unknown artifact flag '%s'."), what); /* Error */ return (1); } -/* +/*! + * @brief åºå®ã¢ã¼ãã£ãã¡ã¯ãæ å ±(a_info)ã®ãã¼ã¹é¢æ° / * Initialize the "a_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_a_info(char *buf, header *head) { @@ -2267,8 +2427,8 @@ errr parse_a_info(char *buf, header *head) #ifdef JP - /* ±Ñ¸ì̾¤òÆɤà¥ë¡¼¥Á¥ó¤òÄɲà */ - /* 'E' ¤«¤é»Ï¤Þ¤ë¹Ô¤Ï±Ñ¸ì̾¤È¤·¤Æ¤¤¤ë */ + /* è±èªåãèªãã«ã¼ãã³ã追å */ + /* 'E' ããå§ã¾ãè¡ã¯è±èªåã¨ãã¦ãã */ else if (buf[0] == 'E') { /* nothing to do */ @@ -2402,8 +2562,12 @@ errr parse_a_info(char *buf, header *head) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã¼ãã£ãã¡ã¯ãç¨) / * Grab one flag in a ego-item_type from a textual string + * @param e_ptr ä¿ç®¡å ã®ã¨ã´æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ããã£ãå ´å1ãã¨ã©ã¼ããªãå ´å0ãè¿ã */ static bool grab_one_ego_item_flag(ego_item_type *e_ptr, cptr what) { @@ -2423,22 +2587,19 @@ static bool grab_one_ego_item_flag(ego_item_type *e_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤÎ̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown ego-item flag '%s'.", what); -#endif - + msg_format(_("æªç¥ã®åã®ããã¢ã¤ãã ã»ãã©ã° '%s'ã", "Unknown ego-item flag '%s'."), what); /* Error */ return (1); } - - -/* +/*! + * @brief ã¢ã¤ãã ã¨ã´æ å ±(e_info)ã®ãã¼ã¹é¢æ° / * Initialize the "e_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_e_info(char *buf, header *head) { @@ -2497,8 +2658,8 @@ errr parse_e_info(char *buf, header *head) #ifdef JP - /* ±Ñ¸ì̾¤òÆɤà¥ë¡¼¥Á¥ó¤òÄɲà */ - /* 'E' ¤«¤é»Ï¤Þ¤ë¹Ô¤Ï±Ñ¸ì̾ */ + /* è±èªåãèªãã«ã¼ãã³ã追å */ + /* 'E' ããå§ã¾ãè¡ã¯è±èªå */ else if (buf[0] == 'E') { /* nothing to do */ @@ -2620,8 +2781,12 @@ errr parse_e_info(char *buf, header *head) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã³ã¹ã¿ã¼ç¨1) / * Grab one (basic) flag in a monster_race from a textual string + * @param r_ptr ä¿ç®¡å ã®ã¢ã³ã¹ã¿ã¼ç¨®ææ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_basic_flag(monster_race *r_ptr, cptr what) { @@ -2647,49 +2812,45 @@ static errr grab_one_basic_flag(monster_race *r_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥâ¥ó¥¹¥¿¡¼¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown monster flag '%s'.", what); -#endif - + msg_format(_("æªç¥ã®ã¢ã³ã¹ã¿ã¼ã»ãã©ã° '%s'ã", "Unknown monster flag '%s'."), what); /* Failure */ return (1); } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã³ã¹ã¿ã¼ç¨2) / * Grab one (spell) flag in a monster_race from a textual string + * @param r_ptr ä¿ç®¡å ã®ã¢ã³ã¹ã¿ã¼ç¨®ææ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_spell_flag(monster_race *r_ptr, cptr what) { if (grab_one_flag(&r_ptr->flags4, r_info_flags4, what) == 0) return 0; - if (grab_one_flag(&r_ptr->flags5, r_info_flags5, what) == 0) + if (grab_one_flag(&r_ptr->a_ability_flags1, r_a_ability_flags1, what) == 0) return 0; - if (grab_one_flag(&r_ptr->flags6, r_info_flags6, what) == 0) + if (grab_one_flag(&r_ptr->a_ability_flags2, r_a_ability_flags2, what) == 0) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥâ¥ó¥¹¥¿¡¼¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown monster flag '%s'.", what); -#endif - + msg_format(_("æªç¥ã®ã¢ã³ã¹ã¿ã¼ã»ãã©ã° '%s'ã", "Unknown monster flag '%s'."), what); /* Failure */ return (1); } - - -/* +/*! + * @brief ã¢ã³ã¹ã¿ã¼ç¨®ææ å ±(r_info)ã®ãã¼ã¹é¢æ° / * Initialize the "r_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_r_info(char *buf, header *head) { @@ -2741,8 +2902,8 @@ errr parse_r_info(char *buf, header *head) #ifdef JP - /* ±Ñ¸ì̾¤òÆɤà¥ë¡¼¥Á¥ó¤òÄɲà */ - /* 'E' ¤«¤é»Ï¤Þ¤ë¹Ô¤Ï±Ñ¸ì̾ */ + /* è±èªåãèªãã«ã¼ãã³ã追å */ + /* 'E' ããå§ã¾ãè¡ã¯è±èªå */ else if (buf[0] == 'E') { /* Acquire the Text */ @@ -2981,6 +3142,31 @@ errr parse_r_info(char *buf, header *head) } } + /* Process 'A' for "Artifact Flags" (multiple lines) */ + else if (buf[0] == 'A') + { + int id, per, rarity; + + /* Find the next empty blow slot (if any) */ + for (i = 0; i < 4; i++) if (!r_ptr->artifact_id[i]) break; + + /* Oops, no more slots */ + if (i == 4) return (1); + + if (3 != sscanf(buf+2, "%d:%d:%d", &id, &rarity, &per)) return (1); + r_ptr->artifact_id[i] = id; + r_ptr->artifact_rarity[i] = rarity; + r_ptr->artifact_percent[i] = per; + } + + /* Process 'V' for "Arena power value ratio" */ + else if (buf[0] == 'V') + { + int val; + if (3 != sscanf(buf+2, "%d", &val)) return (1); + r_ptr->arena_ratio = val; + } + /* Oops */ else return (6); @@ -2990,8 +3176,12 @@ errr parse_r_info(char *buf, header *head) } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ãã³ã¸ã§ã³ç¨) / * Grab one flag for a dungeon type from a textual string + * @param d_ptr ä¿ç®¡å ã®ãã³ã¸ã§ã³æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_dungeon_flag(dungeon_info_type *d_ptr, cptr what) { @@ -2999,18 +3189,18 @@ static errr grab_one_dungeon_flag(dungeon_info_type *d_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥÀ¥ó¥¸¥ç¥ó¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown dungeon type flag '%s'.", what); -#endif + msg_format(_("æªç¥ã®ãã³ã¸ã§ã³ã»ãã©ã° '%s'ã", "Unknown dungeon type flag '%s'."), what); /* Failure */ return (1); } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã³ã¹ã¿ã¼ã®ãã³ã¸ã§ã³åºç¾æ¡ä»¶ç¨1) / * Grab one (basic) flag in a monster_race from a textual string + * @param d_ptr ä¿ç®¡å ã®ãã³ã¸ã§ã³æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_basic_monster_flag(dungeon_info_type *d_ptr, cptr what) { @@ -3036,43 +3226,43 @@ static errr grab_one_basic_monster_flag(dungeon_info_type *d_ptr, cptr what) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥâ¥ó¥¹¥¿¡¼¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown monster flag '%s'.", what); -#endif + msg_format(_("æªç¥ã®ã¢ã³ã¹ã¿ã¼ã»ãã©ã° '%s'ã", "Unknown monster flag '%s'."), what); /* Failure */ return (1); } -/* +/*! + * @brief ããã¹ããã¼ã¯ã³ãèµ°æ»ãã¦ãã©ã°ãä¸ã¤å¾ã(ã¢ã³ã¹ã¿ã¼ã®ãã³ã¸ã§ã³åºç¾æ¡ä»¶ç¨2) / * Grab one (spell) flag in a monster_race from a textual string + * @param d_ptr ä¿ç®¡å ã®ãã³ã¸ã§ã³æ§é ä½åç §ãã¤ã³ã¿ + * @param what åç §å ã®æååãã¤ã³ã¿ + * @return ã¨ã©ã¼ã³ã¼ã */ static errr grab_one_spell_monster_flag(dungeon_info_type *d_ptr, cptr what) { if (grab_one_flag(&d_ptr->mflags4, r_info_flags4, what) == 0) return 0; - if (grab_one_flag(&d_ptr->mflags5, r_info_flags5, what) == 0) + if (grab_one_flag(&d_ptr->m_a_ability_flags1, r_a_ability_flags1, what) == 0) return 0; - if (grab_one_flag(&d_ptr->mflags6, r_info_flags6, what) == 0) + if (grab_one_flag(&d_ptr->m_a_ability_flags2, r_a_ability_flags2, what) == 0) return 0; /* Oops */ -#ifdef JP - msg_format("̤ÃΤΥâ¥ó¥¹¥¿¡¼¡¦¥Õ¥é¥° '%s'¡£", what); -#else - msg_format("Unknown monster flag '%s'.", what); -#endif + msg_format(_("æªç¥ã®ã¢ã³ã¹ã¿ã¼ã»ãã©ã° '%s'ã", "Unknown monster flag '%s'."), what); /* Failure */ return (1); } -/* +/*! + * @brief ãã³ã¸ã§ã³æ å ±(d_info)ã®ãã¼ã¹é¢æ° / * Initialize the "d_info" array, by parsing an ascii "template" file + * @param buf ããã¹ãå + * @param head ãããæ§é ä½ + * @return ã¨ã©ã¼ã³ã¼ã */ errr parse_d_info(char *buf, header *head) { @@ -3437,8 +3627,11 @@ struct dungeon_grid static dungeon_grid letter[255]; -/* +/*! + * @brief å°å½¢æ å ±ã®ãF:ãæ å ±ããã¼ã¹ãã * Process "F: