X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fdungeon.c;h=28a77d2895e4acefc12857b5e8e4134b8ed1f6c9;hb=65f1bf941932b6d02fdba31cfc3f95dea7ef3e6e;hp=aae3364337d01f67a56c79124d276d36e7087960;hpb=b881966a89a268654597278beeccaeb6871ce8ab;p=hengband%2Fhengband.git diff --git a/src/dungeon.c b/src/dungeon.c index aae336433..28a77d289 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,27 +1,36 @@ -/* File: dungeonc */ - -/* - * 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. +/*! + @file dungeon.c + @brief Angbandã²ã¼ã ã¨ã³ã¸ã³ / Angband game engine + @date 2013/12/31 + @author + Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n + This software may be copied and distributed for educational, research, and\n + not for profit purposes provided that this copyright and statement are\n + included in all such copies.\n + 2013 Deskull rearranged comment for Doxygen. */ -/* Purpose: Angband game engine */ - #include "angband.h" - -#define TY_CURSE_CHANCE 200 -#define CHAINSWORD_NOISE 100 - -static bool load = TRUE; -static int wild_regen = 20; - -/* - * Return a "feeling" (or NULL) about an item. Method 1 (Heavy). +#include "cmd-activate.h" +#include "cmd-eat.h" +#include "cmd-item.h" +#include "cmd-magiceat.h" +#include "cmd-quaff.h" +#include "cmd-read.h" +#include "cmd-usestaff.h" +#include "cmd-zaprod.h" +#include "cmd-zapwand.h" +#include "cmd-pet.h" + +static bool load = TRUE; /*!<ãã¼ãå¦çä¸ã®åå²ãã©ã°*/ +static int wild_regen = 20; /*!<åºåããã移åæã®èªç¶å復å¦çã«ã¦ã³ã¿ï¼åºåããã1ãã¹æ¯ã«20åå¦çãåºæ¬ã¨ããï¼*/ + +/*! + * @brief é度æ¬ä¼¼éå®ã®å¤æå¦ç / Return a "feeling" (or NULL) about an item. Method 1 (Heavy). + * @param o_ptr æ¬ä¼¼éå®ãè¡ããªãã¸ã§ã¯ãã®åç §ãã¤ã³ã¿ã + * @return æ¬ä¼¼éå®çµæã®IDãè¿ãã */ -static byte value_check_aux1(object_type *o_ptr) +byte value_check_aux1(object_type *o_ptr) { /* Artifacts */ if (object_is_artifact(o_ptr)) @@ -61,11 +70,12 @@ static byte value_check_aux1(object_type *o_ptr) return FEEL_AVERAGE; } - -/* - * Return a "feeling" (or NULL) about an item. Method 2 (Light). +/*! + * @brief 軽度æ¬ä¼¼éå®ã®å¤æå¦ç / Return a "feeling" (or NULL) about an item. Method 2 (Light). + * @param o_ptr æ¬ä¼¼éå®ãè¡ããªãã¸ã§ã¯ãã®åç §ãã¤ã³ã¿ã + * @return æ¬ä¼¼éå®çµæã®IDãè¿ãã */ -static byte value_check_aux2(object_type *o_ptr) +byte value_check_aux2(object_type *o_ptr) { /* Cursed items (all of them) */ if (object_is_cursed(o_ptr)) return FEEL_CURSED; @@ -90,7 +100,12 @@ static byte value_check_aux2(object_type *o_ptr) } - +/*! + * @brief æ¬ä¼¼éå®ãå®éã«è¡ãå¤å®ãåæ ãã + * @param slot æ¬ä¼¼éå®ãè¡ããã¬ã¤ã¤ã¼ã®ææãªã¹ãID + * @param heavy é度ã®æ¬ä¼¼éå®ãè¡ããªãã°TRUE + * @return ãªã + */ static void sense_inventory_aux(int slot, bool heavy) { byte feel; @@ -168,7 +183,7 @@ static void sense_inventory_aux(int slot, bool heavy) if (slot >= INVEN_RARM) { #ifdef JP -msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...", +msg_format("%s%s(%c)ã¯%sã¨ããæãããã...", describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]); #else msg_format("You feel the %s (%c) you are %s %s %s...", @@ -183,7 +198,7 @@ describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]); else { #ifdef JP -msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...", +msg_format("ã¶ãã¯ã®ä¸ã®%s(%c)ã¯%sã¨ããæãããã...", o_name, index_to_label(slot),game_inscriptions[feel]); #else msg_format("You feel the %s (%c) in your pack %s %s...", @@ -212,15 +227,18 @@ o_name, index_to_label(slot),game_inscriptions[feel]); -/* - * Sense the inventory - * - * Class 0 = Warrior --> fast and heavy - * Class 1 = Mage --> slow and light - * Class 2 = Priest --> fast but light - * Class 3 = Rogue --> okay and heavy - * Class 4 = Ranger --> slow but heavy (changed!) - * Class 5 = Paladin --> slow but heavy +/*! + * @brief 1ãã¬ã¤ã¤ã¼ã¿ã¼ã³æ¯ã«æ¦å¨ãé²å ·ã®æ¬ä¼¼éå®ãè¡ãããããå¤å®ããã + * @return ãªã + * @details + * Sense the inventory\n + *\n + * Class 0 = Warrior --> fast and heavy\n + * Class 1 = Mage --> slow and light\n + * Class 2 = Priest --> fast but light\n + * Class 3 = Rogue --> okay and heavy\n + * Class 4 = Ranger --> slow but heavy (changed!)\n + * Class 5 = Paladin --> slow but heavy\n */ static void sense_inventory1(void) { @@ -456,7 +474,10 @@ static void sense_inventory1(void) } } - +/*! + * @brief 1ãã¬ã¤ã¤ã¼ã¿ã¼ã³æ¯ã«æ¦å¨ãé²å ·ä»¥å¤ã®æ¬ä¼¼éå®ãè¡ãããããå¤å®ããã + * @return ãªã + */ static void sense_inventory2(void) { int i; @@ -580,23 +601,17 @@ static void sense_inventory2(void) } } - - -/* - * Go to any level (ripped off from wiz_jump) +/*! + * @brief ãã¿ã¼ã³çµç¹å°éæã®ãã¬ãã¼ãå¦çãè¡ã + * @return ãªã */ static void pattern_teleport(void) { - int min_level = 0; - int max_level = 99; + DEPTH min_level = 0; + DEPTH max_level = 99; /* Ask for level */ -#ifdef JP - if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©")) -#else - if (get_check("Teleport level? ")) -#endif - + if (get_check(_("ä»ã®éã«ãã¬ãã¼ããã¾ããï¼", "Teleport level? "))) { char ppp[80]; char tmp_val[160]; @@ -620,27 +635,18 @@ static void pattern_teleport(void) } /* Prompt */ -#ifdef JP - sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level); -#else - sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level); -#endif - + sprintf(ppp, _("ãã¬ãã¼ãå :(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level); /* Default */ - sprintf(tmp_val, "%d", dun_level); + sprintf(tmp_val, "%d", (int)dun_level); /* Ask for a level */ if (!get_string(ppp, tmp_val, 10)) return; /* Extract request */ - command_arg = atoi(tmp_val); + command_arg = (COMMAND_ARG)atoi(tmp_val); } -#ifdef JP - else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©")) -#else - else if (get_check("Normal teleport? ")) -#endif + else if (get_check(_("é常ãã¬ãã¼ãï¼", "Normal teleport? "))) { teleport_player(200, 0L); return; @@ -651,18 +657,13 @@ static void pattern_teleport(void) } /* Paranoia */ - if (command_arg < min_level) command_arg = min_level; + if (command_arg < min_level) command_arg = (COMMAND_ARG)min_level; /* Paranoia */ - if (command_arg > max_level) command_arg = max_level; + if (command_arg > max_level) command_arg = (COMMAND_ARG)max_level; /* Accept request */ -#ifdef JP - msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg); -#else - msg_format("You teleport to dungeon level %d.", command_arg); -#endif - + msg_format(_("%d éã«ãã¬ãã¼ããã¾ããã", "You teleport to dungeon level %d."), command_arg); if (autosave_l) do_cmd_save_game(TRUE); @@ -674,7 +675,7 @@ static void pattern_teleport(void) if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL); p_ptr->inside_quest = 0; - energy_use = 0; + p_ptr->energy_use = 0; /* * Clear all saved floors @@ -686,11 +687,15 @@ static void pattern_teleport(void) p_ptr->leaving = TRUE; } - +/*! + * @brief 種æã¢ã³ãã©ã¤ããåºè¡æãã¿ã¼ã³ã®ä¸ã«ä¹ã£ãéã®ããã«ãã£å¦ç + * @return ãªã + */ static void wreck_the_pattern(void) { - int to_ruin = 0, r_y, r_x; - int pattern_type = f_info[cave[py][px].feat].subtype; + int to_ruin = 0; + POSITION r_y, r_x; + int pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype; if (pattern_type == PATTERN_TILE_WRECKED) { @@ -698,26 +703,17 @@ static void wreck_the_pattern(void) return; } -#ifdef JP - msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª"); - msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª"); -#else - msg_print("You bleed on the Pattern!"); - msg_print("Something terrible happens!"); -#endif + msg_print(_("ãã¿ã¼ã³ãè¡ã§æ±ãã¦ãã¾ã£ãï¼", "You bleed on the Pattern!")); + msg_print(_("ä½ãæãããäºãèµ·ãã£ãï¼", "Something terrible happens!")); if (!IS_INVULN()) -#ifdef JP - take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "¥Ñ¥¿¡¼¥ó»²õ", -1); -#else - take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "corrupting the Pattern", -1); -#endif + take_hit(DAMAGE_NOESCAPE, damroll(10, 8), _("ãã¿ã¼ã³æå£", "corrupting the Pattern"), -1); to_ruin = randint1(45) + 35; while (to_ruin--) { - scatter(&r_y, &r_x, py, px, 4, 0); + scatter(&r_y, &r_x, p_ptr->y, p_ptr->x, 4, 0); if (pattern_tile(r_y, r_x) && (f_info[cave[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED)) @@ -726,16 +722,18 @@ static void wreck_the_pattern(void) } } - cave_set_feat(py, px, feat_pattern_corrupted); + cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_corrupted); } - -/* Returns TRUE if we are on the Pattern... */ +/*! + * @brief å種ãã¿ã¼ã³å°å½¢ä¸ã®ç¹å¥ãªå¦ç / Returns TRUE if we are on the Pattern... + * @return å®éã«ãã¿ã¼ã³å°å½¢ä¸ã«ãã¬ã¤ã¤ã¼ãå± ãå ´åã¯TRUEãè¿ãã + */ static bool pattern_effect(void) { int pattern_type; - if (!pattern_tile(py, px)) return FALSE; + if (!pattern_tile(p_ptr->y, p_ptr->x)) return FALSE; if ((prace_is_(RACE_AMBERITE)) && (p_ptr->cut > 0) && one_in_(10)) @@ -743,33 +741,18 @@ static bool pattern_effect(void) wreck_the_pattern(); } - pattern_type = f_info[cave[py][px].feat].subtype; + pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype; switch (pattern_type) { case PATTERN_TILE_END: - (void)set_poisoned(0); (void)set_image(0); - (void)set_stun(0); - (void)set_cut(0); - (void)set_blind(0); - (void)set_afraid(0); - (void)do_res_stat(A_STR); - (void)do_res_stat(A_INT); - (void)do_res_stat(A_WIS); - (void)do_res_stat(A_DEX); - (void)do_res_stat(A_CON); - (void)do_res_stat(A_CHR); + (void)restore_all_status(); (void)restore_level(); - (void)hp_player(1000); - - cave_set_feat(py, px, feat_pattern_old); + (void)cure_critical_wounds(1000); -#ifdef JP - msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£"); -#else - msg_print("This section of the Pattern looks less powerful."); -#endif + cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_old); + msg_print(_("ããã¿ã¼ã³ãã®ãã®é¨åã¯ä»ã®é¨åããå¼·åã§ãªãããã ã", "This section of the Pattern looks less powerful.")); /* * We could make the healing effect of the @@ -789,22 +772,14 @@ static bool pattern_effect(void) case PATTERN_TILE_WRECKED: if (!IS_INVULN()) -#ifdef JP - take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1); -#else - take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1); -#endif + take_hit(DAMAGE_NOESCAPE, 200, _("å£ããããã¿ã¼ã³ããæ©ãããã¡ã¼ã¸", "walking the corrupted Pattern"), -1); break; default: if (prace_is_(RACE_AMBERITE) && !one_in_(2)) return TRUE; else if (!IS_INVULN()) -#ifdef JP - take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1); -#else - take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "walking the Pattern", -1); -#endif + take_hit(DAMAGE_NOESCAPE, damroll(1, 3), _("ããã¿ã¼ã³ããæ©ãããã¡ã¼ã¸", "walking the Pattern"), -1); break; } @@ -812,11 +787,10 @@ static bool pattern_effect(void) } - - - -/* - * Regenerate hit points -RAK- +/*! + * @brief ãã¬ã¤ã¤ã¼ã®HPèªç¶å復å¦ç / Regenerate hit points -RAK- + * @param percent å復æ¯ç + * @return ãªã */ static void regenhp(int percent) { @@ -866,12 +840,16 @@ static void regenhp(int percent) } -/* - * Regenerate mana points +/*! + * @brief ãã¬ã¤ã¤ã¼ã®MPèªç¶å復å¦ç(regen_magic()ã®ãµãã»ãã) / Regenerate mana points + * @param upkeep_factor ãããç¶æã«ããMPã³ã¹ãé + * @param regen_amount å復é + * @return ãªã */ -static void regenmana(int percent) +static void regenmana(int upkeep_factor, int regen_amount) { s32b old_csp = p_ptr->csp; + s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL; /* * Excess mana will decay 32 times faster than normal @@ -898,11 +876,11 @@ static void regenmana(int percent) } /* Regenerating mana (unless the player has excess mana) */ - else if (percent > 0) + else if (regen_rate > 0) { /* (percent/100) is the Regen factor in unit (1/2^16) */ s32b new_mana = 0; - u32b new_mana_frac = (p_ptr->msp * percent / 100 + PY_REGEN_MNBASE); + u32b new_mana_frac = (p_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE); /* Convert the unit (1/2^16) to (1/2^32) */ s64b_LSHIFT(new_mana, new_mana_frac, 16); @@ -920,11 +898,11 @@ static void regenmana(int percent) /* Reduce mana (even when the player has excess mana) */ - if (percent < 0) + if (regen_rate < 0) { /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */ s32b reduce_mana = 0; - u32b reduce_mana_frac = (p_ptr->msp * PY_REGEN_NORMAL + PY_REGEN_MNBASE); + u32b reduce_mana_frac = (p_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE); /* Convert the unit (1/2^16) to (1/2^32) */ s64b_LSHIFT(reduce_mana, reduce_mana_frac, 16); @@ -955,21 +933,25 @@ static void regenmana(int percent) } } - - -/* - * Regenerate magic +/*! + * @brief ãã¬ã¤ã¤ã¼ã®MPèªç¶å復å¦ç / Regenerate magic regen_amount: PY_REGEN_NORMAL * 2 (if resting) * 2 (if having regenarate) + * @param regen_amount å復é + * @return ãªã */ -static void regenmagic(int percent) +static void regenmagic(int regen_amount) { - s32b new_mana; + s32b new_mana; int i; + int dev = 30; + int mult = (dev + adj_mag_mana[p_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */ for (i = 0; i < EATER_EXT*2; i++) { if (!p_ptr->magic_num2[i]) continue; if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue; - new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8; + + /* Increase remaining charge number like float value */ + new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 13)) / (dev * 8); p_ptr->magic_num1[i] += new_mana; /* Check maximum charge */ @@ -983,21 +965,23 @@ static void regenmagic(int percent) { if (!p_ptr->magic_num1[i]) continue; if (!p_ptr->magic_num2[i]) continue; - p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * EATER_ROD_CHARGE/16; + + /* Decrease remaining period for charging */ + new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE) + / (dev * 16 * PY_REGEN_NORMAL); + p_ptr->magic_num1[i] -= new_mana; + + /* Check minimum remaining period for charging */ if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0; wild_regen = 20; } } - - - - -/* - * Regenerate the monsters (once per 100 game turns) - * - * XXX XXX XXX Should probably be done during monster turns. +/*! + * @brief 100ã²ã¼ã ã¿ã¼ã³æ¯ã®ã¢ã³ã¹ã¿ã¼ã®HPèªç¶å復å¦ç / Regenerate the monsters (once per 100 game turns) + * @return ãªã + * @note XXX XXX XXX Should probably be done during monster turns. */ static void regen_monsters(void) { @@ -1041,10 +1025,10 @@ static void regen_monsters(void) } -/* - * Regenerate the captured monsters (once per 30 game turns) - * - * XXX XXX XXX Should probably be done during monster turns. +/*! + * @brief 30ã²ã¼ã ã¿ã¼ã³æ¯ã®ãã¼ã«ä¸ã¢ã³ã¹ã¿ã¼ã®HPèªç¶å復å¦ç / Regenerate the captured monsters (once per 30 game turns) + * @return ãªã + * @note XXX XXX XXX Should probably be done during monster turns. */ static void regen_captured_monsters(void) { @@ -1078,7 +1062,7 @@ static void regen_captured_monsters(void) if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2; /* Hack -- Regenerate */ - o_ptr->xtra4 += frac; + o_ptr->xtra4 += (XTRA16)frac; /* Do not over-regenerate */ if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5; @@ -1097,7 +1081,11 @@ static void regen_captured_monsters(void) } } - +/*! + * @brief 寿å½ã¤ãå æºã®è¦åã¡ãã»ã¼ã¸å¦ç + * @param o_ptr ç¾å¨å æºã¨ãã¦ä½¿ã£ã¦ãããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return ãªã + */ static void notice_lite_change(object_type *o_ptr) { /* Hack -- notice interesting fuel steps */ @@ -1117,12 +1105,8 @@ static void notice_lite_change(object_type *o_ptr) /* The light is now out */ else if (o_ptr->xtra4 == 0) { - disturb(0, 0); -#ifdef JP -msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª"); -#else - msg_print("Your light has gone out!"); -#endif + disturb(0, 1); + msg_print(_("æãããæ¶ãã¦ãã¾ã£ãï¼", "Your light has gone out!")); /* Recalculate torch radius */ p_ptr->update |= (PU_TORCH); @@ -1137,73 +1121,76 @@ msg_print(" if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5)) && (turn % (TURNS_PER_TICK*2))) { - if (disturb_minor) disturb(0, 0); -#ifdef JP -msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£"); -#else - msg_print("Your light is growing faint."); -#endif - + if (disturb_minor) disturb(0, 1); + msg_print(_("æãããå¾®ãã«ãªã£ã¦ãã¦ããã", "Your light is growing faint.")); } } /* The light is getting dim */ else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10))) { - if (disturb_minor) disturb(0, 0); -#ifdef JP -msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£"); -#else - msg_print("Your light is growing faint."); -#endif - + if (disturb_minor) disturb(0, 1); + msg_print(_("æãããå¾®ãã«ãªã£ã¦ãã¦ããã", "Your light is growing faint.")); } } - +/*! + * @brief ã¯ã¨ã¹ãé層ããé¢è±ããéã®å¦ç + * @return ãªã + */ void leave_quest_check(void) { /* Save quest number for dungeon pref file ($LEAVING_QUEST) */ leaving_quest = p_ptr->inside_quest; /* Leaving an 'only once' quest marks it as failed */ - if (leaving_quest && - ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) && - (quest[leaving_quest].status == QUEST_STATUS_TAKEN)) - { - quest[leaving_quest].status = QUEST_STATUS_FAILED; - quest[leaving_quest].complev = (byte)p_ptr->lev; - - /* Additional settings */ - switch (quest[leaving_quest].type) + if (leaving_quest) + { + quest_type* const q_ptr = &quest[leaving_quest]; + + if(((q_ptr->flags & QUEST_FLAG_ONCE) || (q_ptr->type == QUEST_TYPE_RANDOM)) && + (q_ptr->status == QUEST_STATUS_TAKEN)) { - case QUEST_TYPE_TOWER: - quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED; - quest[QUEST_TOWER1].complev = (byte)p_ptr->lev; - break; - case QUEST_TYPE_FIND_ARTIFACT: - a_info[quest[leaving_quest].k_idx].gen_flags &= ~(TRG_QUESTITEM); - break; - case QUEST_TYPE_RANDOM: - r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR); + q_ptr->status = QUEST_STATUS_FAILED; + q_ptr->complev = (byte)p_ptr->lev; + update_playtime(); + q_ptr->comptime = playtime; - /* Floor of random quest will be blocked */ - prepare_change_floor_mode(CFM_NO_RETURN); - break; - } + /* Additional settings */ + switch (q_ptr->type) + { + case QUEST_TYPE_TOWER: + quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED; + quest[QUEST_TOWER1].complev = (byte)p_ptr->lev; + break; + case QUEST_TYPE_FIND_ARTIFACT: + a_info[q_ptr->k_idx].gen_flags &= ~(TRG_QUESTITEM); + break; + case QUEST_TYPE_RANDOM: + r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR); - /* Record finishing a quest */ - if (quest[leaving_quest].type == QUEST_TYPE_RANDOM) - { - if (record_rand_quest) do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL); - } - else - { - if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL); + /* Floor of random quest will be blocked */ + prepare_change_floor_mode(CFM_NO_RETURN); + break; + } + + /* Record finishing a quest */ + if (q_ptr->type == QUEST_TYPE_RANDOM) + { + if (record_rand_quest) do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL); + } + else + { + if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL); + } } } } +/*! + * @brief ãå¡ãã¯ã¨ã¹ãã®åé層ããé¢è±ããéã®å¦ç + * @return ãªã + */ void leave_tower_check(void) { leaving_quest = p_ptr->inside_quest; @@ -1216,151 +1203,17 @@ void leave_tower_check(void) { quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED; quest[QUEST_TOWER1].complev = (byte)p_ptr->lev; + update_playtime(); + quest[QUEST_TOWER1].comptime = playtime; } } } -/* - * Forcibly pseudo-identify an object in the inventory - * (or on the floor) - * - * note: currently this function allows pseudo-id of any object, - * including silly ones like potions & scrolls, which always - * get '{average}'. This should be changed, either to stop such - * items from being pseudo-id'd, or to allow psychometry to - * detect whether the unidentified potion/scroll/etc is - * good (Cure Light Wounds, Restore Strength, etc) or - * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc). - */ -bool psychometry(void) -{ - int item; - object_type *o_ptr; - char o_name[MAX_NLEN]; - byte feel; - cptr q, s; - bool okay = FALSE; - - item_tester_no_ryoute = TRUE; - /* Get an item */ -#ifdef JP -q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©"; -s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£"; -#else - q = "Meditate on which item? "; - s = "You have nothing appropriate."; -#endif - - if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE); - - /* Get the item (in the pack) */ - if (item >= 0) - { - o_ptr = &inventory[item]; - } - - /* Get the item (on the floor) */ - else - { - o_ptr = &o_list[0 - item]; - } - - /* It is fully known, no information needed */ - if (object_is_known(o_ptr)) - { -#ifdef JP -msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£"); -#else - msg_print("You cannot find out anything more about that."); -#endif - - return TRUE; - } - - /* Check for a feeling */ - feel = value_check_aux1(o_ptr); - - /* Get an object description */ - object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); - - /* Skip non-feelings */ - if (!feel) - { -#ifdef JP -msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name); -#else - msg_format("You do not perceive anything unusual about the %s.", o_name); -#endif - - return TRUE; - } - -#ifdef JP -msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...", - o_name, game_inscriptions[feel]); -#else - msg_format("You feel that the %s %s %s...", - o_name, ((o_ptr->number == 1) ? "is" : "are"), - game_inscriptions[feel]); -#endif - - - /* We have "felt" it */ - o_ptr->ident |= (IDENT_SENSE); - - /* "Inscribe" it */ - o_ptr->feeling = feel; - - /* Player touches it */ - o_ptr->marked |= OM_TOUCHED; - - /* Combine / Reorder the pack (later) */ - p_ptr->notice |= (PN_COMBINE | PN_REORDER); - - /* Window stuff */ - p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER); - - /* Valid "tval" codes */ - switch (o_ptr->tval) - { - case TV_SHOT: - case TV_ARROW: - case TV_BOLT: - case TV_BOW: - case TV_DIGGING: - case TV_HAFTED: - case TV_POLEARM: - case TV_SWORD: - case TV_BOOTS: - case TV_GLOVES: - case TV_HELM: - case TV_CROWN: - case TV_SHIELD: - case TV_CLOAK: - case TV_SOFT_ARMOR: - case TV_HARD_ARMOR: - case TV_DRAG_ARMOR: - case TV_CARD: - case TV_RING: - case TV_AMULET: - case TV_LITE: - case TV_FIGURINE: - okay = TRUE; - break; - } - - /* Auto-inscription/destroy */ - autopick_alter_item(item, (bool)(okay && destroy_feeling)); - - /* Something happened */ - return (TRUE); -} - - -/* - * If player has inscribed the object with "!!", let him know when it's - * recharged. -LM- +/*! + * @brief !!ãå»ãã ééå ·ã®æéçµéã«ããåå å¡«ãç¥ãããå¦ç / If player has inscribed the object with "!!", let him know when it's recharged. -LM- + * @param o_ptr 対象ãªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return ãªã */ static void recharged_notice(object_type *o_ptr) { @@ -1385,7 +1238,7 @@ static void recharged_notice(object_type *o_ptr) /* Notify the player */ #ifdef JP - msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name); + msg_format("%sã¯åå å¡«ãããã", o_name); #else if (o_ptr->number > 1) msg_format("Your %s are recharged.", o_name); @@ -1404,17 +1257,20 @@ static void recharged_notice(object_type *o_ptr) } } - +/*! + * @brief ãã¬ã¤ã¤ã¼ã®æã«é¢ããç¶ç¶å¦ç + * @return ãªã + */ static void check_music(void) { - magic_type *s_ptr; + const magic_type *s_ptr; int spell; s32b need_mana; u32b need_mana_frac; /* Music singed by player */ if (p_ptr->pclass != CLASS_BARD) return; - if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return; + if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return; if (p_ptr->anti_magic) { @@ -1422,7 +1278,7 @@ static void check_music(void) return; } - spell = p_ptr->magic_num2[0]; + spell = SINGING_SONG_ID(p_ptr); s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell]; need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC); @@ -1441,15 +1297,11 @@ static void check_music(void) s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), need_mana, need_mana_frac); p_ptr->redraw |= PR_MANA; - if (p_ptr->magic_num1[1]) + if (INTERUPTING_SONG_EFFECT(p_ptr)) { - p_ptr->magic_num1[0] = p_ptr->magic_num1[1]; - p_ptr->magic_num1[1] = 0; -#ifdef JP - msg_print("²Î¤òºÆ³«¤·¤¿¡£"); -#else - msg_print("You restart singing."); -#endif + SINGING_SONG_EFFECT(p_ptr) = INTERUPTING_SONG_EFFECT(p_ptr); + INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE; + msg_print(_("æãåéããã", "You restart singing.")); p_ptr->action = ACTION_SING; /* Recalculate bonuses */ @@ -1478,8 +1330,12 @@ static void check_music(void) do_spell(REALM_MUSIC, spell, SPELL_CONT); } - -/* Choose one of items that have cursed flag */ +/*! + * @brief ç¾å¨åªããä¿æãã¦ããè£ ååãä¸ã¤ã©ã³ãã ã«æ¢ãåºã / Choose one of items that have cursed flag + * @param flag æ¢ãåºãããåªããã©ã°é å + * @return 該å½ã®åªããä¸ã¤ã§ããã£ãå ´åã«ã©ã³ãã ã«é¸ã°ããè£ ååã®ãªãã¸ã§ã¯ãæ§é ä½åç §ãã¤ã³ã¿ãè¿ãã\n + * åªãããªãå ´åNULLãè¿ãã + */ static object_type *choose_cursed_obj_name(u32b flag) { int i; @@ -1499,22 +1355,64 @@ static object_type *choose_cursed_obj_name(u32b flag) choices[number] = i; number++; } + else if ((flag == TRC_ADD_L_CURSE) || + (flag == TRC_ADD_H_CURSE) || + (flag == TRC_DRAIN_HP) || + (flag == TRC_DRAIN_MANA) || + (flag == TRC_CALL_ANIMAL) || + (flag == TRC_CALL_DEMON) || + (flag == TRC_CALL_DRAGON) || + (flag == TRC_CALL_UNDEAD) || + (flag == TRC_COWARDICE) || + (flag == TRC_LOW_MELEE) || + (flag == TRC_LOW_AC) || + (flag == TRC_LOW_MAGIC) || + (flag == TRC_FAST_DIGEST) || + (flag == TRC_SLOW_REGEN) ) + { + u32b cf; + u32b flgs[TR_FLAG_SIZE]; + object_flags(o_ptr, flgs); + switch (flag) + { + case TRC_ADD_L_CURSE : cf = TR_ADD_L_CURSE; break; + case TRC_ADD_H_CURSE : cf = TR_ADD_H_CURSE; break; + case TRC_DRAIN_HP : cf = TR_DRAIN_HP; break; + case TRC_DRAIN_MANA : cf = TR_DRAIN_MANA; break; + case TRC_CALL_ANIMAL : cf = TR_CALL_ANIMAL; break; + case TRC_CALL_DEMON : cf = TR_CALL_DEMON; break; + case TRC_CALL_DRAGON : cf = TR_CALL_DRAGON; break; + case TRC_CALL_UNDEAD : cf = TR_CALL_UNDEAD; break; + case TRC_COWARDICE : cf = TR_COWARDICE; break; + case TRC_LOW_MELEE : cf = TR_LOW_MELEE; break; + case TRC_LOW_AC : cf = TR_LOW_AC; break; + case TRC_LOW_MAGIC : cf = TR_LOW_MAGIC; break; + case TRC_FAST_DIGEST : cf = TR_FAST_DIGEST; break; + case TRC_SLOW_REGEN : cf = TR_SLOW_REGEN; break; + default : break; + } + if (have_flag(flgs, cf)) + { + choices[number] = i; + number++; + } + } } /* Choice one of them */ return (&inventory[choices[randint0(number)]]); } - -/* - * Handle timed damage and regeneration every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«ãã¬ã¤ã¤ã¼ã®HPã¨MPã®å¢æ¸å¦çãè¡ãã + * / Handle timed damage and regeneration every 10 game turns + * @return ãªã */ static void process_world_aux_hp_and_sp(void) { - feature_type *f_ptr = &f_info[cave[py][px].feat]; + feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat]; bool cave_no_regen = FALSE; int upkeep_factor = 0; - int upkeep_regen; /* Default regeneration */ int regen_amount = PY_REGEN_NORMAL; @@ -1526,18 +1424,13 @@ static void process_world_aux_hp_and_sp(void) if (p_ptr->poisoned && !IS_INVULN()) { /* Take damage */ -#ifdef JP - take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1); -#else - take_hit(DAMAGE_NOESCAPE, 1, "poison", -1); -#endif - + take_hit(DAMAGE_NOESCAPE, 1, _("æ¯", "poison"), -1); } /* Take damage from cuts */ if (p_ptr->cut && !IS_INVULN()) { - int dam; + HIT_POINT dam; /* Mortal wound or Deep Gash */ if (p_ptr->cut > 1000) @@ -1578,12 +1471,7 @@ static void process_world_aux_hp_and_sp(void) } /* Take damage */ -#ifdef JP - take_hit(DAMAGE_NOESCAPE, dam, "Ã×Ì¿½ý", -1); -#else - take_hit(DAMAGE_NOESCAPE, dam, "a fatal wound", -1); -#endif - + take_hit(DAMAGE_NOESCAPE, dam, _("è´å½å·", "a fatal wound"), -1); } @@ -1592,16 +1480,11 @@ static void process_world_aux_hp_and_sp(void) { if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime()) { - if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) + if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { /* Take damage */ -#ifdef JP -msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª"); -take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1); -#else - msg_print("The sun's rays scorch your undead flesh!"); - take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1); -#endif + msg_print(_("æ¥å ãããªãã®ã¢ã³ãããã®èä½ãç¼ãç¦ãããï¼", "The sun's rays scorch your undead flesh!")); + take_hit(DAMAGE_NOESCAPE, 1, _("æ¥å ", "sunlight"), -1); cave_no_regen = TRUE; } @@ -1616,24 +1499,13 @@ take_hit(DAMAGE_NOESCAPE, 1, " /* Get an object description */ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); - -#ifdef JP -msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name); -#else - msg_format("The %s scorches your undead flesh!", o_name); -#endif - + msg_format(_("%sãããªãã®ã¢ã³ãããã®èä½ãç¼ãç¦ãããï¼", "The %s scorches your undead flesh!"), o_name); cave_no_regen = TRUE; /* Get an object description */ object_desc(o_name, o_ptr, OD_NAME_ONLY); - -#ifdef JP -sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name); -#else - sprintf(ouch, "wielding %s", o_name); -#endif + sprintf(ouch, _("%sãè£ åãããã¡ã¼ã¸", "wielding %s"), o_name); if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1); } @@ -1664,22 +1536,14 @@ sprintf(ouch, "%s if (p_ptr->levitation) { -#ifdef JP - msg_print("Ç®¤Ç²Ð½ý¤·¤¿¡ª"); - take_hit(DAMAGE_NOESCAPE, damage, format("%s¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1); -#else - msg_print("The heat burns you!"); - take_hit(DAMAGE_NOESCAPE, damage, format("flying over %s", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1); -#endif + msg_print(_("ç±ã§ç«å·ããï¼", "The heat burns you!")); + take_hit(DAMAGE_NOESCAPE, damage, format(_("%sã®ä¸ã«æµ®éãããã¡ã¼ã¸", "flying over %s"), + f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name), -1); } else { - cptr name = f_name + f_info[get_feat_mimic(&cave[py][px])].name; -#ifdef JP - msg_format("%s¤Ç²Ð½ý¤·¤¿¡ª", name); -#else - msg_format("The %s burns you!", name); -#endif + cptr name = f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name; + msg_format(_("%sã§ç«å·ããï¼", "The %s burns you!"), name); take_hit(DAMAGE_NOESCAPE, damage, name, -1); } @@ -1693,14 +1557,8 @@ sprintf(ouch, "%s if (p_ptr->total_weight > weight_limit()) { /* Take damage */ -#ifdef JP - msg_print("Å®¤ì¤Æ¤¤¤ë¡ª"); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1); -#else - msg_print("You are drowning!"); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1); -#endif - + msg_print(_("溺ãã¦ããï¼", "You are drowning!")); + take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺ã", "drowning"), -1); cave_no_regen = TRUE; } } @@ -1714,13 +1572,8 @@ sprintf(ouch, "%s if (prace_is_(RACE_ENT)) damage += damage / 3; if (p_ptr->resist_fire) damage = damage / 3; if (IS_OPPOSE_FIRE()) damage = damage / 3; -#ifdef JP -msg_print("Ç®¤¤¡ª"); -take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1); -#else - msg_print("It's hot!"); - take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1); -#endif + msg_print(_("ç±ãï¼", "It's hot!")); + take_hit(DAMAGE_NOESCAPE, damage, _("çã®ãªã¼ã©", "Fire aura"), -1); } if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec) { @@ -1728,26 +1581,16 @@ take_hit(DAMAGE_NOESCAPE, damage, " if (prace_is_(RACE_ANDROID)) damage += damage / 3; if (p_ptr->resist_elec) damage = damage / 3; if (IS_OPPOSE_ELEC()) damage = damage / 3; -#ifdef JP -msg_print("Äˤ¤¡ª"); -take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1); -#else - msg_print("It hurts!"); - take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1); -#endif + msg_print(_("çãï¼", "It hurts!")); + take_hit(DAMAGE_NOESCAPE, damage, _("é»æ°ã®ãªã¼ã©", "Elec aura"), -1); } if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold) { damage = r_info[m_list[p_ptr->riding].r_idx].level / 2; if (p_ptr->resist_cold) damage = damage / 3; if (IS_OPPOSE_COLD()) damage = damage / 3; -#ifdef JP -msg_print("Î䤿¤¤¡ª"); -take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1); -#else - msg_print("It's cold!"); - take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1); -#endif + msg_print(_("å·ããï¼", "It's cold!")); + take_hit(DAMAGE_NOESCAPE, damage, _("å·æ°ã®ãªã¼ã©", "Cold aura"), -1); } } @@ -1769,23 +1612,13 @@ take_hit(DAMAGE_NOESCAPE, damage, " if (p_ptr->pass_wall) { -#ifdef JP - msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª"); - dam_desc = "Ì©ÅÙ"; -#else - msg_print("Your molecules feel disrupted!"); - dam_desc = "density"; -#endif + msg_print(_("ä½ã®ååãå解ããæ°ãããï¼", "Your molecules feel disrupted!")); + dam_desc = _("å¯åº¦", "density"); } else { -#ifdef JP - msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª"); - dam_desc = "¹Å¤¤´ä"; -#else - msg_print("You are being crushed!"); - dam_desc = "solid rock"; -#endif + msg_print(_("å´©ãã岩ã«æ¼ãæ½°ãããï¼", "You are being crushed!")); + dam_desc = _("硬ã岩", "solid rock"); } take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1); @@ -1853,8 +1686,7 @@ take_hit(DAMAGE_NOESCAPE, damage, " } /* Regenerate the mana */ - upkeep_regen = (100 - upkeep_factor) * regen_amount; - regenmana(upkeep_regen); + regenmana(upkeep_factor, regen_amount); /* Recharge magic eater's power */ @@ -1867,21 +1699,13 @@ take_hit(DAMAGE_NOESCAPE, damage, " { while (upkeep_factor > 100) { -#ifdef JP - msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª"); -#else - msg_print("Too many pets to control at once!"); -#endif + msg_print(_("ãããªã«å¤ãã®ããããå¶å¾¡ã§ããªãï¼", "Too many pets to control at once!")); msg_print(NULL); do_cmd_pet_dismiss(); upkeep_factor = calculate_upkeep(); -#ifdef JP - msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor); -#else - msg_format("Upkeep: %d%% mana.", upkeep_factor); -#endif + msg_format(_("ç¶æï¼ï¼°ã¯ %d%%", "Upkeep: %d%% mana."), upkeep_factor); msg_print(NULL); } } @@ -1902,9 +1726,10 @@ take_hit(DAMAGE_NOESCAPE, damage, " } } - -/* - * Handle timeout every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«éæ³å¹æã®æ®ãã¿ã¼ã³ãæ¸ããã¦ããå¦ç + * / Handle timeout every 10 game turns + * @return ãªã */ static void process_world_aux_timeout(void) { @@ -2214,8 +2039,10 @@ static void process_world_aux_timeout(void) } -/* - * Handle burning fuel every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ããæ¯ã«å æºã®å¯¿å½ãæ¸ããå¦ç + * / Handle burning fuel every 10 game turns + * @return ãªã */ static void process_world_aux_light(void) { @@ -2242,8 +2069,10 @@ static void process_world_aux_light(void) } -/* - * Handle mutation effects once every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«çªç¶å¤ç°ã®çºåå¤å®ãè¡ãå¦ç + * / Handle mutation effects once every 10 game turns + * @return ãªã */ static void process_world_aux_mutation(void) { @@ -2259,14 +2088,9 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000)) { - disturb(0, 0); -#ifdef JP - msg_print("¥¦¥¬¥¡¥¡¥¢¡ª"); - msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª"); -#else - msg_print("RAAAAGHH!"); - msg_print("You feel a fit of rage coming over you!"); -#endif + disturb(0, 1); + msg_print(_("ã¦ã¬ã¡ã¡ã¢ï¼", "RAAAAGHH!")); + msg_print(_("æ¿æã®çºä½ã«è¥²ãããï¼", "You feel a fit of rage coming over you!")); (void)set_shero(10 + randint1(p_ptr->lev), FALSE); (void)set_afraid(0); @@ -2276,13 +2100,8 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_fear) { - disturb(0, 0); -#ifdef JP - msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª"); -#else - msg_print("It's so dark... so scary!"); -#endif - + disturb(0, 1); + msg_print(_("ã¨ã¦ãæã... ã¨ã¦ãæãï¼", "It's so dark... so scary!")); set_afraid(p_ptr->afraid + 13 + randint1(26)); } } @@ -2292,15 +2111,10 @@ static void process_world_aux_mutation(void) if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele) { - disturb(0, 0); + disturb(0, 1); /* Teleport player */ -#ifdef JP - msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿..."); -#else - msg_print("Your position suddenly seems very uncertain..."); -#endif - + msg_print(_("ããªãã®ä½ç½®ã¯çªç¶ã²ãããã«ä¸ç¢ºå®ã«ãªã£ã...", "Your position suddenly seems very uncertain...")); msg_print(NULL); teleport_player(40, TELEPORT_PASSIVE); } @@ -2310,14 +2124,9 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_conf && !p_ptr->resist_chaos) { - disturb(0, 0); + disturb(0, 1); p_ptr->redraw |= PR_EXTRA; -#ifdef JP - msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª"); -#else - msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!"); -#endif - + msg_print(_("ãã²ãããã¼ãã¼ã¨ã²ã¦ãããããµã...ããã¯ï¼", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!")); } if (!p_ptr->resist_conf) @@ -2334,25 +2143,14 @@ static void process_world_aux_mutation(void) else wiz_dark(); (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE); wiz_dark(); -#ifdef JP - msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£"); - msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª"); -#else - msg_print("You wake up somewhere with a sore head..."); - msg_print("You can't remember a thing, or how you got here!"); -#endif - + msg_print(_("ããªãã¯è¦ç¥ãã¬å ´æã§ç®ãéãã...é ãçãã", "You wake up somewhere with a sore head...")); + msg_print(_("ä½ãè¦ãã¦ããªããã©ããã£ã¦ããã«æ¥ãããåãããªãï¼", "You can't remember a thing, or how you got here!")); } else { if (one_in_(3)) { -#ifdef JP - msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á"); -#else - msg_print("Thishcischs GooDSChtuff!"); -#endif - + msg_print(_("ãï½ãããªã¡ããã¡ããã¨ããããï½", "Thishcischs GooDSChtuff!")); (void)set_image(p_ptr->image + randint0(150) + 150); } } @@ -2363,7 +2161,7 @@ static void process_world_aux_mutation(void) { if (!p_ptr->resist_chaos) { - disturb(0, 0); + disturb(0, 1); p_ptr->redraw |= PR_EXTRA; (void)set_image(p_ptr->image + randint0(50) + 20); } @@ -2371,13 +2169,9 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13)) { - disturb(0, 0); + disturb(0, 1); -#ifdef JP - msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£"); -#else - msg_print("BRRAAAP! Oops."); -#endif + msg_print(_("ãã¥ã¼ã¼ãï¼ãã£ã¨ã", "BRRAAAP! Oops.")); msg_print(NULL); fire_ball(GF_POIS, 0, p_ptr->lev, 3); @@ -2387,12 +2181,9 @@ static void process_world_aux_mutation(void) !p_ptr->anti_magic && one_in_(9000)) { int dire = 0; - disturb(0, 0); -#ifdef JP - msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª"); -#else - msg_print("Magical energy flows through you! You must release it!"); -#endif + disturb(0, 1); + msg_print(_("éæ³ã®ã¨ãã«ã®ã¼ãçªç¶ããªãã®ä¸ã«æµãè¾¼ãã§ããï¼ã¨ãã«ã®ã¼ã解æ¾ããªããã°ãªããªãï¼", + "Magical energy flows through you! You must release it!")); flush(); msg_print(NULL); @@ -2404,34 +2195,25 @@ static void process_world_aux_mutation(void) !p_ptr->anti_magic && (randint1(6666) == 666)) { bool pet = one_in_(6); - u32b mode = PM_ALLOW_GROUP; + BIT_FLAGS mode = PM_ALLOW_GROUP; if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), py, px, + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode)) { -#ifdef JP - msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª"); -#else - msg_print("You have attracted a demon!"); -#endif - - disturb(0, 0); + msg_print(_("ããªãã¯ãã¼ã¢ã³ãå¼ãå¯ããï¼", "You have attracted a demon!")); + disturb(0, 1); } } if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000)) { - disturb(0, 0); + disturb(0, 1); if (one_in_(2)) { -#ifdef JP - msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel less energetic."); -#endif + msg_print(_("ç²¾åçã§ãªããªã£ãæ°ãããã", "You feel less energetic.")); if (p_ptr->fast > 0) { @@ -2444,11 +2226,7 @@ static void process_world_aux_mutation(void) } else { -#ifdef JP - msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel more energetic."); -#endif + msg_print(_("ç²¾åçã«ãªã£ãæ°ãããã", "You feel more energetic.")); if (p_ptr->slow > 0) { @@ -2463,12 +2241,8 @@ static void process_world_aux_mutation(void) } if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000)) { - disturb(0, 0); -#ifdef JP - msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£"); -#else - msg_print("You suddenly feel almost lonely."); -#endif + disturb(0, 1); + msg_print(_("çªç¶ã»ã¨ãã©å¤ç¬ã«ãªã£ãæ°ãããã", "You suddenly feel almost lonely.")); banish_monsters(100); if (!dun_level && p_ptr->town_num) @@ -2482,12 +2256,7 @@ static void process_world_aux_mutation(void) } while ((n == STORE_HOME) || (n == STORE_MUSEUM)); -#ifdef JP - msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª"); -#else - msg_print("You see one of the shopkeepers running for the hills!"); -#endif - + msg_print(_("åºã®ä¸»äººãä¸ã«åãã£ã¦èµ°ã£ã¦ããï¼", "You see one of the shopkeepers running for the hills!")); store_shuffle(n); } msg_print(NULL); @@ -2497,16 +2266,11 @@ static void process_world_aux_mutation(void) { object_type *o_ptr; -#ifdef JP - msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£"); -#else - msg_print("A shadow passes over you."); -#endif - + msg_print(_("å½±ã«ã¤ã¤ã¾ããã", "A shadow passes over you.")); msg_print(NULL); /* Absorb light from the current possition */ - if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) + if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { hp_player(10); } @@ -2524,13 +2288,7 @@ static void process_world_aux_mutation(void) /* Decrease life-span of lite */ o_ptr->xtra4 /= 2; - -#ifdef JP - msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("You absorb energy from your light!"); -#endif - + msg_print(_("å æºããã¨ãã«ã®ã¼ãå¸åããï¼", "You absorb energy from your light!")); /* Notice interesting fuel steps */ notice_lite_change(o_ptr); @@ -2548,32 +2306,23 @@ static void process_world_aux_mutation(void) !p_ptr->anti_magic && one_in_(7000)) { bool pet = one_in_(3); - u32b mode = PM_ALLOW_GROUP; + BIT_FLAGS mode = PM_ALLOW_GROUP; if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, mode)) { -#ifdef JP - msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª"); -#else - msg_print("You have attracted an animal!"); -#endif - - disturb(0, 0); + msg_print(_("åç©ãå¼ãå¯ããï¼", "You have attracted an animal!")); + disturb(0, 1); } } if ((p_ptr->muta2 & MUT2_RAW_CHAOS) && !p_ptr->anti_magic && one_in_(8000)) { - disturb(0, 0); -#ifdef JP - msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel the world warping around you!"); -#endif + disturb(0, 1); + msg_print(_("å¨ãã®ç©ºéãæªãã§ããæ°ãããï¼", "You feel the world warping around you!")); msg_print(NULL); fire_ball(GF_CHAOS, 0, p_ptr->lev, 8); @@ -2581,21 +2330,12 @@ static void process_world_aux_mutation(void) if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000)) { if (!lose_mutation(0)) -#ifdef JP - msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel oddly normal."); -#endif - + msg_print(_("å¥å¦ãªãããæ®éã«ãªã£ãæ°ãããã", "You feel oddly normal.")); } if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000)) { - disturb(0, 0); -#ifdef JP - msg_print("Èóʪ¼Á²½¤·¤¿¡ª"); -#else - msg_print("You feel insubstantial!"); -#endif + disturb(0, 1); + msg_print(_("éç©è³ªåããï¼", "You feel insubstantial!")); msg_print(NULL); set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE); @@ -2630,24 +2370,14 @@ static void process_world_aux_mutation(void) if (p_ptr->sustain_chr) sustained = TRUE; break; default: -#ifdef JP - msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª"); -#else - msg_print("Invalid stat chosen!"); -#endif - + msg_print(_("ä¸æ£ãªç¶æ ï¼", "Invalid stat chosen!")); sustained = TRUE; } if (!sustained) { - disturb(0, 0); -#ifdef JP - msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª"); -#else - msg_print("You can feel yourself wasting away!"); -#endif - + disturb(0, 1); + msg_print(_("èªåãè¡°å¼±ãã¦ããã®ãåããï¼", "You can feel yourself wasting away!")); msg_print(NULL); (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3)); } @@ -2656,20 +2386,15 @@ static void process_world_aux_mutation(void) !p_ptr->anti_magic && one_in_(3000)) { bool pet = one_in_(5); - u32b mode = PM_ALLOW_GROUP; + BIT_FLAGS mode = PM_ALLOW_GROUP; if (pet) mode |= PM_FORCE_PET; else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET); - if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode)) + if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, mode)) { -#ifdef JP - msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª"); -#else - msg_print("You have attracted a dragon!"); -#endif - - disturb(0, 0); + msg_print(_("ãã©ã´ã³ãå¼ãå¯ããï¼", "You have attracted a dragon!")); + disturb(0, 1); } } if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic && @@ -2677,35 +2402,20 @@ static void process_world_aux_mutation(void) { if (p_ptr->tim_esp > 0) { -#ifdef JP - msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª"); -#else - msg_print("Your mind feels cloudy!"); -#endif - + msg_print(_("ç²¾ç¥ã«ãããããã£ãï¼", "Your mind feels cloudy!")); set_tim_esp(0, TRUE); } else { -#ifdef JP - msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª"); -#else - msg_print("Your mind expands!"); -#endif - + msg_print(_("ç²¾ç¥ãåºãã£ãï¼", "Your mind expands!")); set_tim_esp(p_ptr->lev, FALSE); } } if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000)) { - disturb(0, 0); -#ifdef JP - msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª"); -#else - msg_print("Your stomach roils, and you lose your lunch!"); -#endif - + disturb(0, 1); + msg_print(_("èãçæ£ããé£äºã失ã£ãï¼", "Your stomach roils, and you lose your lunch!")); msg_print(NULL); set_food(PY_FOOD_WEAK); if (music_singing_any()) stop_singing(); @@ -2738,58 +2448,23 @@ static void process_world_aux_mutation(void) } if (danger_amount > 100) -#ifdef JP - msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel utterly terrified!"); -#endif - + msg_print(_("é常ã«æãããæ°ãããï¼", "You feel utterly terrified!")); else if (danger_amount > 50) -#ifdef JP - msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel terrified!"); -#endif - + msg_print(_("æãããæ°ãããï¼", "You feel terrified!")); else if (danger_amount > 20) -#ifdef JP - msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel very worried!"); -#endif - + msg_print(_("é常ã«å¿é ãªæ°ãããï¼", "You feel very worried!")); else if (danger_amount > 10) -#ifdef JP - msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel paranoid!"); -#endif - + msg_print(_("å¿é ãªæ°ãããï¼", "You feel paranoid!")); else if (danger_amount > 5) -#ifdef JP - msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel almost safe."); -#endif - + msg_print(_("ã»ã¨ãã©å®å ¨ãªæ°ãããã", "You feel almost safe.")); else -#ifdef JP - msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel lonely."); -#endif - + msg_print(_("å¯ããæ°ãããã", "You feel lonely.")); } if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic && one_in_(5000)) { - disturb(0, 0); -#ifdef JP - msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel invincible!"); -#endif - + disturb(0, 1); + msg_print(_("ç¡æµãªæ°ãããï¼", "You feel invincible!")); msg_print(NULL); (void)set_invuln(randint1(8) + 8, FALSE); } @@ -2831,27 +2506,17 @@ static void process_world_aux_mutation(void) /* Redraw mana */ p_ptr->redraw |= (PR_MANA); -#ifdef JP - take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1); -#else - take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1); -#endif - + take_hit(DAMAGE_LOSELIFE, healing, _("é ã«æã£ãè¡", "blood rushing to the head"), -1); } } if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000)) { - int slot = 0; + INVENTORY_IDX slot = 0; object_type *o_ptr = NULL; - disturb(0, 0); -#ifdef JP - msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª"); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1); -#else - msg_print("You trip over your own feet!"); - take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1); -#endif + disturb(0, 1); + msg_print(_("足ããã¤ãã¦è»¢ãã ï¼", "You trip over your own feet!")); + take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転å", "tripping"), -1); msg_print(NULL); if (buki_motteruka(INVEN_RARM)) @@ -2873,19 +2538,16 @@ static void process_world_aux_mutation(void) if (slot && !object_is_cursed(o_ptr)) { -#ifdef JP - msg_print("Éð´ï¤òÍî¤È¤·¤Æ¤·¤Þ¤Ã¤¿¡ª"); -#else - msg_print("You drop your weapon!"); -#endif + msg_print(_("æ¦å¨ãè½ã¨ãã¦ãã¾ã£ãï¼", "You drop your weapon!")); inven_drop(slot, 1); } } } - -/* - * Handle curse effects once every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«è£ åå¹æã®çºåå¤å®ãè¡ãå¦ç + * / Handle curse effects once every 10 game turns + * @return ãªã */ static void process_world_aux_curse(void) { @@ -2926,41 +2588,24 @@ static void process_world_aux_curse(void) o_ptr = &inventory[i_keep]; object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); - -#ifdef JP - msg_format("%s¤¬¥Æ¥ì¥Ý¡¼¥È¤ÎǽÎϤòȯư¤µ¤»¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", o_name); -#else - msg_format("Your %s is activating teleportation.", o_name); -#endif - -#ifdef JP - if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL)) -#else - if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL)) -#endif + msg_format(_("%sããã¬ãã¼ãã®è½åãçºåããããã¨ãã¦ããã", "Your %s is activating teleportation."), o_name); + if (get_check_strict(_("ãã¬ãã¼ããã¾ããï¼", "Teleport? "), CHECK_OKAY_CANCEL)) { - disturb(0, 0); + disturb(0, 1); teleport_player(50, 0L); } else { -#ifdef JP - msg_format("%s¤Ë{.}(¥Ô¥ê¥ª¥É)¤ÈÌäò¹ï¤à¤Èȯư¤òÍÞÀ©¤Ç¤¤Þ¤¹¡£", o_name); -#else - msg_format("You can inscribe {.} on your %s to disable random teleportation. ", o_name); -#endif - disturb(1, 0); + msg_format(_("%sã«{.}(ããªãªã)ã¨éãå»ãã¨çºåãæå¶ã§ãã¾ãã", + "You can inscribe {.} on your %s to disable random teleportation. "), o_name); + disturb(1, 1); } } /* Make a chainsword noise */ if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE)) { char noise[1024]; -#ifdef JP - if (!get_rnd_line("chainswd_j.txt", 0, noise)) -#else - if (!get_rnd_line("chainswd.txt", 0, noise)) -#endif + if (!get_rnd_line(_("chainswd_j.txt", "chainswd.txt"), 0, noise)) msg_print(noise); disturb(FALSE, FALSE); } @@ -2996,11 +2641,7 @@ static void process_world_aux_curse(void) object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); o_ptr->curse_flags |= new_curse; -#ifdef JP - msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name); -#else - msg_format("There is a malignant black aura surrounding your %s...", o_name); -#endif + msg_format(_("æªæã«æºã¡ãé»ããªã¼ã©ã%sãã¨ãã¾ãã...", "There is a malignant black aura surrounding your %s..."), o_name); o_ptr->feeling = FEEL_NONE; @@ -3023,12 +2664,7 @@ static void process_world_aux_curse(void) object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); o_ptr->curse_flags |= new_curse; -#ifdef JP - msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name); -#else - msg_format("There is a malignant black aura surrounding your %s...", o_name); -#endif - + msg_format(_("æªæã«æºã¡ãé»ããªã¼ã©ã%sãã¨ãã¾ãã...", "There is a malignant black aura surrounding your %s..."), o_name); o_ptr->feeling = FEEL_NONE; p_ptr->update |= (PU_BONUS); @@ -3037,74 +2673,67 @@ static void process_world_aux_curse(void) /* Call animal */ if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500)) { - if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL, + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY)); -#ifdef JP - msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name); -#else - msg_format("Your %s have attracted an animal!", o_name); -#endif - - disturb(0, 0); + msg_format(_("%sãåç©ãå¼ãå¯ããï¼", "Your %s have attracted an animal!"), o_name); + disturb(0, 1); } } /* Call demon */ if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111)) { - if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY)); -#ifdef JP - msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name); -#else - msg_format("Your %s have attracted a demon!", o_name); -#endif - - disturb(0, 0); + msg_format(_("%sãæªéãå¼ãå¯ããï¼", "Your %s have attracted a demon!"), o_name); + disturb(0, 1); } } /* Call dragon */ if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800)) { - if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON, + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) { char o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY)); -#ifdef JP - msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name); -#else - msg_format("Your %s have attracted an animal!", o_name); -#endif + msg_format(_("%sããã©ã´ã³ãå¼ãå¯ããï¼", "Your %s have attracted an dragon!"), o_name); + disturb(0, 1); + } + } + /* Call undead */ + if ((p_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111)) + { + if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, + (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET))) + { + char o_name[MAX_NLEN]; - disturb(0, 0); + object_desc(o_name, choose_cursed_obj_name(TRC_CALL_UNDEAD), (OD_OMIT_PREFIX | OD_NAME_ONLY)); + msg_format(_("%sãæ»éãå¼ãå¯ããï¼", "Your %s have attracted an undead!"), o_name); + disturb(0, 1); } } if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500)) { if (!p_ptr->resist_fear) { - disturb(0, 0); -#ifdef JP - msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª"); -#else - msg_print("It's so dark... so scary!"); -#endif - + disturb(0, 1); + msg_print(_("ã¨ã¦ãæã... ã¨ã¦ãæãï¼", "It's so dark... so scary!")); set_afraid(p_ptr->afraid + 13 + randint1(26)); } } /* Teleport player */ if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele) { - disturb(0, 0); + disturb(0, 1); /* Teleport player */ teleport_player(40, TELEPORT_PASSIVE); @@ -3115,11 +2744,7 @@ static void process_world_aux_curse(void) char o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY)); -#ifdef JP - msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name); -#else - msg_format("Your %s drains HP from you!", o_name); -#endif + msg_format(_("%sã¯ããªãã®ä½åãå¸åããï¼", "Your %s drains HP from you!"), o_name); take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1); } /* Handle mana draining */ @@ -3128,11 +2753,7 @@ static void process_world_aux_curse(void) char o_name[MAX_NLEN]; object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), (OD_OMIT_PREFIX | OD_NAME_ONLY)); -#ifdef JP - msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name); -#else - msg_format("Your %s drains mana from you!", o_name); -#endif + msg_format(_("%sã¯ããªãã®éåãå¸åããï¼", "Your %s drains mana from you!"), o_name); p_ptr->csp -= MIN(p_ptr->lev, 50); if (p_ptr->csp < 0) { @@ -3152,10 +2773,10 @@ static void process_world_aux_curse(void) { #ifdef JP if (object_is_known(o_ptr)) - msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª"); + msg_print("ã審å¤ã®å®ç³ãã¯ããªãã®ä½åãå¸åããï¼"); else - msg_print("¤Ê¤Ë¤«¤¬¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª"); - take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1); + msg_print("ãªã«ããããªãã®ä½åãå¸åããï¼"); + take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "審å¤ã®å®ç³", -1); #else if (object_is_known(o_ptr)) msg_print("The Jewel of Judgement drains life from you!"); @@ -3168,8 +2789,10 @@ static void process_world_aux_curse(void) } -/* - * Handle recharging objects once every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«ééå ·ã®èªç¶å å¡«ãè¡ãå¦ç + * / Handle recharging objects once every 10 game turns + * @return ãªã */ static void process_world_aux_recharge(void) { @@ -3225,8 +2848,8 @@ static void process_world_aux_recharge(void) if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout)) { /* Determine how many rods are charging. */ - int temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval; - if (temp > o_ptr->number) temp = o_ptr->number; + TIME_EFFECT temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval; + if (temp > o_ptr->number) temp = (TIME_EFFECT)o_ptr->number; /* Decrease timeout by that number. */ o_ptr->timeout -= temp; @@ -3270,7 +2893,7 @@ static void process_world_aux_recharge(void) if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout)) { /* Charge it */ - o_ptr->timeout -= o_ptr->number; + o_ptr->timeout -= (TIME_EFFECT)o_ptr->number; /* Boundary control. */ if (o_ptr->timeout < 0) o_ptr->timeout = 0; @@ -3279,8 +2902,10 @@ static void process_world_aux_recharge(void) } -/* - * Handle involuntary movement once every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ãããã¨ã«å¸°éãç¾å®å¤å®¹ãªã©ã®æ®ãæéã«ã¦ã³ããã¦ã³ã¨çºåãå¦çããã + * / Handle involuntary movement once every 10 game turns + * @return ãªã */ static void process_world_aux_movement(void) { @@ -3304,16 +2929,13 @@ static void process_world_aux_movement(void) if (!p_ptr->word_recall) { /* Disturbing! */ - disturb(0, 0); + disturb(0, 1); /* Determine the level */ - if (dun_level || p_ptr->inside_quest) + if (dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon) { -#ifdef JP -msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel yourself yanked upwards!"); -#endif + msg_print(_("ä¸ã«å¼ã£å¼µããããããæããããï¼", + "You feel yourself yanked upwards!")); if (dungeon_type) p_ptr->recall_dungeon = dungeon_type; if (record_stair) @@ -3331,11 +2953,8 @@ msg_print(" } else { -#ifdef JP -msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel yourself yanked downwards!"); -#endif + msg_print(_("ä¸ã«å¼ãããéããããæããããï¼", + "You feel yourself yanked downwards!")); dungeon_type = p_ptr->recall_dungeon; @@ -3365,14 +2984,14 @@ msg_print(" if (p_ptr->wild_mode) { - p_ptr->wilderness_y = py; - p_ptr->wilderness_x = px; + p_ptr->wilderness_y = p_ptr->y; + p_ptr->wilderness_x = p_ptr->x; } else { /* Save player position */ - p_ptr->oldpx = px; - p_ptr->oldpy = py; + p_ptr->oldpx = p_ptr->x; + p_ptr->oldpy = p_ptr->y; } p_ptr->wild_mode = FALSE; @@ -3391,13 +3010,18 @@ msg_print(" for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++) { - if ((quest[i].type == QUEST_TYPE_RANDOM) && - (quest[i].status == QUEST_STATUS_TAKEN) && - (quest[i].level < dun_level)) + quest_type* const q_ptr = &quest[i]; + + + if ((q_ptr->type == QUEST_TYPE_RANDOM) && + (q_ptr->status == QUEST_STATUS_TAKEN) && + (q_ptr->level < dun_level)) { - quest[i].status = QUEST_STATUS_FAILED; - quest[i].complev = (byte)p_ptr->lev; - r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR); + q_ptr->status = QUEST_STATUS_FAILED; + q_ptr->complev = (byte)p_ptr->lev; + update_playtime(); + q_ptr->comptime = playtime; + r_info[q_ptr->r_idx].flags1 &= ~(RF1_QUESTOR); } } } @@ -3424,16 +3048,12 @@ msg_print(" if (!p_ptr->alter_reality) { /* Disturbing! */ - disturb(0, 0); + disturb(0, 1); /* Determine the level */ if (!quest_number(dun_level) && dun_level) { -#ifdef JP - msg_print("À¤³¦¤¬ÊѤï¤Ã¤¿¡ª"); -#else - msg_print("The world changes!"); -#endif + msg_print(_("ä¸çãå¤ãã£ãï¼", "The world changes!")); /* * Clear all saved floors @@ -3446,11 +3066,7 @@ msg_print(" } else { -#ifdef JP - msg_print("À¤³¦¤¬¾¯¤·¤Î´ÖÊѲ½¤·¤¿¤è¤¦¤À¡£"); -#else - msg_print("The world seems to change for a moment!"); -#endif + msg_print(_("ä¸çãå°ãã®éå¤åããããã ã", "The world seems to change for a moment!")); } /* Sound */ @@ -3460,10 +3076,13 @@ msg_print(" } -/* - * Count number of adjacent monsters +/*! + * @brief æå®ããã¢ã³ã¹ã¿ã¼ã«é£æ¥ãã¦ããã¢ã³ã¹ã¿ã¼ã®æ°ãè¿ãã + * / Count number of adjacent monsters + * @param m_idx é£æ¥æ°ã調ã¹ããã¢ã³ã¹ã¿ã¼ã®ID + * @return é£æ¥ãã¦ããã¢ã³ã¹ã¿ã¼ã®æ° */ -static int get_monster_crowd_number(int m_idx) +static int get_monster_crowd_number(MONSTER_IDX m_idx) { monster_type *m_ptr = &m_list[m_idx]; int my = m_ptr->fy; @@ -3487,20 +3106,21 @@ static int get_monster_crowd_number(int m_idx) -/* - * Dungeon rating is no longer linear +/*! + * ãã³ã¸ã§ã³ã®é°å²æ°ãè¨ç®ããããã®éç·å½¢åºæºå¤ / Dungeon rating is no longer linear */ #define RATING_BOOST(delta) (delta * delta + 50 * delta) -/* - * Examine all monsters and unidentified objects, - * and get the feeling of current dungeon floor +/*! + * @brief ãã³ã¸ã§ã³ã®é°å²æ°ãç®åºããã + * / Examine all monsters and unidentified objects, and get the feeling of current dungeon floor + * @return ç®åºããããã³ã¸ã§ã³ã®é°å²æ°ã©ã³ã¯ */ static byte get_dungeon_feeling(void) { const int base = 10; int rating = 0; - int i; + IDX i; /* Hack -- no feeling in the town */ if (!dun_level) return 0; @@ -3639,9 +3259,10 @@ static byte get_dungeon_feeling(void) return 10; } - -/* - * Update dungeon feeling, and announce it if changed +/*! + * @brief ãã³ã¸ã§ã³ã®é°å²æ°ãæ´æ°ããå¤åããã£ãå ´åã¡ãã»ã¼ã¸ã表示ãã + * / Update dungeon feeling, and announce it if changed + * @return ãªã */ static void update_dungeon_feeling(void) { @@ -3686,6 +3307,8 @@ static void update_dungeon_feeling(void) /* Announce feeling */ do_cmd_feeling(); + select_floor_music(); + /* Update the level indicator */ p_ptr->redraw |= (PR_DEPTH); @@ -3693,9 +3316,10 @@ static void update_dungeon_feeling(void) if (disturb_minor) disturb(0, 0); } - -/* - * Handle certain things once every 10 game turns +/*! + * @brief 10ã²ã¼ã ã¿ã¼ã³ãé²è¡ããæ¯ã«ã²ã¼ã ä¸çå ¨ä½ã®å¦çãè¡ãã + * / Handle certain things once every 10 game turns + * @return ãªã */ static void process_world(void) { @@ -3710,6 +3334,17 @@ static void process_world(void) /* Update dungeon feeling, and announce it if changed */ update_dungeon_feeling(); + /* 帰éç¡ãã¢ã¼ãæã®ã¬ãã«ãã¬ããã°å¯¾ç / Fix for level teleport bugs on ironman_downward.*/ + if (ironman_downward && (dungeon_type != DUNGEON_ANGBAND && dungeon_type != 0)) + { + dun_level = 0; + dungeon_type = 0; + prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE); + p_ptr->inside_arena = FALSE; + p_ptr->wild_mode = FALSE; + p_ptr->leaving = TRUE; + } + /*** Check monster arena ***/ if (p_ptr->inside_battle && !p_ptr->leaving) { @@ -3732,11 +3367,7 @@ static void process_world(void) if (number_mon == 0) { -#ifdef JP - msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£"); -#else - msg_print("They have kill each other at the same time."); -#endif + msg_print(_("ç¸æã¡ã«çµããã¾ããã", "They have kill each other at the same time.")); msg_print(NULL); p_ptr->energy_need = 0; battle_monsters(); @@ -3749,46 +3380,26 @@ static void process_world(void) wm_ptr = &m_list[win_m_idx]; monster_desc(m_name, wm_ptr, 0); -#ifdef JP - msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name); -#else - msg_format("%s is winner!", m_name); -#endif + msg_format(_("%sãåå©ããï¼", "%s is winner!"), m_name); msg_print(NULL); if (win_m_idx == (sel_monster+1)) { -#ifdef JP - msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£"); -#else - msg_print("Congratulations."); -#endif -#ifdef JP - msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds); -#else - msg_format("You received %d gold.", battle_odds); -#endif + msg_print(_("ããã§ã¨ããããã¾ãã", "Congratulations.")); + msg_format(_("%dï¼ãåãåã£ãã", "You received %d gold."), battle_odds); p_ptr->au += battle_odds; } else { -#ifdef JP - msg_print("»ÄÇ°¤Ç¤·¤¿¡£"); -#else - msg_print("You lost gold."); -#endif + msg_print(_("æ®å¿µã§ããã", "You lost gold.")); } msg_print(NULL); p_ptr->energy_need = 0; battle_monsters(); } - else if (turn - old_turn == 150*TURNS_PER_TICK) + else if (turn - old_turn == 150 * TURNS_PER_TICK) { -#ifdef JP - msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£"); -#else - msg_format("This battle have ended in a draw."); -#endif + msg_print(_("ç³ãåãããã¾ãããããã®åè² ã¯å¼ãåãã¨ããã¦ããã ãã¾ãã", "This battle have ended in a draw.")); p_ptr->au += kakekin; msg_print(NULL); p_ptr->energy_need = 0; @@ -3810,19 +3421,14 @@ static void process_world(void) if (closing_flag <= 2) { /* Disturb */ - disturb(0, 0); + disturb(0, 1); /* Count warnings */ closing_flag++; /* Message */ -#ifdef JP -msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹..."); -msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£"); -#else - msg_print("The gates to ANGBAND are closing..."); - msg_print("Please finish up and/or save your game."); -#endif + msg_print(_("ã¢ã³ã°ãã³ãã¸ã®éãéãããã£ã¦ãã¾ã...", "The gates to ANGBAND are closing...")); + msg_print(_("ã²ã¼ã ãçµäºãããã»ã¼ãããããã¦ä¸ããã", "Please finish up and/or save your game.")); } @@ -3830,12 +3436,7 @@ msg_print(" else { /* Message */ -#ifdef JP -msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£"); -#else - msg_print("The gates to ANGBAND are now closed."); -#endif - + msg_print(_("ä»ãã¢ã³ã°ãã³ãã¸ã®éãéãããã¾ããã", "The gates to ANGBAND are now closed.")); /* Stop playing */ p_ptr->playing = FALSE; @@ -3855,11 +3456,7 @@ msg_print(" if (mon_fight && !ignore_unview) { -#ifdef JP - msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£"); -#else - msg_print("You hear noise."); -#endif + msg_print(_("ä½ããèãããã", "You hear noise.")); } /*** Handle the wilderness/town (sunshine) ***/ @@ -3881,11 +3478,7 @@ msg_print(" int y, x; /* Message */ -#ifdef JP - msg_print("Ì뤬ÌÀ¤±¤¿¡£"); -#else - msg_print("The sun has risen."); -#endif + msg_print(_("å¤ãæããã", "The sun has risen.")); if (!p_ptr->wild_mode) { @@ -3916,11 +3509,7 @@ msg_print(" int y, x; /* Message */ -#ifdef JP - msg_print("Æü¤¬ÄÀ¤ó¤À¡£"); -#else - msg_print("The sun has fallen."); -#endif + msg_print(_("æ¥ãæ²ãã ã", "The sun has fallen.")); if (!p_ptr->wild_mode) { @@ -3969,7 +3558,7 @@ msg_print(" if (p_ptr->special_defense & NINJA_S_STEALTH) { - if (cave[py][px].info & CAVE_GLOW) set_superstealth(FALSE); + if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE); } } } @@ -4010,11 +3599,7 @@ msg_print(" if (f_ptr->subtype == n) { /* Message */ -#ifdef JP - if (cheat_xtra) msg_format("%s¤ÎŹ¼ç¤ò¥·¥ã¥Ã¥Õ¥ë¤·¤Þ¤¹¡£", f_name + f_ptr->name); -#else - if (cheat_xtra) msg_format("Shuffle a Shopkeeper of %s.", f_name + f_ptr->name); -#endif + if (cheat_xtra) msg_format(_("%sã®åºä¸»ãã·ã£ããã«ãã¾ãã", "Shuffle a Shopkeeper of %s."), f_name + f_ptr->name); /* Shuffle it */ store_shuffle(n); @@ -4065,49 +3650,34 @@ msg_print(" /* * Nightmare mode activates the TY_CURSE at midnight - * * Require exact minute -- Don't activate multiple times in a minute */ + if (ironman_nightmare && (min != prev_min)) { + /* Every 15 minutes after 11:00 pm */ if ((hour == 23) && !(min % 15)) { /* Disturbing */ - disturb(0, 0); + disturb(0, 1); switch (min / 15) { case 0: -#ifdef JP - msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£"); -#else - msg_print("You hear a distant bell toll ominously."); -#endif + msg_print(_("é ãã§ä¸æ°å³ãªéã®é³ãé³´ã£ãã", "You hear a distant bell toll ominously.")); break; case 1: -#ifdef JP - msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£"); -#else - msg_print("A distant bell sounds twice."); -#endif + msg_print(_("é ãã§éãäºåé³´ã£ãã", "A distant bell sounds twice.")); break; case 2: -#ifdef JP - msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£"); -#else - msg_print("A distant bell sounds three times."); -#endif + msg_print(_("é ãã§éãä¸åé³´ã£ãã", "A distant bell sounds three times.")); break; case 3: -#ifdef JP - msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£"); -#else - msg_print("A distant bell tolls four times."); -#endif + msg_print(_("é ãã§éãååé³´ã£ãã", "A distant bell tolls four times.")); break; } } @@ -4115,16 +3685,25 @@ msg_print(" /* TY_CURSE activates at midnight! */ if (!hour && !min) { - int count = 0; - disturb(1, 0); -#ifdef JP - msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£"); -#else - msg_print("A distant bell tolls many times, fading into an deathly silence."); -#endif + disturb(1, 1); + msg_print(_("é ãã§éãä½åãé³´ããæ»ãã ãããªéããã®ä¸ã¸æ¶ãã¦ãã£ãã", "A distant bell tolls many times, fading into an deathly silence.")); + + if (p_ptr->wild_mode) + { + /* Go into large wilderness view */ + p_ptr->oldpy = randint1(MAX_HGT - 2); + p_ptr->oldpx = randint1(MAX_WID - 2); + change_wild_mode(); - activate_ty_curse(FALSE, &count); + /* Give first move to monsters */ + p_ptr->energy_use = 100; + + /* HACk -- set the encouter flag for the wilderness generation */ + generate_encounter = TRUE; + } + + invoking_midnight_curse = TRUE; } } @@ -4175,13 +3754,8 @@ msg_print(" if (!p_ptr->paralyzed && (randint0(100) < 10)) { /* Message */ -#ifdef JP - msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£"); -#else - msg_print("You faint from the lack of food."); -#endif - - disturb(1, 0); + msg_print(_("ãã¾ãã«ãç©ºè ¹ã§æ°çµ¶ãã¦ãã¾ã£ãã", "You faint from the lack of food.")); + disturb(1, 1); /* Hack -- faint (bypass free action) */ (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5)); @@ -4191,14 +3765,10 @@ msg_print(" if (p_ptr->food < PY_FOOD_STARVE) { /* Calculate damage */ - int dam = (PY_FOOD_STARVE - p_ptr->food) / 10; + HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10; /* Take damage */ -#ifdef JP - if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, "¶õÊ¢", -1); -#else - if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, "starvation", -1); -#endif + if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("ç©ºè ¹", "starvation"), -1); } } } @@ -4231,10 +3801,10 @@ msg_print(" process_world_aux_movement(); } - - -/* - * Verify use of "wizard" mode +/*! + * @brief ã¦ã£ã¶ã¼ãã¢ã¼ãã¸ã®å°å ¥å¦ç + * / Verify use of "wizard" mode + * @return å®éã«ã¦ã£ã¶ã¼ãã¢ã¼ãã¸ç§»è¡ãããTRUEãè¿ãã */ static bool enter_wizard_mode(void) { @@ -4244,40 +3814,22 @@ static bool enter_wizard_mode(void) /* Wizard mode is not permitted */ if (!allow_debug_opts || arg_wizard) { -#ifdef JP - msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ "); -#else - msg_print("Wizard mode is not permitted."); -#endif + msg_print(_("ã¦ã£ã¶ã¼ãã¢ã¼ãã¯è¨±å¯ããã¦ãã¾ããã ", "Wizard mode is not permitted.")); return FALSE; } /* Mention effects */ -#ifdef JP - msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ "); - msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£"); -#else - msg_print("Wizard mode is for debugging and experimenting."); - msg_print("The game will not be scored if you enter wizard mode."); -#endif - + msg_print(_("ã¦ã£ã¶ã¼ãã¢ã¼ãã¯ãããã°ã¨å®é¨ã®ããã®ã¢ã¼ãã§ãã ", "Wizard mode is for debugging and experimenting.")); + msg_print(_("ä¸åº¦ã¦ã£ã¶ã¼ãã¢ã¼ãã«å ¥ãã¨ã¹ã³ã¢ã¯è¨é²ããã¾ããã", "The game will not be scored if you enter wizard mode.")); msg_print(NULL); /* Verify request */ -#ifdef JP - if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? ")) -#else - if (!get_check("Are you sure you want to enter wizard mode? ")) -#endif + if (!get_check(_("æ¬å½ã«ã¦ã£ã¶ã¼ãã¢ã¼ãã«å ¥ãããã®ã§ãã? ", "Are you sure you want to enter wizard mode? "))) { return (FALSE); } - -#ifdef JP - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£"); -#else - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to enter wizard mode."); -#endif + + do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ã¦ã£ã¶ã¼ãã¢ã¼ãã«çªå ¥ãã¦ã¹ã³ã¢ãæ®ããªããªã£ãã", "give up recording score to enter wizard mode.")); /* Mark savefile */ p_ptr->noscore |= 0x0002; } @@ -4289,8 +3841,10 @@ static bool enter_wizard_mode(void) #ifdef ALLOW_WIZARD -/* - * Verify use of "debug" commands +/*! + * @brief ãããã°ã³ãã³ãã¸ã®å°å ¥å¦ç + * / Verify use of "debug" commands + * @return å®éã«ãããã°ã³ãã³ãã¸ç§»è¡ãããTRUEãè¿ãã */ static bool enter_debug_mode(void) { @@ -4300,40 +3854,23 @@ static bool enter_debug_mode(void) /* Debug mode is not permitted */ if (!allow_debug_opts) { -#ifdef JP - msg_print("¥Ç¥Ð¥Ã¥°¥³¥Þ¥ó¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ "); -#else - msg_print("Use of debug command is not permitted."); -#endif + msg_print(_("ãããã°ã³ãã³ãã¯è¨±å¯ããã¦ãã¾ããã ", "Use of debug command is not permitted.")); return FALSE; } /* Mention effects */ -#ifdef JP - msg_print("¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ "); - msg_print("¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£"); -#else - msg_print("The debug commands are for debugging and experimenting."); - msg_print("The game will not be scored if you use debug commands."); -#endif + msg_print(_("ãããã°ã»ã³ãã³ãã¯ãããã°ã¨å®é¨ã®ããã®ã³ãã³ãã§ãã ", "The debug commands are for debugging and experimenting.")); + msg_print(_("ãããã°ã»ã³ãã³ãã使ãã¨ã¹ã³ã¢ã¯è¨é²ããã¾ããã", "The game will not be scored if you use debug commands.")); msg_print(NULL); /* Verify request */ -#ifdef JP - if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? ")) -#else - if (!get_check("Are you sure you want to use debug commands? ")) -#endif + if (!get_check(_("æ¬å½ã«ãããã°ã»ã³ãã³ãã使ãã¾ãã? ", "Are you sure you want to use debug commands? "))) { return (FALSE); } -#ifdef JP - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£"); -#else - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands."); -#endif + do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ãããã°ã¢ã¼ãã«çªå ¥ãã¦ã¹ã³ã¢ãæ®ããªããªã£ãã", "give up sending score to use debug commands.")); /* Mark savefile */ p_ptr->noscore |= 0x0008; } @@ -4352,8 +3889,10 @@ extern void do_cmd_debug(void); #ifdef ALLOW_BORG -/* - * Verify use of "borg" commands +/*! + * @brief ãã¼ã°ã³ãã³ãã¸ã®å°å ¥å¦ç + * / Verify use of "borg" commands + * @return å®éã«ãã¼ã°ã³ãã³ãã¸ç§»è¡ãããTRUEãè¿ãã */ static bool enter_borg_mode(void) { @@ -4361,31 +3900,18 @@ static bool enter_borg_mode(void) if (!(p_ptr->noscore & 0x0010)) { /* Mention effects */ -#ifdef JP - msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ "); - msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£"); -#else - msg_print("The borg commands are for debugging and experimenting."); - msg_print("The game will not be scored if you use borg commands."); -#endif + msg_print(_("ãã¼ã°ã»ã³ãã³ãã¯ãããã°ã¨å®é¨ã®ããã®ã³ãã³ãã§ãã ", "The borg commands are for debugging and experimenting.")); + msg_print(_("ãã¼ã°ã»ã³ãã³ãã使ãã¨ã¹ã³ã¢ã¯è¨é²ããã¾ããã", "The game will not be scored if you use borg commands.")); msg_print(NULL); /* Verify request */ -#ifdef JP - if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? ")) -#else - if (!get_check("Are you sure you want to use borg commands? ")) -#endif + if (!get_check(_("æ¬å½ã«ãã¼ã°ã»ã³ãã³ãã使ãã¾ãã? ", "Are you sure you want to use borg commands? "))) { return (FALSE); } -#ifdef JP - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£"); -#else - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to use borg commands."); -#endif + do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ãã¼ã°ã»ã³ãã³ãã使ç¨ãã¦ã¹ã³ã¢ãæ®ããªããªã£ãã", "give up recording score to use borg commands.")); /* Mark savefile */ p_ptr->noscore |= 0x0010; } @@ -4402,16 +3928,15 @@ extern void do_cmd_borg(void); #endif /* ALLOW_BORG */ - -/* - * Parse and execute the current command - * Give "Warning" on illegal commands. - * - * XXX XXX XXX Make some "blocks" +/*! + * @brief ãã¬ã¤ã¤ã¼ããåããå ¥åã³ãã³ãã®åå²å¦çã + * / Parse and execute the current command Give "Warning" on illegal commands. + * @todo XXX XXX XXX Make some "blocks" + * @return ãªã */ static void process_command(void) { - int old_now_message = now_message; + COMMAND_CODE old_now_message = now_message; #ifdef ALLOW_REPEAT /* TNB */ @@ -4451,22 +3976,12 @@ static void process_command(void) if (p_ptr->wizard) { p_ptr->wizard = FALSE; -#ifdef JP -msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£"); -#else - msg_print("Wizard mode off."); -#endif - + msg_print(_("ã¦ã£ã¶ã¼ãã¢ã¼ã解é¤ã", "Wizard mode off.")); } else if (enter_wizard_mode()) { p_ptr->wizard = TRUE; -#ifdef JP -msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£"); -#else - msg_print("Wizard mode on."); -#endif - + msg_print(_("ã¦ã£ã¶ã¼ãã¢ã¼ãçªå ¥ã", "Wizard mode on.")); } /* Update monsters */ @@ -4702,21 +4217,13 @@ msg_print(" if (ambush_flag) { -#ifdef JP - msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£"); -#else - msg_print("To flee the ambush you have to reach the edge of the map."); -#endif + msg_print(_("襲æããéããã«ã¯ãããã®ç«¯ã¾ã§ç§»åããªããã°ãªããªãã", "To flee the ambush you have to reach the edge of the map.")); break; } if (p_ptr->food < PY_FOOD_WEAK) { -#ifdef JP - msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£"); -#else - msg_print("You must eat something here."); -#endif + msg_print(_("ãã®åã«é£äºãã¨ããªãã¨ã", "You must eat something here.")); break; } @@ -4780,11 +4287,7 @@ msg_print(" case 'G': { if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)) -#ifdef JP - msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª"); -#else - msg_print("You don't have to learn spells!"); -#endif + msg_print(_("åªæãå¦ç¿ããå¿ è¦ã¯ãªãï¼", "You don't have to learn spells!")); else if (p_ptr->pclass == CLASS_SAMURAI) do_cmd_gain_hissatsu(); else if (p_ptr->pclass == CLASS_MAGIC_EATER) @@ -4805,7 +4308,7 @@ msg_print(" else if (p_ptr->pclass == CLASS_SMITH) do_cmd_kaji(TRUE); else if (p_ptr->pclass == CLASS_MAGIC_EATER) - do_cmd_magic_eater(TRUE); + do_cmd_magic_eater(TRUE, FALSE); else if (p_ptr->pclass == CLASS_SNIPER) do_cmd_snipe_browse(); else do_cmd_browse(); @@ -4820,81 +4323,36 @@ msg_print(" { if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY)) { -#ifdef JP - msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª"); -#else - msg_print("You cannot cast spells!"); -#endif + msg_print(_("åªæãå±ããããªãï¼", "You cannot cast spells!")); } else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH)) { -#ifdef JP - msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The dungeon absorbs all attempted magic!"); -#endif + msg_print(_("ãã³ã¸ã§ã³ãéæ³ãå¸åããï¼", "The dungeon absorbs all attempted magic!")); msg_print(NULL); } else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH)) { -#ifdef JP - - cptr which_power = "ËâË¡"; -#else - cptr which_power = "magic"; -#endif + cptr which_power = _("éæ³", "magic"); if (p_ptr->pclass == CLASS_MINDCRAFTER) -#ifdef JP - which_power = "ĶǽÎÏ"; -#else - which_power = "psionic powers"; -#endif + which_power = _("è¶ è½å", "psionic powers"); else if (p_ptr->pclass == CLASS_IMITATOR) -#ifdef JP - which_power = "¤â¤Î¤Þ¤Í"; -#else - which_power = "imitation"; -#endif + which_power = _("ãã®ã¾ã", "imitation"); else if (p_ptr->pclass == CLASS_SAMURAI) -#ifdef JP - which_power = "ɬ»¦·õ"; -#else - which_power = "hissatsu"; -#endif + which_power = _("å¿ æ®ºå£", "hissatsu"); else if (p_ptr->pclass == CLASS_MIRROR_MASTER) -#ifdef JP - which_power = "¶ÀËâË¡"; -#else - which_power = "mirror magic"; -#endif + which_power = _("é¡éæ³", "mirror magic"); else if (p_ptr->pclass == CLASS_NINJA) -#ifdef JP - which_power = "Ǧ½Ñ"; -#else - which_power = "ninjutsu"; -#endif + which_power = _("å¿è¡", "ninjutsu"); else if (mp_ptr->spell_book == TV_LIFE_BOOK) -#ifdef JP - which_power = "µ§¤ê"; -#else - which_power = "prayer"; -#endif + which_power = _("ç¥ã", "prayer"); -#ifdef JP - msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power); -#else - msg_format("An anti-magic shell disrupts your %s!", which_power); -#endif - energy_use = 0; + msg_format(_("åéæ³ããªã¢ã%sãéªéããï¼", "An anti-magic shell disrupts your %s!"), which_power); + p_ptr->energy_use = 0; } else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER)) { -#ifdef JP - msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª"); -#else - msg_format("You cannot think directly!"); -#endif - energy_use = 0; + msg_format(_("çæ¦å£«åãã¦ãã¦é ãåããªãï¼", "You cannot think directly!")); + p_ptr->energy_use = 0; } else { @@ -4907,7 +4365,7 @@ msg_print(" else if (p_ptr->pclass == CLASS_IMITATOR) do_cmd_mane(FALSE); else if (p_ptr->pclass == CLASS_MAGIC_EATER) - do_cmd_magic_eater(FALSE); + do_cmd_magic_eater(FALSE, FALSE); else if (p_ptr->pclass == CLASS_SAMURAI) do_cmd_hissatsu(); else if (p_ptr->pclass == CLASS_BLUE_MAGE) @@ -4955,12 +4413,7 @@ msg_print(" do_cmd_activate(); else { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } } @@ -4991,10 +4444,7 @@ msg_print(" /* Throw an item */ case 'v': { - if (!p_ptr->wild_mode) - { - do_cmd_throw(); - } + if (!p_ptr->wild_mode) do_cmd_throw(1, FALSE, -1); break; } @@ -5007,12 +4457,7 @@ msg_print(" do_cmd_aim_wand(); else { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } } @@ -5026,12 +4471,7 @@ msg_print(" { if (p_ptr->inside_arena) { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } else if (use_command && rogue_like_commands) @@ -5055,12 +4495,7 @@ msg_print(" do_cmd_quaff_potion(); else { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } } @@ -5076,12 +4511,7 @@ msg_print(" do_cmd_read_scroll(); else { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } } @@ -5095,12 +4525,7 @@ msg_print(" { if (p_ptr->inside_arena) { -#ifdef JP -msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª"); -#else - msg_print("The arena absorbs all attempted magic!"); -#endif - + msg_print(_("ã¢ãªã¼ããéæ³ãå¸åããï¼", "The arena absorbs all attempted magic!")); msg_print(NULL); } else if (use_command && !rogue_like_commands) @@ -5382,32 +4807,27 @@ msg_print(" { char error_m[1024]; sound(SOUND_ILLEGAL); -#ifdef JP - if (!get_rnd_line("error_j.txt", 0, error_m)) -#else - if (!get_rnd_line("error.txt", 0, error_m)) -#endif - + if (!get_rnd_line(_("error_j.txt", "error.txt"), 0, error_m)) msg_print(error_m); } else -#ifdef JP -prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0); -#else - prt("Type '?' for help.", 0, 0); -#endif + { + prt(_(" '?' ã§ãã«ãã表示ããã¾ãã", "Type '?' for help."), 0, 0); + } break; } } - if (!energy_use && !now_message) + if (!p_ptr->energy_use && !now_message) now_message = old_now_message; } - - - -static bool monster_tsuri(int r_idx) +/*! + * @brief ã¢ã³ã¹ã¿ã¼ç¨®æãé£ãã種æãã©ãããå¤å®ããã + * @param r_idx å¤å®ãããã¢ã³ã¹ã¿ã¼ç¨®æã®ID + * @return é£ãã対象ãªãã°TRUEãè¿ã + */ +static bool monster_tsuri(MONRACE_IDX r_idx) { monster_race *r_ptr = &r_info[r_idx]; @@ -5418,7 +4838,10 @@ static bool monster_tsuri(int r_idx) } -/* Hack -- Pack Overflow */ +/*! + * @brief ã¢ã¤ãã ã®ææ種é¡æ°ãè¶ ããå ´åã«ã¢ã¤ãã ãåºã«è½ã¨ãå¦ç / Hack -- Pack Overflow + * @return ãªã + */ static void pack_overflow(void) { if (inventory[INVEN_PACK].k_idx) @@ -5434,27 +4857,19 @@ static void pack_overflow(void) o_ptr = &inventory[INVEN_PACK]; /* Disturbing */ - disturb(0, 0); + disturb(0, 1); /* Warning */ -#ifdef JP - msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª"); -#else - msg_print("Your pack overflows!"); -#endif + msg_print(_("ã¶ãã¯ããã¢ã¤ãã ãããµããï¼", "Your pack overflows!")); /* Describe */ object_desc(o_name, o_ptr, 0); /* Message */ -#ifdef JP - msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(INVEN_PACK)); -#else - msg_format("You drop %s (%c).", o_name, index_to_label(INVEN_PACK)); -#endif + msg_format(_("%s(%c)ãè½ã¨ããã", "You drop %s (%c)."), o_name, index_to_label(INVEN_PACK)); /* Drop it (carefully) near the player */ - (void)drop_near(o_ptr, 0, py, px); + (void)drop_near(o_ptr, 0, p_ptr->y, p_ptr->x); /* Modify, Describe, Optimize */ inven_item_increase(INVEN_PACK, -255); @@ -5469,32 +4884,64 @@ static void pack_overflow(void) } } +/*! + * @brief ãã¬ã¤ã¤ã¼ã®è¡åã¨ãã«ã®ã¼ãå å¡«ãããï¼ï¼ãã¬ã¤ã¤ã¼ã®ã¿ã¼ã³ãåãï¼æ¯ã«è¡ãããå¦ç / process the effects per 100 energy at player speed. + * @return ãªã + */ +static void process_upkeep_with_speed(void) +{ + /* Give the player some energy */ + if (!load && p_ptr->enchant_energy_need > 0 && !p_ptr->leaving) + { + p_ptr->enchant_energy_need -= SPEED_TO_ENERGY(p_ptr->pspeed); + } + + /* No turn yet */ + if (p_ptr->enchant_energy_need > 0) return; + + while (p_ptr->enchant_energy_need <= 0) + { + /* Handle the player song */ + if (!load) check_music(); + + /* Hex - Handle the hex spells */ + if (!load) check_hex(); + if (!load) revenge_spell(); + + /* There is some randomness of needed energy */ + p_ptr->enchant_energy_need += ENERGY_NEED(); + } +} -/* - * Process the player - * - * Notice the annoying code to handle "pack overflow", which - * must come first just in case somebody manages to corrupt - * the savefiles by clever use of menu commands or something. +/*! + * @brief ãã¬ã¤ã¤ã¼ã®è¡åå¦ç / Process the player + * @return ãªã + * @note + * Notice the annoying code to handle "pack overflow", which\n + * must come first just in case somebody manages to corrupt\n + * the savefiles by clever use of menu commands or something.\n */ static void process_player(void) { - int i; + IDX i; /*** Apply energy ***/ if (hack_mutation) { -#ifdef JP -msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª"); -#else - msg_print("You feel different!"); -#endif + msg_print(_("ä½ãå¤ãã£ãæ°ãããï¼", "You feel different!")); (void)gain_random_mutation(0); hack_mutation = FALSE; } + if (invoking_midnight_curse) + { + int count = 0; + activate_ty_curse(FALSE, &count); + invoking_midnight_curse = FALSE; + } + if (p_ptr->inside_battle) { for(i = 1; i < m_max; i++) @@ -5528,7 +4975,7 @@ msg_print(" if (resting < 0) { /* Basic resting */ - if (resting == -1) + if (resting == COMMAND_ARG_REST_FULL_HEALING) { /* Stop resting */ if ((p_ptr->chp == p_ptr->mhp) && @@ -5539,7 +4986,7 @@ msg_print(" } /* Complete resting */ - else if (resting == -2) + else if (resting == COMMAND_ARG_REST_UNTIL_DONE) { /* Stop resting */ if ((p_ptr->chp == p_ptr->mhp) && @@ -5562,7 +5009,7 @@ msg_print(" Term_xtra(TERM_XTRA_DELAY, 10); if (one_in_(1000)) { - int r_idx; + MONRACE_IDX r_idx; bool success = FALSE; get_mon_num_prep(monster_tsuri,NULL); r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level); @@ -5570,29 +5017,21 @@ msg_print(" if (r_idx && one_in_(2)) { int y, x; - y = py+ddy[tsuri_dir]; - x = px+ddx[tsuri_dir]; + y = p_ptr->y+ddy[tsuri_dir]; + x = p_ptr->x+ddx[tsuri_dir]; if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE)) { char m_name[80]; monster_desc(m_name, &m_list[cave[y][x].m_idx], 0); -#ifdef JP - msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name); -#else - msg_format("You have a good catch!", m_name); -#endif + msg_format(_("%sãé£ããï¼", "You have a good catch!"), m_name); success = TRUE; } } if (!success) { -#ifdef JP - msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª"); -#else - msg_print("Damn! The fish stole your bait!"); -#endif + msg_print(_("é¤ã ãé£ããã¦ãã¾ã£ãï¼ãã£ãï½ï¼", "Damn! The fish stole your bait!")); } - disturb(0, 0); + disturb(0, 1); } } @@ -5600,7 +5039,7 @@ msg_print(" if (check_abort) { /* Check for "player abort" (semi-efficiently for resting) */ - if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH)) + if (running || travel.run || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH)) { /* Do not wait */ inkey_scan = TRUE; @@ -5612,15 +5051,10 @@ msg_print(" flush(); /* Disturb */ - disturb(0, 0); + disturb(0, 1); /* Hack -- Show a Message */ -#ifdef JP -msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£"); -#else - msg_print("Canceled."); -#endif - + msg_print(_("ä¸æãã¾ããã", "Canceled.")); } } } @@ -5639,11 +5073,7 @@ msg_print(" /* Acquire the monster name */ monster_desc(m_name, m_ptr, 0); -#ifdef JP - msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name); -#else - msg_format("You have waked %s up.", m_name); -#endif + msg_format(_("%^sãèµ·ãããã", "You have waked %s up."), m_name); } if (MON_STUNNED(m_ptr)) @@ -5658,11 +5088,7 @@ msg_print(" monster_desc(m_name, m_ptr, 0); /* Dump a message */ -#ifdef JP - msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name); -#else - msg_format("%^s is no longer stunned.", m_name); -#endif + msg_format(_("%^sãæ¦æ§ç¶æ ããç«ã¡ç´ãããã", "%^s is no longer stunned."), m_name); } } @@ -5678,11 +5104,7 @@ msg_print(" monster_desc(m_name, m_ptr, 0); /* Dump a message */ -#ifdef JP - msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name); -#else - msg_format("%^s is no longer confused.", m_name); -#endif + msg_format(_("%^sãæ··ä¹±ç¶æ ããç«ã¡ç´ãããã", "%^s is no longer confused."), m_name); } } @@ -5698,25 +5120,14 @@ msg_print(" monster_desc(m_name, m_ptr, 0); /* Dump a message */ -#ifdef JP - msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name); -#else - msg_format("%^s is no longer fear.", m_name); -#endif + msg_format(_("%^sãææããç«ã¡ç´ãããã", "%^s is no longer fear."), m_name); } } /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */ handle_stuff(); } - - /* Handle the player song */ - if (!load) check_music(); - - /* Hex - Handle the hex spells */ - if (!load) check_hex(); - if (!load) revenge_spell(); - + load = FALSE; /* Fast */ @@ -5724,13 +5135,13 @@ msg_print(" { (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE); } - if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0])) + if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI) { - if (p_ptr->magic_num1[0] < 40) + if (P_PTR_KI < 40) { - p_ptr->magic_num1[0] = 0; + P_PTR_KI = 0; } - else p_ptr->magic_num1[0] -= 40; + else P_PTR_KI -= 40; p_ptr->update |= (PU_BONUS); } if (p_ptr->action == ACTION_LEARN) @@ -5790,7 +5201,7 @@ msg_print(" handle_stuff(); /* Place the cursor on the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); /* Refresh (optional) */ if (fresh_before) Term_fresh(); @@ -5805,13 +5216,13 @@ msg_print(" /* Assume free turn */ - energy_use = 0; + p_ptr->energy_use = 0; if (p_ptr->inside_battle) { /* Place the cursor on the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); command_cmd = SPECIAL_KEY_BUILDING; @@ -5823,7 +5234,7 @@ msg_print(" else if (p_ptr->paralyzed || (p_ptr->stun >= 100)) { /* Take a turn */ - energy_use = 100; + p_ptr->energy_use = 100; } /* Resting */ @@ -5842,14 +5253,14 @@ msg_print(" } /* Take a turn */ - energy_use = 100; + p_ptr->energy_use = 100; } /* Fishing */ else if (p_ptr->action == ACTION_FISH) { /* Take a turn */ - energy_use = 100; + p_ptr->energy_use = 100; } /* Running */ @@ -5894,7 +5305,7 @@ msg_print(" else { /* Place the cursor on the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); can_save = TRUE; /* Get a command (normal) */ @@ -5913,18 +5324,18 @@ msg_print(" /*** Clean up ***/ /* Significant */ - if (energy_use) + if (p_ptr->energy_use) { /* Use some energy */ - if (world_player || energy_use > 400) + if (world_player || p_ptr->energy_use > 400) { /* The Randomness is irrelevant */ - p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10; + p_ptr->energy_need += p_ptr->energy_use * TURNS_PER_TICK / 10; } else { /* There is some randomness of needed energy */ - p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L); + p_ptr->energy_need += (s16b)((s32b)p_ptr->energy_use * ENERGY_NEED() / 100L); } /* Hack -- constant hallucination */ @@ -6057,11 +5468,7 @@ msg_print(" /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); -#ifdef JP - msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×"); -#else - msg_print("You feel time flowing around you once more."); -#endif + msg_print(_("ãæã¯åãã ãâ¦ã", "You feel time flowing around you once more.")); msg_print(NULL); world_player = FALSE; p_ptr->energy_need = ENERGY_NEED(); @@ -6079,7 +5486,7 @@ msg_print(" } /* Sniper */ - if (energy_use && reset_concent) reset_concentration(TRUE); + if (p_ptr->energy_use && reset_concent) reset_concentration(TRUE); /* Handle "leaving" */ if (p_ptr->leaving) break; @@ -6089,12 +5496,18 @@ msg_print(" update_smell(); } - -/* - * Interact with the current dungeon level. - * - * This function will not exit until the level is completed, - * the user dies, or the game is terminated. +/*! + * @brief ç¾å¨ãã¬ã¤ã¤ã¼ããããã³ã¸ã§ã³ã®å ¨ä½å¦ç / Interact with the current dungeon level. + * @return ãªã + * @details + *
+ * ãã®é¢æ°ããç¾å¨ã®é層ãåºãããã¬ã¤ã¤ã¼ããã£ã©ãæ»ã¬ã + * ã²ã¼ã ãçµäºãããã®ããããã¾ã§ã«ã¼ãããã + *
+ *+ * This function will not exit until the level is completed,\n + * the user dies, or the game is terminated.\n + *
*/ static void dungeon(bool load_game) { @@ -6104,7 +5517,7 @@ static void dungeon(bool load_game) base_level = dun_level; /* Reset various flags */ - hack_mind = FALSE; + is_loading_now = FALSE; /* Not leaving */ p_ptr->leaving = FALSE; @@ -6138,7 +5551,7 @@ static void dungeon(bool load_game) /* Disturb */ - disturb(1, 0); + disturb(1, 1); /* Get index of current quest (if any) */ quest_num = quest_number(dun_level); @@ -6231,17 +5644,13 @@ static void dungeon(bool load_game) } else { -#ifdef JP -msg_print("»î¹ç³«»Ï¡ª"); -#else - msg_format("Ready..Fight!"); -#endif + msg_print(_("試åéå§ï¼", "Ready..Fight!")); msg_print(NULL); } } - if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT)) - p_ptr->magic_num1[0] = MUSIC_DETECT; + if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) > MUSIC_DETECT)) + SINGING_SONG_EFFECT(p_ptr) = MUSIC_DETECT; /* Hack -- notice death or departure */ if (!p_ptr->playing || p_ptr->is_dead) return; @@ -6256,7 +5665,7 @@ msg_print(" { if (r_info[d_info[dungeon_type].final_guardian].max_num) #ifdef JP - msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£", + msg_format("ãã®éã«ã¯%sã®ä¸»ã§ãã%sã棲ãã§ããã", d_name+d_info[dungeon_type].name, r_name+r_info[d_info[dungeon_type].final_guardian].name); #else @@ -6276,7 +5685,7 @@ msg_print(" /* Reset the object generation level */ object_level = base_level; - hack_mind = TRUE; + is_loading_now = TRUE; if (p_ptr->energy_need > 0 && !p_ptr->inside_battle && (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) @@ -6304,9 +5713,11 @@ msg_print(" /* Hack -- Compress the object list occasionally */ if (o_cnt + 32 < o_max) compact_objects(0); - + /* Process the player */ process_player(); + + process_upkeep_with_speed(); /* Handle "p_ptr->notice" */ notice_stuff(); @@ -6315,7 +5726,7 @@ msg_print(" handle_stuff(); /* Hack -- Hilite the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); /* Optional fresh */ if (fresh_after) Term_fresh(); @@ -6333,7 +5744,7 @@ msg_print(" handle_stuff(); /* Hack -- Hilite the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); /* Optional fresh */ if (fresh_after) Term_fresh(); @@ -6352,7 +5763,7 @@ msg_print(" handle_stuff(); /* Hack -- Hilite the player */ - move_cursor_relative(py, px); + move_cursor_relative(p_ptr->y, p_ptr->x); /* Optional fresh */ if (fresh_after) Term_fresh(); @@ -6360,9 +5771,6 @@ msg_print(" /* Hack -- Notice death or departure */ if (!p_ptr->playing || p_ptr->is_dead) break; - /* Handle "leaving" */ - if (p_ptr->leaving) break; - /* Count game turns */ turn++; @@ -6374,6 +5782,9 @@ msg_print(" prevent_turn_overflow(); + /* Handle "leaving" */ + if (p_ptr->leaving) break; + if (wild_regen) wild_regen--; } @@ -6402,9 +5813,10 @@ msg_print(" } -/* - * Load some "user pref files" - * +/*! + * @brief å ¨ã¦ã¼ã¶ãããã¡ã¤ã«ããã¼ããã / Load some "user pref files" + * @return ãªã + * @note * Modified by Arcum Dagsson to support * separate macro files for different realms. */ @@ -6466,8 +5878,9 @@ static void load_all_pref_files(void) } -/* - * Extract option variables from bit sets +/*! + * @brief ãããã»ããããã²ã¼ã ãªãã·ã§ã³ãå±éãã / Extract option variables from bit sets + * @return ãªã */ void extract_option_vars(void) { @@ -6499,12 +5912,14 @@ void extract_option_vars(void) } -/* - * Determine bounty uniques +/*! + * @brief è³éé¦ã¨ãªãã¦ãã¼ã¯ã確å®ãã / Determine bounty uniques + * @return ãªã */ void determine_bounty_uniques(void) { - int i, j, tmp; + int i, j; + MONRACE_IDX tmp; monster_race *r_ptr; get_mon_num_prep(NULL, NULL); @@ -6546,9 +5961,10 @@ void determine_bounty_uniques(void) } -/* - * Determine today's bounty monster - * Note: conv_old is used if loaded 0.0.3 or older save file +/*! + * @brief ä»æ¥ã®è³éé¦ã確å®ãã / Determine today's bounty monster + * @return ãªã + * @note conv_old is used if loaded 0.0.3 or older save file */ void determine_today_mon(bool conv_old) { @@ -6587,18 +6003,19 @@ void determine_today_mon(bool conv_old) p_ptr->inside_battle = old_inside_battle; } - -/* - * Actually play a game - * +/*! + * @brief 1ã²ã¼ã ãã¬ã¤ã®ä¸»è¦ã«ã¼ãã³ / Actually play a game + * @return ãªã + * @note * If the "new_game" parameter is true, then, after loading the * savefile, we will commit suicide, if necessary, to allow the * player to start a new game. */ void play_game(bool new_game) { - int i; + MONSTER_IDX i; bool load_game = TRUE; + bool init_random_seed = FALSE; #ifdef CHUUKEI if (chuukei_client) @@ -6650,12 +6067,7 @@ void play_game(bool new_game) if (!load_player()) { /* Oops */ -#ifdef JP -quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹"); -#else - quit("broken savefile"); -#endif - + quit(_("ã»ã¼ããã¡ã¤ã«ãå£ãã¦ãã¾ã", "broken savefile")); } /* Extract the options */ @@ -6667,11 +6079,7 @@ quit(" char buf[1024]; bool success; -#ifdef JP - if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY)) -#else - if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY)) -#endif + if (!get_check_strict(_("å¾ æ©ãã¦ããã¹ã³ã¢ç»é²ãä»è¡ãªãã¾ããï¼", "Do you register score now? "), CHECK_NO_HISTORY)) quit(0); /* Update stuff */ @@ -6682,7 +6090,7 @@ quit(" p_ptr->is_dead = TRUE; - start_time = time(NULL); + start_time = (u32b)time(NULL); /* No suspending now */ signals_ignore_tstp(); @@ -6696,31 +6104,22 @@ quit(" /* Open the high score file, for reading/writing */ highscore_fd = fd_open(buf, O_RDWR); + /* çºåæ¶å¤±ãã°å¯¾ç(#38205) Init the wilderness */ + process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); + /* Handle score, show Top scores */ success = send_world_score(TRUE); -#ifdef JP - if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY)) -#else - if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY)) -#endif + if (!success && !get_check_strict(_("ã¹ã³ã¢ç»é²ã諦ãã¾ããï¼", "Do you give up score registration? "), CHECK_NO_HISTORY)) { -#ifdef JP - prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0); -#else - prt("standing by for future registration...", 0, 0); -#endif + prt(_("å¼ãç¶ãå¾ æ©ãã¾ãã", "standing by for future registration..."), 0, 0); (void)inkey(); } else { p_ptr->wait_report_score = FALSE; top_twenty(); -#ifdef JP - if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª"); -#else - if (!save_player()) msg_print("death save failed!"); -#endif + if (!save_player()) msg_print(_("ã»ã¼ã失æï¼", "death save failed!")); } /* Shut the high score file */ (void)fd_close(highscore_fd); @@ -6746,7 +6145,7 @@ quit(" character_dungeon = FALSE; /* Prepare to init the RNG */ - Rand_quick = TRUE; + init_random_seed = TRUE; /* Initialize the saved floors data */ init_saved_floors(FALSE); @@ -6767,25 +6166,9 @@ quit(" } /* Init the RNG */ - if (Rand_quick) + if (init_random_seed) { - u32b seed; - - /* Basic seed */ - seed = (time(NULL)); - -#ifdef SET_UID - - /* Mutate the seed on Unix machines */ - seed = ((seed >> 3) * (getpid() << 1)); - -#endif - - /* Use the complex RNG */ - Rand_quick = FALSE; - - /* Seed the "complex" RNG */ - Rand_state_init(seed); + Rand_state_init(); } /* Roll new character */ @@ -6826,15 +6209,13 @@ quit(" { write_level = FALSE; -#ifdef JP - do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----"); -#else - do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----"); -#endif + do_cmd_write_nikki(NIKKI_GAMESTART, 1, + _(" ----ã²ã¼ã åé----", + " ---- Restart Game ----")); /* - * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£ - * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£ + * 1.0.9 以åã¯ã»ã¼ãåã« p_ptr->riding = -1 ã¨ãã¦ããã®ã§ãåè¨å®ãå¿ è¦ã ã£ãã + * ããä¸è¦ã ãã以åã®ã»ã¼ããã¡ã¤ã«ã¨ã®äºæã®ããã«æ®ãã¦ããã */ if (p_ptr->riding == -1) { @@ -6875,12 +6256,7 @@ quit(" flavor_init(); /* Flash a message */ -#ifdef JP -prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0); -#else - prt("Please wait...", 0, 0); -#endif - + prt(_("ãå¾ ã¡ä¸ãã...", "Please wait..."), 0, 0); /* Flush the message */ Term_fresh(); @@ -6893,7 +6269,7 @@ prt(" { p_ptr->wizard = TRUE; - if (p_ptr->is_dead || !py || !px) + if (p_ptr->is_dead || !p_ptr->y || !p_ptr->x) { /* Initialize the saved floors data */ init_saved_floors(TRUE); @@ -6902,7 +6278,7 @@ prt(" p_ptr->inside_quest = 0; /* Avoid crash in update_view() */ - py = px = 10; + p_ptr->y = p_ptr->x = 10; } } else if (p_ptr->is_dead) @@ -6923,6 +6299,7 @@ prt(" process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID); + select_floor_music(); } @@ -6938,18 +6315,14 @@ prt(" if (p_ptr->panic_save) { /* No player? -- Try to regenerate floor */ - if (!py || !px) + if (!p_ptr->y || !p_ptr->x) { -#ifdef JP - msg_print("¥×¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¤¬¤ª¤«¤·¤¤¡£¥Õ¥í¥¢¤òºÆÀ¸À®¤·¤Þ¤¹¡£"); -#else - msg_print("What a strange player location. Regenerate the dungeon floor."); -#endif + msg_print(_("ãã¬ã¤ã¤ã¼ã®ä½ç½®ããããããããã¢ãåçæãã¾ãã", "What a strange player location. Regenerate the dungeon floor.")); change_floor(); } /* Still no player? -- Try to locate random place */ - if (!py || !px) py = px = 10; + if (!p_ptr->y || !p_ptr->x) p_ptr->y = p_ptr->x = 10; /* No longer in panic */ p_ptr->panic_save = 0; @@ -6967,12 +6340,7 @@ prt(" if (new_game) { char buf[80]; - -#ifdef JP - sprintf(buf, "%s¤Ë¹ß¤êΩ¤Ã¤¿¡£", map_name()); -#else - sprintf(buf, "You are standing in the %s.", map_name()); -#endif + sprintf(buf, _("%sã«éãç«ã£ãã", "You are standing in the %s."), map_name()); do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf); } @@ -7017,21 +6385,24 @@ prt(" if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER))) { monster_type *m_ptr; - int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE); + IDX pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE); monster_race *r_ptr = &r_info[pet_r_idx]; - place_monster_aux(0, py, px - 1, pet_r_idx, + place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx, (PM_FORCE_PET | PM_NO_KAGE)); m_ptr = &m_list[hack_m_idx_ii]; m_ptr->mspeed = r_ptr->speed; m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2; m_ptr->max_maxhp = m_ptr->maxhp; m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2; + m_ptr->dealt_damage = 0; m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED(); } (void)combine_and_reorder_home(STORE_HOME); (void)combine_and_reorder_home(STORE_MUSEUM); + select_floor_music(); + /* Process */ while (TRUE) { @@ -7103,11 +6474,7 @@ prt(" else { /* Mega-Hack -- Allow player to cheat death */ -#ifdef JP - if ((p_ptr->wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? ")) -#else - if ((p_ptr->wizard || cheat_live) && !get_check("Die? ")) -#endif + if ((p_ptr->wizard || cheat_live) && !get_check(_("æ»ã«ã¾ãã? ", "Die? "))) { /* Mark social class, reset age, if needed */ if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0; @@ -7119,28 +6486,24 @@ prt(" p_ptr->noscore |= 0x0001; /* Message */ -#ifdef JP - msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£"); -#else - msg_print("You invoke wizard mode and cheat death."); -#endif + msg_print(_("ã¦ã£ã¶ã¼ãã¢ã¼ãã«å¿µãéããæ»ã欺ããã", "You invoke wizard mode and cheat death.")); msg_print(NULL); - /* Restore hit points */ - p_ptr->chp = p_ptr->mhp; - p_ptr->chp_frac = 0; + (void)life_stream(FALSE, FALSE); if (p_ptr->pclass == CLASS_MAGIC_EATER) { - for (i = 0; i < EATER_EXT*2; i++) + int magic_idx; + for (magic_idx = 0; magic_idx < EATER_EXT*2; magic_idx++) { - p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE; + p_ptr->magic_num1[magic_idx] = p_ptr->magic_num2[magic_idx]*EATER_CHARGE; } - for (; i < EATER_EXT*3; i++) + for (; magic_idx < EATER_EXT*3; magic_idx++) { - p_ptr->magic_num1[i] = 0; + p_ptr->magic_num1[magic_idx] = 0; } } + /* Restore spell points */ p_ptr->csp = p_ptr->msp; p_ptr->csp_frac = 0; @@ -7149,12 +6512,7 @@ prt(" if (p_ptr->word_recall) { /* Message */ -#ifdef JP - msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿..."); -#else - msg_print("A tension leaves the air around you..."); -#endif - + msg_print(_("å¼µãã¤ãã大æ°ãæµãå»ã£ã...", "A tension leaves the air around you...")); msg_print(NULL); /* Hack -- Prevent recall */ @@ -7171,25 +6529,11 @@ prt(" } /* Note cause of death XXX XXX XXX */ -#ifdef JP - (void)strcpy(p_ptr->died_from, "»à¤Îµ½¤"); -#else - (void)strcpy(p_ptr->died_from, "Cheating death"); -#endif + (void)strcpy(p_ptr->died_from, _("æ»ã®æ¬ºã", "Cheating death")); /* Do not die */ p_ptr->is_dead = FALSE; - /* Hack -- Healing */ - (void)set_blind(0); - (void)set_confused(0); - (void)set_poisoned(0); - (void)set_afraid(0); - (void)set_paralyzed(0); - (void)set_image(0); - (void)set_stun(0); - (void)set_cut(0); - /* Hack -- Prevent starvation */ (void)set_food(PY_FOOD_MAX - 1); @@ -7227,11 +6571,9 @@ prt(" p_ptr->wild_mode = FALSE; p_ptr->leaving = TRUE; -#ifdef JP - do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£"); -#else - do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived."); -#endif + do_cmd_write_nikki(NIKKI_BUNSHOU, 1, + _(" ããããçãè¿ã£ãã", + " but revived.")); /* Prepare next floor */ leave_floor(); @@ -7254,6 +6596,12 @@ prt(" quit(NULL); } +/*! + * @brief ã²ã¼ã ã¿ã¼ã³ããã®å®æéæç®ãè¡ãããã®è£æ£ãããã + * @param hoge ã²ã¼ã ã¿ã¼ã³ + * @details ã¢ã³ããã種æã¯18:00ããã²ã¼ã ãéå§ããã®ã§ããã®ä¿®æ£ãäºãè¡ãã + * @return ä¿®æ£ããããå¾ã®ã²ã¼ã ã¿ã¼ã³ + */ s32b turn_real(s32b hoge) { switch (p_ptr->start_race) @@ -7268,9 +6616,10 @@ s32b turn_real(s32b hoge) } } -/* - * ¥¿¡¼¥ó¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ËÂФ¹¤ëÂнè - * ¥¿¡¼¥óµÚ¤Ó¥¿¡¼¥ó¤òµÏ¿¤¹¤ëÊÑ¿ô¤ò¥¿¡¼¥ó¤Î¸Â³¦¤Î1ÆüÁ°¤Þ¤Ç´¬¤Ì᤹. +/*! + * @brief ã¿ã¼ã³ã®ãªã¼ãã¼ããã¼ã«å¯¾ããå¯¾å¦ + * @details ã¿ã¼ã³åã³ã¿ã¼ã³ãè¨é²ããå¤æ°ãã¿ã¼ã³ã®éçã®1æ¥åã¾ã§å·»ãæ»ã. + * @return ä¿®æ£ããããå¾ã®ã²ã¼ã ã¿ã¼ã³ */ void prevent_turn_overflow(void) {