OSDN Git Service

[Refactor] #37353 プレイヤーの魔法棒使用処理を cmd-zapwand.c/h に分離。 / Separate player's 'zap wand...
[hengband/hengband.git] / src / dungeon.c
index c9e721a..4ab7f59 100644 (file)
@@ -1,53 +1,61 @@
-/* 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-quaff.h"
+#include "cmd-read.h"
+#include "cmd-usestaff.h"
+#include "cmd-zapwand.h"
+
+#define TY_CURSE_CHANCE 200 /*!<太古の怨念の1ターン毎の発動確率(1/n)*/
+#define CHAINSWORD_NOISE 100 /*!<チェンソーの1ターン毎の発動確率(1/n)*/
+
+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)
 {
        /* Artifacts */
-       if (artifact_p(o_ptr) || o_ptr->art_name)
+       if (object_is_artifact(o_ptr))
        {
                /* Cursed/Broken */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_TERRIBLE;
 
                /* Normal */
                return FEEL_SPECIAL;
        }
 
        /* Ego-Items */
-       if (ego_item_p(o_ptr))
+       if (object_is_ego(o_ptr))
        {
                /* Cursed/Broken */
-               if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
+               if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_WORTHLESS;
 
                /* Normal */
                return FEEL_EXCELLENT;
        }
 
        /* Cursed items */
-       if (cursed_p(o_ptr)) return FEEL_CURSED;
+       if (object_is_cursed(o_ptr)) return FEEL_CURSED;
 
        /* Broken items */
-       if (broken_p(o_ptr)) return FEEL_BROKEN;
+       if (object_is_broken(o_ptr)) return FEEL_BROKEN;
 
        if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
 
@@ -61,23 +69,24 @@ 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)
 {
        /* Cursed items (all of them) */
-       if (cursed_p(o_ptr)) return FEEL_CURSED;
+       if (object_is_cursed(o_ptr)) return FEEL_CURSED;
 
        /* Broken items (all of them) */
-       if (broken_p(o_ptr)) return FEEL_BROKEN;
+       if (object_is_broken(o_ptr)) return FEEL_BROKEN;
 
        /* Artifacts -- except cursed/broken ones */
-       if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_UNCURSED;
+       if (object_is_artifact(o_ptr)) return FEEL_UNCURSED;
 
        /* Ego-Items -- except cursed/broken ones */
-       if (ego_item_p(o_ptr)) return FEEL_UNCURSED;
+       if (object_is_ego(o_ptr)) return FEEL_UNCURSED;
 
        /* Good armor bonus */
        if (o_ptr->to_a > 0) return FEEL_UNCURSED;
@@ -90,19 +99,23 @@ 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;
        object_type *o_ptr = &inventory[slot];
        char        o_name[MAX_NLEN];
-       int idx;
 
        /* We know about it already, do not tell us again */
        if (o_ptr->ident & (IDENT_SENSE))return;
 
        /* It is fully known, no information needed */
-       if (object_known_p(o_ptr)) return;
+       if (object_is_known(o_ptr)) return;
 
        /* Check for a feeling */
        feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
@@ -163,13 +176,13 @@ static void sense_inventory_aux(int slot, bool heavy)
        if (disturb_minor) disturb(0, 0);
 
        /* Get an object description */
-       object_desc(o_name, o_ptr, FALSE, 0);
+       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Message (equipment) */
        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...",
@@ -184,7 +197,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...",
@@ -202,10 +215,7 @@ o_name, index_to_label(slot),game_inscriptions[feel]);
        o_ptr->feeling = feel;
 
        /* Auto-inscription/destroy */
-       idx = is_autopick(o_ptr);
-       auto_inscribe_item(slot, idx);
-       if (destroy_feeling)
-               auto_destroy_item(slot, idx);
+       autopick_alter_item(slot, destroy_feeling);
 
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
@@ -216,15 +226,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)
 {
@@ -317,6 +330,7 @@ static void sense_inventory1(void)
                }
 
                case CLASS_PALADIN:
+               case CLASS_SNIPER:
                {
                        /* Bad sensing */
                        if (0 != randint0(77777L / (plev * plev + 40))) return;
@@ -459,7 +473,10 @@ static void sense_inventory1(void)
        }
 }
 
-
+/*!
+ * @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。
+ * @return なし
+ */
 static void sense_inventory2(void)
 {
        int         i;
@@ -480,6 +497,7 @@ static void sense_inventory2(void)
                case CLASS_SAMURAI:
                case CLASS_CAVALRY:
                case CLASS_BERSERKER:
+               case CLASS_SNIPER:
                {
                        return;
                }
@@ -582,23 +600,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];
@@ -622,30 +634,20 @@ if (get_check("¾
                }
 
                /* 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);
+               teleport_player(200, 0L);
                return;
        }
        else
@@ -654,88 +656,83 @@ else if (get_check("
        }
 
        /* 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);
 
        /* Change level */
        dun_level = command_arg;
-       prepare_change_floor_mode(CFM_CLEAR_ALL);
 
        leave_quest_check();
 
        if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL);
 
        p_ptr->inside_quest = 0;
-       p_ptr->leftbldg = FALSE;
-       energy_use = 0;
+       p_ptr->energy_use = 0;
+
+       /*
+        * Clear all saved floors
+        * and create a first saved floor
+        */
+       prepare_change_floor_mode(CFM_FIRST_FLOOR);
 
        /* Leaving */
        p_ptr->leaving = TRUE;
 }
 
-
+/*!
+ * @brief 種族アンバライトが出血時パターンの上に乗った際のペナルティ処理
+ * @return なし
+ */
 static void wreck_the_pattern(void)
 {
-       int to_ruin = 0, r_y, r_x;
+       int to_ruin = 0;
+       POSITION r_y, r_x;
+       int pattern_type = f_info[cave[p_ptr->y][p_ptr->x].feat].subtype;
 
-       if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
+       if (pattern_type == PATTERN_TILE_WRECKED)
        {
                /* Ruined already */
                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 ((cave[r_y][r_x].feat >= FEAT_PATTERN_START) &&
-                   (cave[r_y][r_x].feat < FEAT_PATTERN_XTRA2))
+               if (pattern_tile(r_y, r_x) &&
+                   (f_info[cave[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
                {
-                       cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
+                       cave_set_feat(r_y, r_x, feat_pattern_corrupted);
                }
        }
 
-       cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
+       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)
 {
-       if ((cave[py][px].feat < FEAT_PATTERN_START) ||
-           (cave[py][px].feat > FEAT_PATTERN_XTRA2))
-               return FALSE;
+       int pattern_type;
+
+       if (!pattern_tile(p_ptr->y, p_ptr->x)) return FALSE;
 
        if ((prace_is_(RACE_AMBERITE)) &&
            (p_ptr->cut > 0) && one_in_(10))
@@ -743,8 +740,11 @@ static bool pattern_effect(void)
                wreck_the_pattern();
        }
 
-       if (cave[py][px].feat == FEAT_PATTERN_END)
+       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);
@@ -759,93 +759,77 @@ static bool pattern_effect(void)
                (void)do_res_stat(A_CHR);
                (void)restore_level();
                (void)hp_player(1000);
-               cave_set_feat(py, px, FEAT_PATTERN_OLD);
-#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
-        * Pattern center one-time only to avoid various kinds
-        * of abuse, like luring the win monster into fighting you
-        * in the middle of the pattern...
-        */
+               /*
+                * We could make the healing effect of the
+                * Pattern center one-time only to avoid various kinds
+                * of abuse, like luring the win monster into fighting you
+                * in the middle of the pattern...
+                */
+               break;
 
-       else if (cave[py][px].feat == FEAT_PATTERN_OLD)
-       {
+       case PATTERN_TILE_OLD:
                /* No effect */
-       }
-       else if (cave[py][px].feat == FEAT_PATTERN_XTRA1)
-       {
+               break;
+
+       case PATTERN_TILE_TELEPORT:
                pattern_teleport();
-       }
-       else if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
-       {
+               break;
+
+       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;
 
-       }
-       else
-       {
-               if ((prace_is_(RACE_AMBERITE)) && !one_in_(2))
+       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;
        }
 
        return TRUE;
 }
 
 
-
-
-
-/*
- * Regenerate hit points                               -RAK-
+/*!
+ * @brief プレイヤーのHP自然回復処理 / Regenerate hit points -RAK-
+ * @param percent 回復比率
+ * @return なし
  */
 static void regenhp(int percent)
 {
-       s32b    new_chp, new_chp_frac;
-       int     old_chp;
+       s32b new_chp;
+       u32b new_chp_frac;
+       s32b old_chp;
 
        if (p_ptr->special_defense & KATA_KOUKIJIN) return;
        if (p_ptr->action == ACTION_HAYAGAKE) return;
+
        /* Save the old hitpoints */
        old_chp = p_ptr->chp;
 
-       /* Extract the new hitpoints */
-       new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE;
-       p_ptr->chp += (s16b)(new_chp >> 16);   /* div 65536 */
+       /*
+        * Extract the new hitpoints
+        *
+        * 'percent' is the Regen factor in unit (1/2^16)
+        */
+       new_chp = 0;
+       new_chp_frac = (p_ptr->mhp * percent + PY_REGEN_HPBASE);
+
+       /* Convert the unit (1/2^16) to (1/2^32) */
+       s64b_LSHIFT(new_chp, new_chp_frac, 16);
+
+       /* Regenerating */
+       s64b_add(&(p_ptr->chp), &(p_ptr->chp_frac), new_chp, new_chp_frac);
 
-       /* check for overflow */
-       if ((p_ptr->chp < 0) && (old_chp > 0)) p_ptr->chp = MAX_SHORT;
-       new_chp_frac = (new_chp & 0xFFFF) + p_ptr->chp_frac;    /* mod 65536 */
-       if (new_chp_frac >= 0x10000L)
-       {
-               p_ptr->chp_frac = (u16b)(new_chp_frac - 0x10000L);
-               p_ptr->chp++;
-       }
-       else
-       {
-               p_ptr->chp_frac = (u16b)new_chp_frac;
-       }
 
        /* Fully healed */
-       if (p_ptr->chp >= p_ptr->mhp)
+       if (0 < s64b_cmp(p_ptr->chp, p_ptr->chp_frac, p_ptr->mhp, 0))
        {
                p_ptr->chp = p_ptr->mhp;
                p_ptr->chp_frac = 0;
@@ -865,57 +849,85 @@ static void regenhp(int percent)
 }
 
 
-/*
- * Regenerate mana points                              -RAK-
+/*!
+ * @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        new_mana, new_mana_frac;
-       int                   old_csp;
-       bool    old_csp_msp = (p_ptr->csp > p_ptr->msp);
+       s32b old_csp = p_ptr->csp;
+       s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL;
 
-       if (p_ptr->special_defense & KATA_KOUKIJIN) return;
-       if ((p_ptr->pclass == CLASS_SAMURAI) && (p_ptr->regenerate)) percent /= 2;
-       old_csp = p_ptr->csp;
-       new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE;
-       if (old_csp_msp && (new_mana > 0))
-       {
-               new_mana *= 32;
-               p_ptr->csp--;
-               p_ptr->csp -= (s16b)(new_mana >> 16);   /* div 65536 */
-               new_mana_frac = p_ptr->csp_frac + 0x10000L - (new_mana & 0xFFFF);
-       }
-       else
+       /*
+        * Excess mana will decay 32 times faster than normal
+        * regeneration rate.
+        */
+       if (p_ptr->csp > p_ptr->msp)
        {
-               if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
-               p_ptr->csp += (s16b)(new_mana >> 16);   /* div 65536 */
+               /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
+               s32b decay = 0;
+               u32b decay_frac = (p_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
 
-               new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac;  /* mod 65536 */
-       }
-       if (new_mana_frac >= 0x10000L)
-       {
-               p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
-               p_ptr->csp++;
-       }
-       else
-       {
-               p_ptr->csp_frac = (u16b)(new_mana_frac);
+               /* Convert the unit (1/2^16) to (1/2^32) */
+               s64b_LSHIFT(decay, decay_frac, 16);
+
+               /* Decay */
+               s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), decay, decay_frac);
+
+               /* Stop decaying */
+               if (p_ptr->csp < p_ptr->msp)
+               {
+                       p_ptr->csp = p_ptr->msp;
+                       p_ptr->csp_frac = 0;
+               }
        }
 
-       /* check for overflow */
-       if (p_ptr->csp < 0)
+       /* Regenerating mana (unless the player has excess mana) */
+       else if (regen_rate > 0)
        {
-               p_ptr->csp = 0;
-               p_ptr->csp_frac = 0;
+               /* (percent/100) is the Regen factor in unit (1/2^16) */
+               s32b new_mana = 0;
+               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);
+
+               /* Regenerate */
+               s64b_add(&(p_ptr->csp), &(p_ptr->csp_frac), new_mana, new_mana_frac);
+
+               /* Must set frac to zero even if equal */
+               if (p_ptr->csp >= p_ptr->msp)
+               {
+                       p_ptr->csp = p_ptr->msp;
+                       p_ptr->csp_frac = 0;
+               }
        }
 
-       /* Must set frac to zero even if equal */
-       if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
+
+       /* Reduce mana (even when the player has excess mana) */
+       if (regen_rate < 0)
        {
-               p_ptr->csp = p_ptr->msp;
-               p_ptr->csp_frac = 0;
+               /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
+               s32b reduce_mana = 0;
+               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);
+
+               /* Reduce mana */
+               s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), reduce_mana, reduce_mana_frac);
+
+               /* Check overflow */
+               if (p_ptr->csp < 0)
+               {
+                       p_ptr->csp = 0;
+                       p_ptr->csp_frac = 0;
+               }
        }
 
+
        /* Redraw mana */
        if (old_csp != p_ptr->csp)
        {
@@ -930,24 +942,28 @@ 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;
 
-               /* Must set frac to zero even if equal */
+               /* Check maximum charge */
                if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
                {
                        p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
@@ -958,21 +974,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)
 {
@@ -1016,10 +1034,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)
 {
@@ -1053,7 +1071,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;
@@ -1072,482 +1090,160 @@ static void regen_captured_monsters(void)
        }
 }
 
-
-/*
- * Process the counters of monsters (once per 10 game turns)
- *
- * This function is to process monsters' counters same as player's.
+/*!
+ * @brief 寿命つき光源の警告メッセージ処理
+ * @param o_ptr 現在光源として使っているオブジェクトの構造体参照ポインタ
+ * @return なし
  */
-static void process_monsters_counters(void)
+static void notice_lite_change(object_type *o_ptr)
 {
-       int          m_idx;
-       monster_type *m_ptr;
-       monster_race *r_ptr;
-
-       u32b noise; /* Hack -- local "player stealth" value */
-
-       /* Handle "leaving" */
-       if (p_ptr->leaving) return;
-
-       /* Hack -- calculate the "player noise" */
-       noise = (1L << (30 - p_ptr->skill_stl));
+       /* Hack -- notice interesting fuel steps */
+       if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
+       {
+               /* Window stuff */
+               p_ptr->window |= (PW_EQUIP);
+       }
 
-       /* Process the monsters (backwards) */
-       for (m_idx = m_max - 1; m_idx >= 1; m_idx--)
+       /* Hack -- Special treatment when blind */
+       if (p_ptr->blind)
        {
-               /* Access the monster */
-               m_ptr = &m_list[m_idx];
-               r_ptr = &r_info[m_ptr->r_idx];
+               /* Hack -- save some light for later */
+               if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
+       }
 
-               /* Ignore "dead" monsters */
-               if (!m_ptr->r_idx) continue;
+       /* The light is now out */
+       else if (o_ptr->xtra4 == 0)
+       {
+               disturb(0, 1);
+               msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
 
-               /* Handle Invulnerability */
-               if (m_ptr->invulner)
-               {
-                       /* Reduce by one, note if expires */
-                       m_ptr->invulner--;
+               /* Recalculate torch radius */
+               p_ptr->update |= (PU_TORCH);
 
-                       if (!m_ptr->invulner)
-                       {
-                               if (m_ptr->ml)
-                               {
-                                       char m_name[80];
+               /* Some ego light lose its effects without fuel */
+               p_ptr->update |= (PU_BONUS);
+       }
 
-                                       /* Acquire the monster name */
-                                       monster_desc(m_name, m_ptr, 0);
+       /* The light is getting dim */
+       else if (o_ptr->name2 == EGO_LITE_LONG)
+       {
+               if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
+                   && (turn % (TURNS_PER_TICK*2)))
+               {
+                       if (disturb_minor) disturb(0, 1);
+                       msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
+               }
+       }
 
-                                       /* Dump a message */
-#ifdef JP
-                                       msg_format("%^s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ê¤¤¡£", m_name);
-#else
-                                       msg_format("%^s is no longer invulnerable.", m_name);
-#endif
+       /* The light is getting dim */
+       else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
+       {
+               if (disturb_minor) disturb(0, 1);
+                       msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
+       }
+}
 
-                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-                               }
-                               if (!p_ptr->wild_mode) m_ptr->energy_need += ENERGY_NEED();
-                       }
-               }
+/*!
+ * @brief クエスト階層から離脱する際の処理
+ * @return なし
+ */
+void leave_quest_check(void)
+{
+       /* Save quest number for dungeon pref file ($LEAVING_QUEST) */
+       leaving_quest = p_ptr->inside_quest;
 
-               /* Handle fast */
-               if (m_ptr->fast)
+       /* Leaving an 'only once' quest marks it as failed */
+       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))
                {
-                       /* Reduce by one, note if expires */
-                       m_ptr->fast--;
+                       q_ptr->status = QUEST_STATUS_FAILED;
+                       q_ptr->complev = (byte)p_ptr->lev;
+                       update_playtime();
+                       q_ptr->comptime = playtime;
 
-                       if (!m_ptr->fast && m_ptr->ml)
+                       /* Additional settings */
+                       switch (q_ptr->type)
                        {
-                               char m_name[80];
-
-                               /* Acquire the monster name */
-                               monster_desc(m_name, m_ptr, 0);
-
-                               /* Dump a message */
-#ifdef JP
-                               msg_format("%^s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
-#else
-                               msg_format("%^s is no longer fast.", m_name);
-#endif
+                         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);
 
-                               if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                               if (p_ptr->riding == m_idx)
-                               {
-                                       p_ptr->redraw |= (PR_UHEALTH);
-                                       p_ptr->update |= (PU_BONUS);
-                               }
+                               /* Floor of random quest will be blocked */
+                               prepare_change_floor_mode(CFM_NO_RETURN);
+                               break;
                        }
-               }
 
-               /* Handle slow */
-               if (m_ptr->slow)
-               {
-                       /* Reduce by one, note if expires */
-                       m_ptr->slow--;
-
-                       if (!m_ptr->slow && m_ptr->ml)
+                       /* Record finishing a quest */
+                       if (q_ptr->type == QUEST_TYPE_RANDOM)
                        {
-                               char m_name[80];
-
-                               /* Acquire the monster name */
-                               monster_desc(m_name, m_ptr, 0);
-
-                               /* Dump a message */
-#ifdef JP
-                               msg_format("%^s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
-#else
-                               msg_format("%^s is no longer slow.", m_name);
-#endif
-
-                               if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                               if (p_ptr->riding == m_idx)
-                               {
-                                       p_ptr->redraw |= (PR_UHEALTH);
-                                       p_ptr->update |= (PU_BONUS);
-                               }
+                               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);
                        }
                }
+       }
+}
 
-               /* Handle "sleep" */
-               if (m_ptr->csleep)
+/*!
+ * @brief 「塔」クエストの各階層から離脱する際の処理
+ * @return なし
+ */
+void leave_tower_check(void)
+{
+       leaving_quest = p_ptr->inside_quest;
+       /* Check for Tower Quest */
+       if (leaving_quest &&
+               (quest[leaving_quest].type == QUEST_TYPE_TOWER) &&
+               (quest[QUEST_TOWER1].status != QUEST_STATUS_COMPLETED))
+       {
+               if(quest[leaving_quest].type == QUEST_TYPE_TOWER)
                {
-                       /* Assume does not wake up */
-                       bool test = FALSE;
+                       quest[QUEST_TOWER1].status = QUEST_STATUS_FAILED;
+                       quest[QUEST_TOWER1].complev = (byte)p_ptr->lev;
+                       update_playtime();
+                       quest[QUEST_TOWER1].comptime = playtime;
+               }
+       }
+}
 
-                       /* Hack -- Require proximity */
-                       if (m_ptr->cdis < AAF_LIMIT)
-                       {
-                               /* Handle "sensing radius" */
-                               if (m_ptr->cdis <= (is_pet(m_ptr) ? ((r_ptr->aaf > MAX_SIGHT) ? MAX_SIGHT : r_ptr->aaf) : r_ptr->aaf))
-                               {
-                                       /* We may wake up */
-                                       test = TRUE;
-                               }
-
-                               /* Handle "sight" and "aggravation" */
-                               else if ((m_ptr->cdis <= MAX_SIGHT) &&
-                                       (player_has_los_bold(m_ptr->fy, m_ptr->fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
-                               {
-                                       /* We may wake up */
-                                       test = TRUE;
-                               }
-                       }
-
-                       if (test)
-                       {
-                               u32b notice = 0;
-
-                               /* Hack -- handle non-aggravation */
-                               if (!(p_ptr->cursed & TRC_AGGRAVATE)) notice = randint0(1024);
-
-                               /* Nightmare monsters are more alert */
-                               if (ironman_nightmare) notice /= 2;
-
-                               /* Hack -- See if monster "notices" player */
-                               if ((notice * notice * notice) <= noise)
-                               {
-                                       /* Hack -- amount of "waking" */
-                                       int d = 1;
-
-                                       /* Hack -- handle aggravation */
-                                       if (p_ptr->cursed & TRC_AGGRAVATE)
-                                       {
-                                               d = m_ptr->csleep;
-                                       }
-                                       else
-                                       {
-                                               /* Wake up faster near the player */
-                                               if (m_ptr->cdis < AAF_LIMIT / 2) d = (AAF_LIMIT / m_ptr->cdis);
-
-                                               /* Hack -- amount of "waking" is affected by speed of player */
-                                               d = (d * SPEED_TO_ENERGY(p_ptr->pspeed)) / 10;
-                                               if (d < 0) d = 1;
-                                       }
-
-                                       /* Still asleep */
-                                       if (m_ptr->csleep > d)
-                                       {
-                                               /* Monster wakes up "a little bit" */
-                                               m_ptr->csleep -= d;
-
-                                               /* Notice the "not waking up" */
-                                               if (m_ptr->ml)
-                                               {
-                                                       /* Hack -- Count the ignores */
-                                                       if (r_ptr->r_ignore < MAX_UCHAR)
-                                                       {
-                                                               r_ptr->r_ignore++;
-                                                       }
-                                               }
-                                       }
-
-                                       /* Just woke up */
-                                       else
-                                       {
-                                               /* Reset sleep counter */
-                                               m_ptr->csleep = 0;
-
-                                               /* Notice the "waking up" */
-                                               if (m_ptr->ml)
-                                               {
-                                                       char m_name[80];
-
-                                                       /* Acquire the monster name */
-                                                       monster_desc(m_name, m_ptr, 0);
-
-                                                       /* Dump a message */
-#ifdef JP
-                                                       msg_format("%^s¤¬Ìܤò³Ð¤Þ¤·¤¿¡£", m_name);
-#else
-                                                       msg_format("%^s wakes up.", m_name);
-#endif
-
-                                                       /* Redraw the health bar */
-                                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-
-                                                       if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
-                                                               p_ptr->update |= (PU_MON_LITE);
-
-                                                       /* Hack -- Count the wakings */
-                                                       if (r_ptr->r_wake < MAX_UCHAR)
-                                                       {
-                                                               r_ptr->r_wake++;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               /* Handle "stun" */
-               if (m_ptr->stunned)
-               {
-                       int d = 1;
-
-                       /* Make a "saving throw" against stun */
-                       if (randint0(10000) <= r_ptr->level * r_ptr->level)
-                       {
-                               /* Recover fully */
-                               d = m_ptr->stunned;
-                       }
-
-                       /* Hack -- Recover from stun */
-                       if (m_ptr->stunned > d)
-                       {
-                               /* Recover somewhat */
-                               m_ptr->stunned -= d;
-                       }
-
-                       /* Fully recover */
-                       else
-                       {
-                               /* Recover fully */
-                               m_ptr->stunned = 0;
-
-                               /* Message if visible */
-                               if (m_ptr->ml)
-                               {
-                                       char m_name[80];
-
-                                       /* Acquire the monster name */
-                                       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
-
-                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-                               }
-                       }
-               }
-
-               /* Handle confusion */
-               if (m_ptr->confused)
-               {
-                       /* Amount of "boldness" */
-                       int d = randint1(r_ptr->level / 20 + 1);
-
-                       /* Still confused */
-                       if (m_ptr->confused > d)
-                       {
-                               /* Reduce the confusion */
-                               m_ptr->confused -= d;
-                       }
-
-                       /* Recovered */
-                       else
-                       {
-                               /* No longer confused */
-                               m_ptr->confused = 0;
-
-                               /* Message if visible */
-                               if (m_ptr->ml)
-                               {
-                                       char m_name[80];
-
-                                       /* Acquire the monster name */
-                                       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
-
-                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-                               }
-                       }
-               }
-
-               /* Handle "fear" */
-               if (m_ptr->monfear)
-               {
-                       /* Amount of "boldness" */
-                       int d = randint1(r_ptr->level / 20 + 1);
-
-                       /* Still afraid */
-                       if (m_ptr->monfear > d)
-                       {
-                               /* Reduce the fear */
-                               m_ptr->monfear -= d;
-                       }
-
-                       /* Recover from fear, take note if seen */
-                       else
-                       {
-                               /* No longer afraid */
-                               m_ptr->monfear = 0;
-
-                               /* Visual note */
-                               if (m_ptr->ml)
-                               {
-                                       char m_name[80];
-                                       char m_poss[80];
-
-                                       /* Acquire the monster name/poss */
-                                       monster_desc(m_name, m_ptr, 0);
-                                       monster_desc(m_poss, m_ptr, 0x22);
-
-                                       /* Dump a message */
-#ifdef JP
-                                       msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
-#else
-                                       msg_format("%^s recovers %s courage.", m_name, m_poss);
-#endif
-
-                                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-                                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-                               }
-                       }
-               }
-       }
-}
-
-
-static void notice_lite_change(object_type *o_ptr)
-{
-       /* Hack -- notice interesting fuel steps */
-       if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
-       {
-               /* Window stuff */
-               p_ptr->window |= (PW_EQUIP);
-       }
-
-       /* Hack -- Special treatment when blind */
-       if (p_ptr->blind)
-       {
-               /* Hack -- save some light for later */
-               if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
-       }
-
-       /* 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
-               p_ptr->update |= (PU_BONUS);
-       }
-
-       /* The light is getting dim */
-       else if (o_ptr->name2 == EGO_LITE_LONG)
-       {
-               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
-
-               }
-       }
-
-       /* 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
-
-       }
-}
-
-
-void leave_quest_check(void)
-{
-       /* Save quset 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;
-               if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
-               {
-                       r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
-                       if (record_rand_quest)
-                               do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
-
-                       /* Floor of random quest will be blocked */
-                       prepare_change_floor_mode(CFM_NO_RETURN);
-               }
-               else if (record_fix_quest)
-                       do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
-       }
-}
-
-
-/*
- * 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;
-       int idx;
+/*!
+ * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
+ * @return なし
+ * @todo mind.cにこの関数を移動させるべき。
+ * @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)
+{
+       OBJECT_IDX      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
+       q = _("どのアイテムを調べますか?", "Meditate on which item? ");
+       s = _("調べるアイテムがありません。", "You have nothing appropriate.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
 
@@ -1564,14 +1260,9 @@ s = "Ĵ
        }
 
        /* It is fully known, no information needed */
-       if (object_known_p(o_ptr))
+       if (object_is_known(o_ptr))
        {
-#ifdef JP
-msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
-#else
-               msg_print("You cannot find out anything more about that.");
-#endif
-
+               msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
                return TRUE;
        }
 
@@ -1579,22 +1270,17 @@ msg_print("
        feel = value_check_aux1(o_ptr);
 
        /* Get an object description */
-       object_desc(o_name, o_ptr, FALSE, 0);
+       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
-
+               msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
                return TRUE;
        }
 
 #ifdef JP
-msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
+msg_format("%sは%sという感じがする...",
     o_name,  game_inscriptions[feel]);
 #else
        msg_format("You feel that the %s %s %s...",
@@ -1609,6 +1295,9 @@ msg_format("%s
        /* "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);
 
@@ -1645,115 +1334,16 @@ msg_format("%s
        }
 
        /* Auto-inscription/destroy */
-       idx = is_autopick(o_ptr);
-       auto_inscribe_item(item, idx);
-       if (okay && destroy_feeling)
-               auto_destroy_item(item, idx);
+       autopick_alter_item(item, (bool)(okay && destroy_feeling));
 
        /* Something happened */
        return (TRUE);
 }
 
-
-static void gere_music(s32b music)
-{
-       switch(music)
-       {
-               case MUSIC_SLOW:
-                       slow_monsters();
-                       break;
-               case MUSIC_STUN:
-                       stun_monsters(damroll(p_ptr->lev/10,2));
-                       break;
-               case MUSIC_L_LIFE:
-                       hp_player(damroll(2,6));
-                       break;
-               case MUSIC_FEAR:
-                       project_hack(GF_TURN_ALL, p_ptr->lev);
-                       break;
-               case MUSIC_PSI:
-                       project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
-                       break;
-               case MUSIC_ID:
-                       project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
-                       break;
-               case MUSIC_CONF:
-                       confuse_monsters(p_ptr->lev * 2);
-                       break;
-               case MUSIC_SOUND:
-                       project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
-                       break;
-               case MUSIC_CHARM:
-                       charm_monsters(damroll(10 + p_ptr->lev/15,6));
-                       break;
-               case MUSIC_WALL:
-                       project(0, 0, py, px,
-                               0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
-                       break;
-               case MUSIC_DISPEL:
-                       dispel_monsters(randint1(p_ptr->lev * 3));
-                       dispel_evil(randint1(p_ptr->lev * 3));
-                       break;
-               case MUSIC_SARUMAN:
-                       slow_monsters();
-                       sleep_monsters();
-                       break;
-               case MUSIC_QUAKE:
-                       earthquake(py, px, 10);
-                       break;
-               case MUSIC_STASIS:
-                       stasis_monsters(p_ptr->lev * 4);
-                       break;
-               case MUSIC_SHERO:
-                       dispel_monsters(randint1(p_ptr->lev * 3));
-                       break;
-               case MUSIC_H_LIFE:
-                       hp_player(damroll(15,10));
-                       set_stun(0);
-                       set_cut(0);
-                       break;
-               case MUSIC_DETECT+19:
-                       wiz_lite(FALSE);
-               case MUSIC_DETECT+11:
-               case MUSIC_DETECT+12:
-               case MUSIC_DETECT+13:
-               case MUSIC_DETECT+14:
-               case MUSIC_DETECT+15:
-               case MUSIC_DETECT+16:
-               case MUSIC_DETECT+17:
-               case MUSIC_DETECT+18:
-                       map_area(DETECT_RAD_MAP);
-                       if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
-               case MUSIC_DETECT+6:
-               case MUSIC_DETECT+7:
-               case MUSIC_DETECT+8:
-               case MUSIC_DETECT+9:
-               case MUSIC_DETECT+10:
-                       /* There are too many hidden treasure.  So... */
-                       /* detect_treasure(DETECT_RAD_DEFAULT); */
-                       detect_objects_gold(DETECT_RAD_DEFAULT);
-                       detect_objects_normal(DETECT_RAD_DEFAULT);
-                       if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
-               case MUSIC_DETECT+3:
-               case MUSIC_DETECT+4:
-               case MUSIC_DETECT+5:
-                       detect_monsters_invis(DETECT_RAD_DEFAULT);
-                       detect_monsters_normal(DETECT_RAD_DEFAULT);
-                       if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
-               case MUSIC_DETECT:
-               case MUSIC_DETECT+1:
-               case MUSIC_DETECT+2:
-                       detect_traps(DETECT_RAD_DEFAULT, TRUE);
-                       detect_doors(DETECT_RAD_DEFAULT);
-                       detect_stairs(DETECT_RAD_DEFAULT);
-                       if ((p_ptr->lev > 14)  && (music  < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
-                       break;
-       }
-}
-
-/*
- * 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)
 {
@@ -1765,7 +1355,7 @@ static void recharged_notice(object_type *o_ptr)
        if (!o_ptr->inscription) return;
 
        /* Find a '!' */
-       s = strchr(quark_str(o_ptr->inscription), '!');
+       s = my_strchr(quark_str(o_ptr->inscription), '!');
 
        /* Process notification request. */
        while (s)
@@ -1774,11 +1364,11 @@ static void recharged_notice(object_type *o_ptr)
                if (s[1] == '!')
                {
                        /* Describe (briefly) */
-                       object_desc(o_name, o_ptr, FALSE, 0);
+                       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
                        /* 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);
@@ -1793,55 +1383,55 @@ static void recharged_notice(object_type *o_ptr)
                }
 
                /* Keep looking for '!'s */
-               s = strchr(s + 1, '!');
+               s = my_strchr(s + 1, '!');
        }
 }
 
-
+/*!
+ * @brief プレイヤーの歌に関する継続処理
+ * @return なし
+ */
 static void check_music(void)
 {
-       magic_type *s_ptr;
+       const magic_type *s_ptr;
        int spell;
-       u32b need_mana;
+       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)
+       {
+               stop_singing();
+               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);
-       need_mana *= 0x8000;
-       if (((u32b)p_ptr->csp < (need_mana / 0x10000)) || (p_ptr->anti_magic))
+       need_mana_frac = 0;
+
+       /* Divide by 2 */
+       s64b_RSHIFT(need_mana, need_mana_frac, 1);
+
+       if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, need_mana, need_mana_frac) < 0)
        {
                stop_singing();
                return;
        }
        else
        {
-               p_ptr->csp -= (u16b) (need_mana / 0x10000);
-               need_mana = (need_mana & 0xffff);
-               if ((u32b)p_ptr->csp_frac < need_mana)
-               {
-                       p_ptr->csp--;
-                       p_ptr->csp_frac += (u16b)(0x10000L - need_mana);
-               }
-               else
-               {
-                       p_ptr->csp_frac -= (u16b)need_mana;
-               }
+               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 */
@@ -1866,10 +1456,16 @@ static void check_music(void)
        else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
        { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
 
-       gere_music(p_ptr->magic_num1[0]);
+       /* Do any effects of continual song */
+       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;
@@ -1889,337 +1485,123 @@ 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 certain things once every 10 game turns
+/*!
+ * @brief 10ゲームターンが進行するごとにプレイヤーのHPとMPの増減処理を行う。
+ *  / Handle timed damage and regeneration every 10 game turns
+ * @return なし
  */
-static void process_world(void)
+static void process_world_aux_hp_and_sp(void)
 {
-       int x, y, i, j;
-       int regen_amount;
+       feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
        bool cave_no_regen = FALSE;
        int upkeep_factor = 0;
-       cave_type *c_ptr;
-       object_type *o_ptr;
-       int temp;
-       object_kind *k_ptr;
-       const int dec_count = (easy_band ? 2 : 1);
 
-       int day, hour, min, prev_min;
-
-       s32b len = TURNS_PER_TICK * TOWN_DAWN;
-       s32b tick = turn % len + len / 4;
+       /* Default regeneration */
+       int regen_amount = PY_REGEN_NORMAL;
 
-       extract_day_hour_min(&day, &hour, &min);
-       prev_min = (1440 * (tick - TURNS_PER_TICK) / len) % 60;
 
-       if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
-           && (dun_level) &&
-           !(quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) &&
-           !(p_ptr->inside_battle))
-               do_cmd_feeling();
+       /*** Damage over Time ***/
 
-       if (p_ptr->inside_battle && !p_ptr->leaving)
+       /* Take damage from poison */
+       if (p_ptr->poisoned && !IS_INVULN())
        {
+               /* Take damage */
+               take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
+       }
 
-               int i2, j2;
-               int win_m_idx = 0;
-               int number_mon = 0;
-
-               /* Count all hostile monsters */
-               for (i2 = 0; i2 < cur_wid; ++i2)
-                       for (j2 = 0; j2 < cur_hgt; j2++)
-                               if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
-                               {
-                                       number_mon++;
-                                       win_m_idx = cave[j2][i2].m_idx;
-                               }
+       /* Take damage from cuts */
+       if (p_ptr->cut && !IS_INVULN())
+       {
+               HIT_POINT dam;
 
-               if (number_mon == 0)
+               /* Mortal wound or Deep Gash */
+               if (p_ptr->cut > 1000)
                {
-#ifdef JP
-msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
-#else
-                       msg_print("They have kill each other at the same time.");
-#endif
-                       msg_print(NULL);
-                       p_ptr->energy_need = 0;
-                       battle_monsters();
+                       dam = 200;
                }
-               else if ((number_mon-1) == 0)
-               {
-                       char m_name[80];
-                       monster_type *wm_ptr;
-
-                       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_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
-                       p_ptr->au += battle_odds;
-                       }
-                       else
-                       {
-#ifdef JP
-msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
-#else
-                               msg_print("You lost gold.");
-#endif
-                       }
-                       msg_print(NULL);
-                       p_ptr->energy_need = 0;
-                       battle_monsters();
-               }
-               else if(turn - old_turn == 150*TURNS_PER_TICK)
+               else if (p_ptr->cut > 200)
                {
-#ifdef JP
-msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤­Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£");
-#else
-                       msg_format("This battle have ended in a draw.");
-#endif
-                       p_ptr->au += kakekin;
-                       msg_print(NULL);
-                       p_ptr->energy_need = 0;
-                       battle_monsters();
+                       dam = 80;
                }
-       }
-
-       /* Every 10 game turns */
-       if (turn % TURNS_PER_TICK) return;
-
-       /*** Check the Time and Load ***/
 
-       if (!(turn % (50*TURNS_PER_TICK)))
-       {
-               /* Check time and load */
-               if ((0 != check_time()) || (0 != check_load()))
+               /* Severe cut */
+               else if (p_ptr->cut > 100)
                {
-                       /* Warning */
-                       if (closing_flag <= 2)
-                       {
-                               /* Disturb */
-                               disturb(0, 0);
-
-                               /* 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
-
-                       }
-
-                       /* Slam the gate */
-                       else
-                       {
-                               /* Message */
-#ifdef JP
-msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
-#else
-                               msg_print("The gates to ANGBAND are now closed.");
-#endif
-
-
-                               /* Stop playing */
-                               p_ptr->playing = FALSE;
-
-                               /* Leaving */
-                               p_ptr->leaving = TRUE;
-                       }
+                       dam = 32;
                }
-       }
-
-       /*** Attempt timed autosave ***/
-       if (autosave_t && autosave_freq && !p_ptr->inside_battle)
-       {
-               if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
-                       do_cmd_save_game(TRUE);
-       }
-
-       if (mon_fight)
-       {
-#ifdef JP
-               msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
-#else
-               msg_print("You hear noise.");
-#endif
-       }
-
-       /*** Handle the wilderness/town (sunshine) ***/
 
-       /* While in town/wilderness */
-       if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
-       {
-               /* Hack -- Daybreak/Nighfall in town */
-               if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
+               else if (p_ptr->cut > 50)
                {
-                       bool dawn;
-
-                       /* Check for dawn */
-                       dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
-
-                       /* Day breaks */
-                       if (dawn)
-                       {
-                               /* Message */
-#ifdef JP
-msg_print("Ì뤬ÌÀ¤±¤¿¡£");
-#else
-                               msg_print("The sun has risen.");
-#endif
-
-
-                               /* Hack -- Scan the town */
-                               for (y = 0; y < cur_hgt; y++)
-                               {
-                                       for (x = 0; x < cur_wid; x++)
-                                       {
-                                               /* Get the cave grid */
-                                               c_ptr = &cave[y][x];
-
-                                               /* Assume lit */
-                                               c_ptr->info |= (CAVE_GLOW);
-
-                                               /* Hack -- Memorize lit grids if allowed */
-                                               if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
-
-                                               /* Hack -- Notice spot */
-                                               note_spot(y, x);
-                                       }
-                               }
-                       }
-
-                       /* Night falls */
-                       else
-                       {
-                               /* Message */
-#ifdef JP
-msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
-#else
-                               msg_print("The sun has fallen.");
-#endif
-
-
-                               /* Hack -- Scan the town */
-                               for (y = 0; y < cur_hgt; y++)
-                               {
-                                       for (x = 0; x < cur_wid; x++)
-                                       {
-                                               /* Get the cave grid */
-                                               c_ptr = &cave[y][x];
-
-                                               /* Darken "boring" features */
-                                               if ((c_ptr->feat <= FEAT_INVIS) ||
-                                                   ((c_ptr->feat >= FEAT_DEEP_WATER) &&
-                                                       (c_ptr->feat <= FEAT_MOUNTAIN) &&
-                                                    (c_ptr->feat != FEAT_MUSEUM)) ||
-                                                   (x == 0) || (x == cur_wid-1) ||
-                                                   (y == 0) || (y == cur_hgt-1))
-                                               {
-                                                       /* Forget the grid */
-                                                       if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
-
-                                                       /* Hack -- Notice spot */
-                                                       note_spot(y, x);
-                                               }
-                                       }
-
-                                       /* Glow deep lava */
-                                       glow_deep_lava();
-                               }
-                       }
-
-                       /* Update the monsters */
-                       p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
-
-                       /* Redraw map */
-                       p_ptr->redraw |= (PR_MAP);
-
-                       /* Window stuff */
-                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+                       dam = 16;
                }
-       }
-
-       /* Set back the rewards once a day */
-       /* Only used for reward in thief's guild for now */
-       if (!(turn % (TURNS_PER_TICK * TOWN_DAWN)))
-       {
-               int n;
 
-               /* Reset the rewards */
-               for (n = 0; n < MAX_BACT; n++)
+               else if (p_ptr->cut > 25)
                {
-                       p_ptr->rewards[n] = FALSE;
+                       dam = 7;
                }
 
-               /* Message */
-#ifdef JP
-if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
-#else
-               if (cheat_xtra) msg_print("Rewards reset.");
-#endif
-
-       }
-
-
-       /*** Process the monsters ***/
-
-       /* Check for creature generation. */
-       if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
-           !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
-       {
-               /* Make a new monster */
-               (void)alloc_monster(MAX_SIGHT + 5, 0);
-       }
-
-       /* Hack -- Check for creature regeneration */
-       if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
-       if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
-
-       /* Hack -- Process the counters of all monsters */
-       process_monsters_counters();
-
+               else if (p_ptr->cut > 10)
+               {
+                       dam = 3;
+               }
 
-       /*** Damage over Time ***/
+               /* Other cuts */
+               else
+               {
+                       dam = 1;
+               }
 
-       /* Take damage from poison */
-       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, dam, _("致命傷", "a fatal wound"), -1);
        }
 
 
@@ -2228,16 +1610,11 @@ if (cheat_xtra) msg_print("
        {
                if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
                {
-                       if (cave[py][px].info & 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;
                        }
@@ -2251,115 +1628,67 @@ take_hit(DAMAGE_NOESCAPE, 1, "
                        char ouch [MAX_NLEN+40];
 
                        /* Get an object description */
-                       object_desc(o_name, o_ptr, FALSE, 0);
-
-#ifdef JP
-msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤­¾Ç¤¬¤·¤¿¡ª", o_name);
-#else
-                       msg_format("The %s scorches your undead flesh!", o_name);
-#endif
-
+                       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                       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, TRUE, 0);
-
-#ifdef JP
-sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
-#else
-                       sprintf(ouch, "wielding %s", o_name);
-#endif
+                       object_desc(o_name, o_ptr, OD_NAME_ONLY);
+                       sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name);
 
                        if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
                }
        }
 
-       if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
-               !IS_INVULN() && !p_ptr->immune_fire && !p_ptr->ffall)
+       if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !p_ptr->immune_fire)
        {
-               int damage = 3000 + randint0(2000);
+               int damage = 0;
 
-               if (prace_is_(RACE_ENT)) damage += damage/3;
-               if (p_ptr->resist_fire) damage = damage / 3;
-               if (IS_OPPOSE_FIRE()) damage = damage / 3;
-               damage = damage / 100 + (randint0(100) < (damage % 100));
+               if (have_flag(f_ptr->flags, FF_DEEP))
+               {
+                       damage = 6000 + randint0(4000);
+               }
+               else if (!p_ptr->levitation)
+               {
+                       damage = 3000 + randint0(2000);
+               }
 
                if (damage)
                {
-                       /* Take damage */
-#ifdef JP
-msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
-take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
-#else
-                       msg_print("The lava burns you!");
-                       take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
-#endif
+                       if (prace_is_(RACE_ENT)) damage += damage / 3;
+                       if (p_ptr->resist_fire) damage = damage / 3;
+                       if (IS_OPPOSE_FIRE()) damage = damage / 3;
+
+                       if (p_ptr->levitation) damage = damage / 5;
+
+                       damage = damage / 100 + (randint0(100) < (damage % 100));
+
+                       if (p_ptr->levitation)
+                       {
+                               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[p_ptr->y][p_ptr->x])].name;
+                               msg_format(_("%sで火傷した!", "The %s burns you!"), name);
+                               take_hit(DAMAGE_NOESCAPE, damage, name, -1);
+                       }
 
                        cave_no_regen = TRUE;
                }
        }
 
-       else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
-               !IS_INVULN() && !p_ptr->immune_fire)
+       if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
+           !p_ptr->levitation && !p_ptr->can_swim)
        {
-               int damage = 6000 + randint0(4000);
-
-               cptr message;
-               cptr hit_from;
-
-               if (p_ptr->resist_fire) damage = damage / 3;
-               if (IS_OPPOSE_FIRE()) damage = damage / 3;
-
-               if (p_ptr->ffall)
-               {
-                       damage = damage / 5;
-
-#ifdef JP
-message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
-hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
-#else
-                       message = "The heat burns you!";
-                       hit_from = "flying over deep lava";
-#endif
-
-               }
-               else
-               {
-#ifdef JP
-message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
-hit_from = "¿¼¤¤ÍÏ´äή";
-#else
-                       message = "The lava burns you!";
-                       hit_from = "deep lava";
-#endif
-
-               }
-
-               damage = damage / 100 + (randint0(100) < (damage % 100));
-               if (damage)
-               {
-                       /* Take damage */
-                       msg_print(message);
-                       take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
-
-                       cave_no_regen = TRUE;
-               }
-       }
-
-       else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
-       {
-               if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
+               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;
                }
        }
@@ -2373,13 +1702,8 @@ take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Ů
                        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)
                {
@@ -2387,26 +1711,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);
                }
        }
 
@@ -2417,14 +1731,9 @@ take_hit(DAMAGE_NOESCAPE, damage, "
         * reduced below 0 hp by being inside a stone wall; others
         * WILL BE!
         */
-       if (!cave_floor_bold(py, px))
+       if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
        {
-               /* Player can walk through trees */
-               if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
-               {
-                       /* Do nothing */
-               }
-               else if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke &&
+               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke &&
                    ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
                {
                        cptr dam_desc;
@@ -2433,250 +1742,21 @@ 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);
                }
        }
 
-       if (!hour && !min)
-       {
-               monster_race *r_ptr;
-
-               if (min != prev_min)
-               {
-                       int max_dl = 3;
-                       bool old_inside_battle = p_ptr->inside_battle;
-
-                       do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
-
-                       p_ptr->inside_battle = TRUE;
-                       get_mon_num_prep(NULL,NULL);
-
-                       for (i = 0; i < max_d_idx; i++)
-                       {
-                               if (max_dlv[i] < d_info[i].mindepth) continue;
-                               if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
-                       }
-                       while (1)
-                       {
-                               today_mon = get_mon_num(max_dl);
-                               r_ptr = &r_info[today_mon];
-
-                               if (r_ptr->flags1 & RF1_UNIQUE) continue;
-                               if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
-                               if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
-                               if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
-                               if (r_ptr->level < MIN(max_dl/2, 40)) continue;
-                               if (r_ptr->rarity > 10) continue;
-                               if (r_ptr->level == 0) continue;
-                               break;
-                       }
-                       p_ptr->today_mon = 0;
-                       p_ptr->inside_battle = old_inside_battle;
-               }
-       }
-
-       /* Nightmare mode activates the TY_CURSE at midnight */
-       if (ironman_nightmare)
-       {
-               /* Require exact minute */
-               if (min != prev_min)
-               {
-                       /* Every 15 minutes after 11:00 pm */
-                       if ((hour == 23) && !(min % 15))
-                       {
-                               /* Disturbing */
-                               disturb(0, 0);
-
-                               switch (min / 15)
-                               {
-                                       case 0:
-                                       {
-#ifdef JP
-msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
-#else
-                                               msg_print("You hear a distant bell toll ominously.");
-#endif
-
-                                               break;
-                                       }
-                                       case 1:
-                                       {
-#ifdef JP
-msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
-#else
-                                               msg_print("A distant bell sounds twice.");
-#endif
-
-                                               break;
-                                       }
-                                       case 2:
-       {
-#ifdef JP
-msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
-#else
-                                               msg_print("A distant bell sounds three times.");
-#endif
-
-                                               break;
-                                       }
-                                       case 3:
-                                       {
-#ifdef JP
-msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
-#else
-                                               msg_print("A distant bell tolls four times.");
-#endif
-
-                                               break;
-                                       }
-                               }
-                       }
-
-                       /* TY_CURSE activates at mignight! */
-                       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
-
-               activate_ty_curse(FALSE, &count);
-       }
-               }
-       }
-
-       /* Take damage from cuts */
-       if (p_ptr->cut && !IS_INVULN())
-       {
-               /* Mortal wound or Deep Gash */
-               if (p_ptr->cut > 1000)
-               {
-                       i = 200;
-               }
-
-               else if (p_ptr->cut > 200)
-               {
-                       i = 80;
-               }
-
-               /* Severe cut */
-               else if (p_ptr->cut > 100)
-               {
-                       i = 32;
-               }
-
-               else if (p_ptr->cut > 50)
-               {
-                       i = 16;
-               }
-
-               else if (p_ptr->cut > 25)
-               {
-                       i = 7;
-               }
-
-               else if (p_ptr->cut > 10)
-               {
-                       i = 3;
-               }
-
-               /* Other cuts */
-               else
-               {
-                       i = 1;
-               }
-
-               /* Take damage */
-#ifdef JP
-take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
-#else
-               take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
-#endif
-
-       }
-
-
-       /*** Check the Food, and Regenerate ***/
-
-       if (!p_ptr->inside_battle)
-       {
-               /* Digest normally */
-               if (p_ptr->food < PY_FOOD_MAX)
-               {
-                       /* Every 50 game turns */
-                       if (!(turn % (TURNS_PER_TICK*5)))
-                       {
-                               /* Basic digestion rate based on speed */
-                               i = SPEED_TO_ENERGY(p_ptr->pspeed);
-
-                               /* Regeneration takes more food */
-                               if (p_ptr->regenerate) i += 20;
-                               if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
-                               if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
-
-                               /* Slow digestion takes less food */
-                               if (p_ptr->slow_digest) i -= 5;
-
-                               /* Minimal digestion */
-                               if (i < 1) i = 1;
-                               /* Maximal digestion */
-                               if (i > 100) i = 100;
-
-                               /* Digest some food */
-                               (void)set_food(p_ptr->food - i);
-                       }
-               }
-
-               /* Digest quickly when gorged */
-               else
-               {
-                       /* Digest a lot of food */
-                       (void)set_food(p_ptr->food - 100);
-               }
-       }
-
-       /* Starve to death (slowly) */
-       if (p_ptr->food < PY_FOOD_STARVE)
-       {
-               /* Calculate damage */
-               i = (PY_FOOD_STARVE - p_ptr->food) / 10;
-
-               /* Take damage */
-#ifdef JP
-               if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
-#else
-               if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
-#endif
-
-       }
 
-       /* Default regeneration */
-       regen_amount = PY_REGEN_NORMAL;
+       /*** handle regeneration ***/
 
        /* Getting Weak */
        if (p_ptr->food < PY_FOOD_WEAK)
@@ -2694,29 +1774,8 @@ take_hit(DAMAGE_NOESCAPE, i, "
                {
                        regen_amount = PY_REGEN_WEAK;
                }
-
-               /* Getting Faint */
-               if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
-               {
-                       /* Faint occasionally */
-                       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);
-
-                               /* Hack -- faint (bypass free action) */
-                               (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
-                       }
-               }
        }
 
-
        /* Are we walking the pattern? */
        if (pattern_effect())
        {
@@ -2748,33 +1807,19 @@ msg_print("
 
        upkeep_factor = calculate_upkeep();
 
-       /* Regenerate the mana */
-/*     if (p_ptr->csp < p_ptr->msp) */
+       /* No regeneration while special action */
+       if ((p_ptr->action == ACTION_LEARN) ||
+           (p_ptr->action == ACTION_HAYAGAKE) ||
+           (p_ptr->special_defense & KATA_KOUKIJIN))
        {
-               if (upkeep_factor)
-               {
-                       s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
-                       if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
-                       regenmana(upkeep_regen/100);
+               upkeep_factor += 100;
+       }
 
-#ifdef TRACK_FRIENDS
-                       if (p_ptr->wizard)
-                       {
-#ifdef JP
-msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
-#else
-                               msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
-#endif
+       /* Regenerate the mana */
+       regenmana(upkeep_factor, regen_amount);
 
-                       }
-#endif /* TRACK_FRIENDS */
 
-               }
-               else if (p_ptr->action != ACTION_LEARN)
-               {
-                       regenmana(regen_amount);
-               }
-       }
+       /* Recharge magic eater's power */
        if (p_ptr->pclass == CLASS_MAGIC_EATER)
        {
                regenmagic(regen_amount);
@@ -2784,21 +1829,13 @@ msg_format("
        {
                while (upkeep_factor > 100)
                {
-#ifdef JP
-msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤­¤Ê¤¤¡ª");
-#else
-                       msg_print("Such much pets cannot be controled 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(_("維持MPは %d%%", "Upkeep: %d%% mana."), upkeep_factor);
                        msg_print(NULL);
                }
        }
@@ -2815,17 +1852,18 @@ msg_print("
        /* Regenerate Hit Points if needed */
        if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
        {
-               if ((cave[py][px].feat < FEAT_PATTERN_END) &&
-                   (cave[py][px].feat >= FEAT_PATTERN_START))
-               {
-                       regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
-               }
-               else
-               {
-                       regenhp(regen_amount);
-               }
+               regenhp(regen_amount);
        }
+}
 
+/*!
+ * @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理
+ * / Handle timeout every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_timeout(void)
+{
+       const int dec_count = (easy_band ? 2 : 1);
 
        /*** Timeout Various Things ***/
 
@@ -2895,9 +1933,9 @@ msg_print("
        }
 
        /* Timed levitation */
-       if (p_ptr->tim_ffall)
+       if (p_ptr->tim_levitation)
        {
-               (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
+               (void)set_tim_levitation(p_ptr->tim_levitation - 1, TRUE);
        }
 
        /* Timed sh_touki */
@@ -3128,19 +2166,24 @@ msg_print("
                /* Apply some healing */
                (void)set_cut(p_ptr->cut - adjust);
        }
+}
 
 
-
-       /*** Process Light ***/
-
+/*!
+ * @brief 10ゲームターンが進行する毎に光源の寿命を減らす処理
+ * / Handle burning fuel every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_light(void)
+{
        /* Check for light being wielded */
-       o_ptr = &inventory[INVEN_LITE];
+       object_type *o_ptr = &inventory[INVEN_LITE];
 
        /* Burn some fuel in the current lite */
        if (o_ptr->tval == TV_LITE)
        {
                /* Hack -- Use some fuel (except on artifacts) */
-               if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
+               if (!(object_is_fixed_artifact(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
                {
                        /* Decrease life-span */
                        if (o_ptr->name2 == EGO_LITE_LONG)
@@ -3153,619 +2196,491 @@ msg_print("
                        notice_lite_change(o_ptr);
                }
        }
+}
+
+
+/*!
+ * @brief 10ゲームターンが進行するごとに突然変異の発動判定を行う処理
+ * / Handle mutation effects once every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_mutation(void)
+{
+       /* No mutation with effects */
+       if (!p_ptr->muta2) return;
 
-       /* Calculate torch radius */
-       p_ptr->update |= (PU_TORCH);
+       /* No effect on monster arena */
+       if (p_ptr->inside_battle) return;
 
+       /* No effect on the global map */
+       if (p_ptr->wild_mode) return;
 
-       /*** Process mutation effects ***/
-       if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
+
+       if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
        {
-               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_shero(10 + randint1(p_ptr->lev), FALSE);
+               (void)set_afraid(0);
+       }
+
+       if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
+       {
+               if (!p_ptr->resist_fear)
+               {
+                       disturb(0, 1);
+                       msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
+                       set_afraid(p_ptr->afraid + 13 + randint1(26));
                }
+       }
 
-               if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
+       if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
+       {
+               if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
+                   !p_ptr->anti_tele)
                {
-                       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);
 
-                               set_afraid(p_ptr->afraid + 13 + randint1(26));
-                       }
+                       /* Teleport player */
+                       msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
+                       msg_print(NULL);
+                       teleport_player(40, TELEPORT_PASSIVE);
                }
+       }
 
-               if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
+       if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
+       {
+               if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
                {
-                       if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
-                           !p_ptr->anti_tele)
-                       {
-                               disturb(0, 0);
-
-                               /* Teleport player */
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
-#else
-                               msg_print("Your position suddenly seems very uncertain...");
-#endif
-
-                               msg_print(NULL);
-                               teleport_player(40);
-                       }
+                       disturb(0, 1);
+                       p_ptr->redraw |= PR_EXTRA;
+                       msg_print(_("いひきがもーろーとひてきたきがふる...ヒック!", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!"));
                }
 
-               if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
+               if (!p_ptr->resist_conf)
                {
-                       if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
-                       {
-                               disturb(0, 0);
-                               p_ptr->redraw |= PR_EXTRA;
-#ifdef JP
-msg_print("¤¤¤Ò¤­¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤­¤¿¤­¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
-#else
-                               msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
-#endif
-
-                       }
+                       (void)set_confused(p_ptr->confused + randint0(20) + 15);
+               }
 
-                       if (!p_ptr->resist_conf)
+               if (!p_ptr->resist_chaos)
+               {
+                       if (one_in_(20))
                        {
-                               (void)set_confused(p_ptr->confused + randint0(20) + 15);
+                               msg_print(NULL);
+                               if (one_in_(3)) lose_all_info();
+                               else wiz_dark();
+                               (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+                               wiz_dark();
+                               msg_print(_("あなたは見知らぬ場所で目が醒めた...頭が痛い。", "You wake up somewhere with a sore head..."));
+                               msg_print(_("何も覚えていない。どうやってここに来たかも分からない!", "You can't remember a thing, or how you got here!"));
                        }
-
-                       if (!p_ptr->resist_chaos)
+                       else
                        {
-                               if (one_in_(20))
-                               {
-                                       msg_print(NULL);
-                                       if (one_in_(3)) lose_all_info();
-                                       else wiz_dark();
-                                       teleport_player(100);
-                                       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
-
-                               }
-                               else
+                               if (one_in_(3))
                                {
-                                       if (one_in_(3))
-                                       {
-#ifdef JP
-msg_print("¤­¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
-#else
-                                               msg_print("Thishcischs GooDSChtuff!");
-#endif
-
-                                               (void)set_image(p_ptr->image + randint0(150) + 150);
-                                       }
+                                       msg_print(_("き~れいなちょおちょらとんれいる~", "Thishcischs GooDSChtuff!"));
+                                       (void)set_image(p_ptr->image + randint0(150) + 150);
                                }
                        }
                }
+       }
 
-               if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
+       if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
+       {
+               if (!p_ptr->resist_chaos)
                {
-                       if (!p_ptr->resist_chaos)
-                       {
-                               disturb(0, 0);
-                               p_ptr->redraw |= PR_EXTRA;
-                               (void)set_image(p_ptr->image + randint0(50) + 20);
-                       }
+                       disturb(0, 1);
+                       p_ptr->redraw |= PR_EXTRA;
+                       (void)set_image(p_ptr->image + randint0(50) + 20);
                }
+       }
 
-               if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
-               {
-                       disturb(0, 0);
+       if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
+       {
+               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);
-               }
+               msg_print(NULL);
+               fire_ball(GF_POIS, 0, p_ptr->lev, 3);
+       }
 
-               if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
-                   !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
+       if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
+           !p_ptr->anti_magic && one_in_(9000))
+       {
+               int dire = 0;
+               disturb(0, 1);
+               msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!", 
+                                               "Magical energy flows through you! You must release it!"));
 
-                       flush();
-                       msg_print(NULL);
-                       (void)get_hack_dir(&dire);
-                       fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
-               }
+               flush();
+               msg_print(NULL);
+               (void)get_hack_dir(&dire);
+               fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
+       }
 
-               if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
-                   !p_ptr->anti_magic && (randint1(6666) == 666))
-               {
-                       bool pet = one_in_(6);
-                       u32b mode = PM_ALLOW_GROUP;
+       if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
+           !p_ptr->anti_magic && (randint1(6666) == 666))
+       {
+               bool pet = one_in_(6);
+               BIT_FLAGS mode = PM_ALLOW_GROUP;
 
-                       if (pet) mode |= PM_FORCE_PET;
-                       else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
+               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))
+       if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
+       {
+               disturb(0, 1);
+               if (one_in_(2))
                {
-                       disturb(0, 0);
-                       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)
-                               {
-                                       set_fast(0, TRUE);
-                               }
-                               else
-                               {
-                                       set_slow(randint1(30) + 10, FALSE);
-                               }
+                       if (p_ptr->fast > 0)
+                       {
+                               set_fast(0, TRUE);
                        }
                        else
                        {
-#ifdef JP
-msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
-#else
-                               msg_print("You feel more energetic.");
-#endif
-
-                               if (p_ptr->slow > 0)
-                               {
-                                       set_slow(0, TRUE);
-                               }
-                               else
-                               {
-                                       set_fast(randint1(30) + 10, FALSE);
-                               }
+                               set_slow(randint1(30) + 10, FALSE);
                        }
-                       msg_print(NULL);
                }
-               if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
+               else
                {
-                       disturb(0, 0);
-#ifdef JP
-msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
-#else
-                       msg_print("You suddenly feel almost lonely.");
-#endif
+                       msg_print(_("精力的になった気がする。", "You feel more energetic."));
 
-                       banish_monsters(100);
-                       if (!dun_level && p_ptr->town_num)
+                       if (p_ptr->slow > 0)
                        {
-#ifdef JP
-msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
-#else
-                               msg_print("You see one of the shopkeepers running for the hills!");
-#endif
-
-                               store_shuffle(randint0(MAX_STORES));
+                               set_slow(0, TRUE);
+                       }
+                       else
+                       {
+                               set_fast(randint1(30) + 10, FALSE);
                        }
-                       msg_print(NULL);
                }
+               msg_print(NULL);
+       }
+       if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
+       {
+               disturb(0, 1);
+               msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
 
-               if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
+               banish_monsters(100);
+               if (!dun_level && p_ptr->town_num)
                {
-                       object_type *o_ptr;
-
-#ifdef JP
-msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
-#else
-                       msg_print("A shadow passes over you.");
-#endif
-
-                       msg_print(NULL);
+                       int n;
 
-                       /* Absorb light from the current possition */
-                       if (cave[py][px].info & CAVE_GLOW)
+                       /* Pick a random shop (except home) */
+                       do
                        {
-                               hp_player(10);
+                               n = randint0(MAX_STORES);
                        }
+                       while ((n == STORE_HOME) || (n == STORE_MUSEUM));
 
-                       o_ptr = &inventory[INVEN_LITE];
+                       msg_print(_("店の主人が丘に向かって走っている!", "You see one of the shopkeepers running for the hills!"));
+                       store_shuffle(n);
+               }
+               msg_print(NULL);
+       }
 
-                       /* Absorb some fuel in the current lite */
-                       if (o_ptr->tval == TV_LITE)
-                       {
-                               /* Use some fuel (except on artifacts) */
-                               if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
-                               {
-                                       /* Heal the player a bit */
-                                       hp_player(o_ptr->xtra4 / 20);
+       if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
+       {
+               object_type *o_ptr;
 
-                                       /* Decrease life-span of lite */
-                                       o_ptr->xtra4 /= 2;
+               msg_print(_("影につつまれた。", "A shadow passes over you."));
+               msg_print(NULL);
 
-#ifdef JP
-msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
-#else
-                                       msg_print("You absorb energy from your light!");
-#endif
+               /* Absorb light from the current possition */
+               if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+               {
+                       hp_player(10);
+               }
 
+               o_ptr = &inventory[INVEN_LITE];
 
-                                       /* Notice interesting fuel steps */
-                                       notice_lite_change(o_ptr);
-                               }
-                       }
+               /* Absorb some fuel in the current lite */
+               if (o_ptr->tval == TV_LITE)
+               {
+                       /* Use some fuel (except on artifacts) */
+                       if (!object_is_fixed_artifact(o_ptr) && (o_ptr->xtra4 > 0))
+                       {
+                               /* Heal the player a bit */
+                               hp_player(o_ptr->xtra4 / 20);
 
-                       /*
-                        * Unlite the area (radius 10) around player and
-                        * do 50 points damage to every affected monster
-                        */
-                       unlite_area(50, 10);
+                               /* Decrease life-span of lite */
+                               o_ptr->xtra4 /= 2;
+                               msg_print(_("光源からエネルギーを吸収した!", "You absorb energy from your light!"));
+
+                               /* Notice interesting fuel steps */
+                               notice_lite_change(o_ptr);
+                       }
                }
 
-               if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
-                  !p_ptr->anti_magic && one_in_(7000))
-               {
-                       bool pet = one_in_(3);
-                       u32b mode = PM_ALLOW_GROUP;
+               /*
+                * Unlite the area (radius 10) around player and
+                * do 50 points damage to every affected monster
+                */
+               unlite_area(50, 10);
+       }
 
-                       if (pet) mode |= PM_FORCE_PET;
-                       else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
+       if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
+           !p_ptr->anti_magic && one_in_(7000))
+       {
+               bool pet = one_in_(3);
+               BIT_FLAGS mode = PM_ALLOW_GROUP;
 
-                       if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode))
-                       {
-#ifdef JP
-msg_print("ưʪ¤ò°ú¤­´ó¤»¤¿¡ª");
-#else
-                               msg_print("You have attracted an animal!");
-#endif
+               if (pet) mode |= PM_FORCE_PET;
+               else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-                               disturb(0, 0);
-                       }
+               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_ANIMAL, mode))
+               {
+                       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, 1);
+               msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
+
+               msg_print(NULL);
+               fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
+       }
+       if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
+       {
+               if (!lose_mutation(0))
+                       msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
+       }
+       if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
+       {
+               disturb(0, 1);
+               msg_print(_("非物質化した!", "You feel insubstantial!"));
+
+               msg_print(NULL);
+               set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
+       }
+       if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
+       {
+               do_poly_wounds();
+       }
+       if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
+       {
+               int which_stat = randint0(6);
+               int sustained = FALSE;
 
-               if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
-                   !p_ptr->anti_magic && one_in_(8000))
+               switch (which_stat)
                {
-                       disturb(0, 0);
-#ifdef JP
-msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
-#else
-                       msg_print("You feel the world warping around you!");
-#endif
+               case A_STR:
+                       if (p_ptr->sustain_str) sustained = TRUE;
+                       break;
+               case A_INT:
+                       if (p_ptr->sustain_int) sustained = TRUE;
+                       break;
+               case A_WIS:
+                       if (p_ptr->sustain_wis) sustained = TRUE;
+                       break;
+               case A_DEX:
+                       if (p_ptr->sustain_dex) sustained = TRUE;
+                       break;
+               case A_CON:
+                       if (p_ptr->sustain_con) sustained = TRUE;
+                       break;
+               case A_CHR:
+                       if (p_ptr->sustain_chr) sustained = TRUE;
+                       break;
+               default:
+                       msg_print(_("不正な状態!", "Invalid stat chosen!"));
+                       sustained = TRUE;
+               }
 
+               if (!sustained)
+               {
+                       disturb(0, 1);
+                       msg_print(_("自分が衰弱していくのが分かる!", "You can feel yourself wasting away!"));
                        msg_print(NULL);
-                       fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
+                       (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
                }
-               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
+       }
+       if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
+           !p_ptr->anti_magic && one_in_(3000))
+       {
+               bool pet = one_in_(5);
+               BIT_FLAGS mode = PM_ALLOW_GROUP;
 
-               }
-               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
+               if (pet) mode |= PM_FORCE_PET;
+               else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-                       msg_print(NULL);
-                       set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
+               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DRAGON, mode))
+               {
+                       msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
+                       disturb(0, 1);
                }
-               if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
+       }
+       if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
+           one_in_(3000))
+       {
+               if (p_ptr->tim_esp > 0)
                {
-                       do_poly_wounds();
+                       msg_print(_("精神にもやがかかった!", "Your mind feels cloudy!"));
+                       set_tim_esp(0, TRUE);
                }
-               if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
+               else
                {
-                       int which_stat = randint0(6);
-                       int sustained = FALSE;
+                       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, 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();
+               if (hex_spelling_any()) stop_hex_spell_all();
+       }
 
-                       switch (which_stat)
-                       {
-                       case A_STR:
-                               if (p_ptr->sustain_str) sustained = TRUE;
-                               break;
-                       case A_INT:
-                               if (p_ptr->sustain_int) sustained = TRUE;
-                               break;
-                       case A_WIS:
-                               if (p_ptr->sustain_wis) sustained = TRUE;
-                               break;
-                       case A_DEX:
-                               if (p_ptr->sustain_dex) sustained = TRUE;
-                               break;
-                       case A_CON:
-                               if (p_ptr->sustain_con) sustained = TRUE;
-                               break;
-                       case A_CHR:
-                               if (p_ptr->sustain_chr) sustained = TRUE;
-                               break;
-                       default:
-#ifdef JP
-msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
-#else
-                               msg_print("Invalid stat chosen!");
-#endif
+       if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
+           !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
+       {
+               alter_reality();
+       }
 
-                               sustained = TRUE;
-                       }
+       if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
+       {
+               int danger_amount = 0;
+               int monster;
 
-                       if (!sustained)
-                       {
-                               disturb(0, 0);
-#ifdef JP
-msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
-#else
-                               msg_print("You can feel yourself wasting away!");
-#endif
+               for (monster = 0; monster < m_max; monster++)
+               {
+                       monster_type    *m_ptr = &m_list[monster];
+                       monster_race    *r_ptr = &r_info[m_ptr->r_idx];
 
-                               msg_print(NULL);
-                               (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
+                       /* Paranoia -- Skip dead monsters */
+                       if (!m_ptr->r_idx) continue;
+
+                       if (r_ptr->level >= p_ptr->lev)
+                       {
+                               danger_amount += r_ptr->level - p_ptr->lev + 1;
                        }
                }
-               if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
-                  !p_ptr->anti_magic && one_in_(3000))
-               {
-                       bool pet = one_in_(5);
-                       u32b mode = PM_ALLOW_GROUP;
 
-                       if (pet) mode |= PM_FORCE_PET;
-                       else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
+               if (danger_amount > 100)
+                       msg_print(_("非常に恐ろしい気がする!", "You feel utterly terrified!"));
+               else if (danger_amount > 50)
+                       msg_print(_("恐ろしい気がする!", "You feel terrified!"));
+               else if (danger_amount > 20)
+                       msg_print(_("非常に心配な気がする!", "You feel very worried!"));
+               else if (danger_amount > 10)
+                       msg_print(_("心配な気がする!", "You feel paranoid!"));
+               else if (danger_amount > 5)
+                       msg_print(_("ほとんど安全な気がする。", "You feel almost safe."));
+               else
+                       msg_print(_("寂しい気がする。", "You feel lonely."));
+       }
+       if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
+           one_in_(5000))
+       {
+               disturb(0, 1);
+               msg_print(_("無敵な気がする!", "You feel invincible!"));
+               msg_print(NULL);
+               (void)set_invuln(randint1(8) + 8, FALSE);
+       }
+       if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
+       {
+               int wounds = p_ptr->mhp - p_ptr->chp;
+
+               if (wounds > 0)
+               {
+                       int healing = p_ptr->csp;
 
-                       if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode))
+                       if (healing > wounds)
                        {
-#ifdef JP
-msg_print("¥É¥é¥´¥ó¤ò°ú¤­´ó¤»¤¿¡ª");
-#else
-                               msg_print("You have attracted a dragon!");
-#endif
-
-                               disturb(0, 0);
+                               healing = wounds;
                        }
+
+                       hp_player(healing);
+                       p_ptr->csp -= healing;
+
+                       /* Redraw mana */
+                       p_ptr->redraw |= (PR_MANA);
                }
-               if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
-                       one_in_(3000))
+       }
+       if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
+           one_in_(4000))
+       {
+               int wounds = p_ptr->msp - p_ptr->csp;
+
+               if (wounds > 0)
                {
-                       if (p_ptr->tim_esp > 0)
-                       {
-#ifdef JP
-msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
-#else
-                               msg_print("Your mind feels cloudy!");
-#endif
+                       int healing = p_ptr->chp;
 
-                               set_tim_esp(0, TRUE);
-                       }
-                       else
+                       if (healing > wounds)
                        {
-#ifdef JP
-msg_print("Àº¿À¤¬¹­¤¬¤Ã¤¿¡ª");
-#else
-                               msg_print("Your mind expands!");
-#endif
-
-                               set_tim_esp(p_ptr->lev, FALSE);
+                               healing = wounds;
                        }
+
+                       p_ptr->csp += healing;
+
+                       /* Redraw mana */
+                       p_ptr->redraw |= (PR_MANA);
+                       take_hit(DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
                }
-               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
-
-                       msg_print(NULL);
-                       set_food(PY_FOOD_WEAK);
-               }
+       }
+       if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
+       {
+               INVENTORY_IDX slot = 0;
+               object_type *o_ptr = NULL;
 
-               if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
-                  !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
-               {
-                       alter_reality();
-               }
+               disturb(0, 1);
+               msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
+               take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
 
-               if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
+               msg_print(NULL);
+               if (buki_motteruka(INVEN_RARM))
                {
-                       int danger_amount = 0;
-                       int monster;
+                       slot = INVEN_RARM;
+                       o_ptr = &inventory[INVEN_RARM];
 
-                       for (monster = 0; monster < m_max; monster++)
+                       if (buki_motteruka(INVEN_LARM) && one_in_(2))
                        {
-                               monster_type    *m_ptr = &m_list[monster];
-                               monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-
-                               /* Paranoia -- Skip dead monsters */
-                               if (!m_ptr->r_idx) continue;
-
-                               if (r_ptr->level >= p_ptr->lev)
-                               {
-                                       danger_amount += r_ptr->level - p_ptr->lev + 1;
-                               }
+                               o_ptr = &inventory[INVEN_LARM];
+                               slot = INVEN_LARM;
                        }
-
-                       if (danger_amount > 100)
-#ifdef JP
-msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
-#else
-                               msg_print("You feel utterly terrified!");
-#endif
-
-                       else if (danger_amount > 50)
-#ifdef JP
-msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
-#else
-                               msg_print("You feel terrified!");
-#endif
-
-                       else if (danger_amount > 20)
-#ifdef JP
-msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
-#else
-                               msg_print("You feel very worried!");
-#endif
-
-                       else if (danger_amount > 10)
-#ifdef JP
-msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
-#else
-                               msg_print("You feel paranoid!");
-#endif
-
-                       else if (danger_amount > 5)
-#ifdef JP
-msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
-#else
-                               msg_print("You feel almost safe.");
-#endif
-
-                       else
-#ifdef JP
-msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
-#else
-                               msg_print("You feel lonely.");
-#endif
-
-               }
-               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
-
-                       msg_print(NULL);
-                       (void)set_invuln(randint1(8) + 8, FALSE);
                }
-               if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
+               else if (buki_motteruka(INVEN_LARM))
                {
-                       int wounds = p_ptr->mhp - p_ptr->chp;
-
-                       if (wounds > 0)
-                       {
-                               int healing = p_ptr->csp;
-
-                               if (healing > wounds)
-                               {
-                                       healing = wounds;
-                               }
-
-                               hp_player(healing);
-                               p_ptr->csp -= healing;
-                       }
+                       o_ptr = &inventory[INVEN_LARM];
+                       slot = INVEN_LARM;
                }
-               if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
-                       one_in_(4000))
-               {
-                       int wounds = p_ptr->msp - p_ptr->csp;
-
-                       if (wounds > 0)
-                       {
-                               int healing = p_ptr->chp;
-
-                               if (healing > wounds)
-                               {
-                                       healing = wounds;
-                               }
 
-                               p_ptr->csp += healing;
-#ifdef JP
-take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
-#else
-                               take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
-#endif
-
-                       }
-               }
-               if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
+               if (slot && !object_is_cursed(o_ptr))
                {
-                       object_type *o_ptr;
-
-                       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
-
-
-                       msg_print(NULL);
-                       if (buki_motteruka(INVEN_RARM))
-                       {
-                               int slot = INVEN_RARM;
-                               o_ptr = &inventory[INVEN_RARM];
-                               if (buki_motteruka(INVEN_LARM) && one_in_(2))
-                               {
-                                       o_ptr = &inventory[INVEN_LARM];
-                                       slot = INVEN_LARM;
-                               }
-                               if (!cursed_p(o_ptr))
-                               {
-#ifdef JP
-msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
-#else
-                                       msg_print("You drop your weapon!");
-#endif
-
-                                       inven_drop(slot, 1);
-                               }
-                       }
+                       msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
+                       inven_drop(slot, 1);
                }
        }
+}
 
-
-       /*** Process Inventory ***/
-
+/*!
+ * @brief 10ゲームターンが進行するごとに装備効果の発動判定を行う処理
+ * / Handle curse effects once every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_curse(void)
+{
        if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->inside_battle && !p_ptr->wild_mode)
        {
                /*
@@ -3774,25 +2689,53 @@ msg_print("
                 */
                if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
                {
-#ifdef JP
-if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
-#else
-                       if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
-#endif
+                       char o_name[MAX_NLEN];
+                       object_type *o_ptr;
+                       int i, i_keep = 0, count = 0;
+
+                       /* Scan the equipment with random teleport ability */
+                       for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
+                       {
+                               u32b flgs[TR_FLAG_SIZE];
+                               o_ptr = &inventory[i];
+
+                               /* Skip non-objects */
+                               if (!o_ptr->k_idx) continue;
+
+                               /* Extract the item flags */
+                               object_flags(o_ptr, flgs);
+
+                               if (have_flag(flgs, TR_TELEPORT))
+                               {
+                                       /* {.} will stop random teleportation. */
+                                       if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '.'))
+                                       {
+                                               count++;
+                                               if (one_in_(count)) i_keep = i;
+                                       }
+                               }
+                       }
+
+                       o_ptr = &inventory[i_keep];
+                       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                       msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name);
+                       if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
+                       {
+                               disturb(0, 1);
+                               teleport_player(50, 0L);
+                       }
+                       else
                        {
-                               disturb(0, 0);
-                               teleport_player(50);
+                               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);
                }
@@ -3825,14 +2768,10 @@ if (!get_rnd_line("chainswd_j.txt", 0, noise))
                        {
                                char o_name[MAX_NLEN];
 
-                               object_desc(o_name, o_ptr, FALSE, 0);
+                               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 %s...", o_name);
-#endif
+                               msg_format(_("悪意に満ちた黒いオーラが%sをとりまいた...", "There is a malignant black aura surrounding your %s..."), o_name);
 
                                o_ptr->feeling = FEEL_NONE;
 
@@ -3852,15 +2791,10 @@ msg_format("
                        {
                                char o_name[MAX_NLEN];
 
-                               object_desc(o_name, o_ptr, FALSE, 0);
+                               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 %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);
@@ -3869,102 +2803,87 @@ msg_format("
                /* 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), FALSE, 0);
-#ifdef JP
-msg_format("%s¤¬Æ°Êª¤ò°ú¤­´ó¤»¤¿¡ª", o_name);
-#else
-                               msg_format("%s have attracted an animal!", o_name);
-#endif
-
-                               disturb(0, 0);
+                               object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                               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), FALSE, 0);
-#ifdef JP
-msg_format("%s¤¬°­Ëâ¤ò°ú¤­´ó¤»¤¿¡ª", o_name);
-#else
-                               msg_format("%s have attracted a demon!", o_name);
-#endif
-
-                               disturb(0, 0);
+                               object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                               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), FALSE, 0);
-#ifdef JP
-msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤­´ó¤»¤¿¡ª", o_name);
-#else
-                               msg_format("%s have attracted an animal!", o_name);
-#endif
+                               object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                               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_player(40, TELEPORT_PASSIVE);
                }
                /* Handle HP draining */
                if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
                {
                        char o_name[MAX_NLEN];
 
-                       object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
-#ifdef JP
-msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
-#else
-                       msg_format("%s drains HP from you!", o_name);
-#endif
+                       object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                       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 */
-               if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
+               if ((p_ptr->cursed & TRC_DRAIN_MANA) && p_ptr->csp && one_in_(666))
                {
                        char o_name[MAX_NLEN];
 
-                       object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
-#ifdef JP
-msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
-#else
-                       msg_format("%s drains mana from you!", o_name);
-#endif
+                       object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), (OD_OMIT_PREFIX | OD_NAME_ONLY));
+                       msg_format(_("%sはあなたの魔力を吸収した!", "Your %s drains mana from you!"), o_name);
                        p_ptr->csp -= MIN(p_ptr->lev, 50);
                        if (p_ptr->csp < 0)
                        {
@@ -3983,13 +2902,13 @@ msg_format("%s
                if (o_ptr->name1 == ART_JUDGE)
                {
 #ifdef JP
-                       if (object_known_p(o_ptr))
-                               msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
+                       if (object_is_known(o_ptr))
+                               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_known_p(o_ptr))
+                       if (object_is_known(o_ptr))
                                msg_print("The Jewel of Judgement drains life from you!");
                        else
                                msg_print("Something drains life from you!");
@@ -3997,13 +2916,24 @@ msg_format("%s
 #endif
                }
        }
+}
 
 
+/*!
+ * @brief 10ゲームターンが進行するごとに魔道具の自然充填を行う処理
+ * / Handle recharging objects once every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_recharge(void)
+{
+       int i;
+       bool changed;
+
        /* Process equipment */
-       for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
+       for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
                /* Get the object */
-               o_ptr = &inventory[i];
+               object_type *o_ptr = &inventory[i];
 
                /* Skip non-objects */
                if (!o_ptr->k_idx) continue;
@@ -4018,13 +2948,13 @@ msg_format("%s
                        if (!o_ptr->timeout)
                        {
                                recharged_notice(o_ptr);
-                               j++;
+                               changed = TRUE;
                        }
                }
        }
 
        /* Notice changes */
-       if (j)
+       if (changed)
        {
                /* Window stuff */
                p_ptr->window |= (PW_EQUIP);
@@ -4036,10 +2966,10 @@ msg_format("%s
         * and each charging rod in a stack decreases the stack's timeout by
         * one per turn. -LM-
         */
-       for (j = 0, i = 0; i < INVEN_PACK; i++)
+       for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
        {
-               o_ptr = &inventory[i];
-               k_ptr = &k_info[o_ptr->k_idx];
+               object_type *o_ptr = &inventory[i];
+               object_kind *k_ptr = &k_info[o_ptr->k_idx];
 
                /* Skip non-objects */
                if (!o_ptr->k_idx) continue;
@@ -4048,8 +2978,8 @@ msg_format("%s
                if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
                {
                        /* Determine how many rods are charging. */
-                       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;
@@ -4061,34 +2991,30 @@ msg_format("%s
                        if (!(o_ptr->timeout))
                        {
                                recharged_notice(o_ptr);
-                               j++;
+                               changed = TRUE;
+                       }
+
+                       /* One of the stack of rod is charged */
+                       else if (o_ptr->timeout % k_ptr->pval)
+                       {
+                               changed = TRUE;
                        }
                }
        }
 
        /* Notice changes */
-       if (j)
+       if (changed)
        {
-               /* Combine pack */
-               p_ptr->notice |= (PN_COMBINE);
-
                /* Window stuff */
                p_ptr->window |= (PW_INVEN);
                wild_regen = 20;
        }
 
-       /* Feel the inventory */
-       sense_inventory1();
-       sense_inventory2();
-
-
-       /*** Process Objects ***/
-
-       /* Process objects */
+       /* Process objects on floor */
        for (i = 1; i < o_max; i++)
        {
                /* Access object */
-               o_ptr = &o_list[i];
+               object_type *o_ptr = &o_list[i];
 
                /* Skip dead objects */
                if (!o_ptr->k_idx) continue;
@@ -4097,16 +3023,22 @@ msg_format("%s
                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;
                }
        }
+}
 
 
-       /*** Involuntary Movement ***/
-
+/*!
+ * @brief 10ゲームターンが進行するごとに帰還や現実変容などの残り時間カウントダウンと発動を処理する。
+ * / Handle involuntary movement once every 10 game turns
+ * @return なし
+ */
+static void process_world_aux_movement(void)
+{
        /* Delayed Word-of-Recall */
        if (p_ptr->word_recall)
        {
@@ -4127,154 +3059,882 @@ msg_format("%s
                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!"));
 
-                               p_ptr->recall_dungeon = dungeon_type;
+                               if (dungeon_type) p_ptr->recall_dungeon = dungeon_type;
                                if (record_stair)
                                        do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
 
                                dun_level = 0;
                                dungeon_type = 0;
-                               prepare_change_floor_mode(CFM_CLEAR_ALL);
 
                                leave_quest_check();
+                               leave_tower_check();
 
                                p_ptr->inside_quest = 0;
+
                                p_ptr->leaving = TRUE;
                        }
                        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;
+
+                               if (record_stair)
+                                       do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
+
+                               /* New depth */
+                               dun_level = max_dlv[dungeon_type];
+                               if (dun_level < 1) dun_level = 1;
+
+                               /* Nightmare mode makes recall more dangerous */
+                               if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
+                               {
+                                       if (dun_level < 50)
+                                       {
+                                               dun_level *= 2;
+                                       }
+                                       else if (dun_level < 99)
+                                       {
+                                               dun_level = (dun_level + 99) / 2;
+                                       }
+                                       else if (dun_level > 100)
+                                       {
+                                               dun_level = d_info[dungeon_type].maxdepth - 1;
+                                       }
+                               }
+
+                               if (p_ptr->wild_mode)
+                               {
+                                       p_ptr->wilderness_y = p_ptr->y;
+                                       p_ptr->wilderness_x = p_ptr->x;
+                               }
+                               else
+                               {
+                                       /* Save player position */
+                                       p_ptr->oldpx = p_ptr->x;
+                                       p_ptr->oldpy = p_ptr->y;
+                               }
+                               p_ptr->wild_mode = FALSE;
+
+                               /*
+                                * Clear all saved floors
+                                * and create a first saved floor
+                                */
+                               prepare_change_floor_mode(CFM_FIRST_FLOOR);
+
+                               /* Leaving */
+                               p_ptr->leaving = TRUE;
+
+                               if (dungeon_type == DUNGEON_ANGBAND)
+                               {
+                                       int i;
+
+                                       for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
+                                       {
+                                               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))
+                                               {
+                                                       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);
+                                               }
+                                       }
+                               }
+                       }
+
+                       /* Sound */
+                       sound(SOUND_TPLEVEL);
+               }
+       }
+
+
+       /* Delayed Alter reality */
+       if (p_ptr->alter_reality)
+       {
+               if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle)
+                       do_cmd_save_game(TRUE);
+
+               /* Count down towards alter */
+               p_ptr->alter_reality--;
+
+               p_ptr->redraw |= (PR_STATUS);
+
+               /* Activate the alter reality */
+               if (!p_ptr->alter_reality)
+               {
+                       /* Disturbing! */
+                       disturb(0, 1);
+
+                       /* Determine the level */
+                       if (!quest_number(dun_level) && dun_level)
+                       {
+                               msg_print(_("世界が変わった!", "The world changes!"));
+
+                               /*
+                                * Clear all saved floors
+                                * and create a first saved floor
+                                */
+                               prepare_change_floor_mode(CFM_FIRST_FLOOR);
+
+                               /* Leaving */
+                               p_ptr->leaving = TRUE;
+                       }
+                       else
+                       {
+                               msg_print(_("世界が少しの間変化したようだ。", "The world seems to change for a moment!"));
+                       }
+
+                       /* Sound */
+                       sound(SOUND_TPLEVEL);
+               }
+       }
+}
+
+
+/*!
+ * @brief 指定したモンスターに隣接しているモンスターの数を返す。
+ * / Count number of adjacent monsters
+ * @param m_idx 隣接数を調べたいモンスターのID
+ * @return 隣接しているモンスターの数
+ */
+static int get_monster_crowd_number(MONSTER_IDX m_idx)
+{
+       monster_type *m_ptr = &m_list[m_idx];
+       int my = m_ptr->fy;
+       int mx = m_ptr->fx;
+       int i;
+       int count = 0;
+
+       for (i = 0; i < 7; i++)
+       {
+               int ay = my + ddy_ddd[i];
+               int ax = mx + ddx_ddd[i];
+
+               if (!in_bounds(ay, ax)) continue;
+
+               /* Count number of monsters */
+               if (cave[ay][ax].m_idx > 0) count++;
+       }
+
+       return count;
+}
+
+
+
+/*!
+ * ダンジョンの雰囲気を計算するための非線形基準値 / Dungeon rating is no longer linear
+ */
+#define RATING_BOOST(delta) (delta * delta + 50 * delta)
+
+/*!
+ * @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;
+       IDX i;
+
+       /* Hack -- no feeling in the town */
+       if (!dun_level) return 0;
+
+       /* Examine each monster */
+       for (i = 1; i < m_max; i++)
+       {
+               monster_type *m_ptr = &m_list[i];
+               monster_race *r_ptr;
+               int delta = 0;
+
+               /* Skip dead monsters */
+               if (!m_ptr->r_idx) continue;
+
+               /* Ignore pet */
+               if (is_pet(m_ptr)) continue;
+
+               r_ptr = &r_info[m_ptr->r_idx];
+
+               /* Unique monsters */
+               if (r_ptr->flags1 & (RF1_UNIQUE))
+               {
+                       /* Nearly out-of-depth unique monsters */
+                       if (r_ptr->level + 10 > dun_level)
+                       {
+                               /* Boost rating by twice delta-depth */
+                               delta += (r_ptr->level + 10 - dun_level) * 2 * base;
+                       }
+               }
+               else
+               {
+                       /* Out-of-depth monsters */
+                       if (r_ptr->level > dun_level)
+                       {
+                               /* Boost rating by delta-depth */
+                               delta += (r_ptr->level - dun_level) * base;
+                       }
+               }
+
+               /* Unusually crowded monsters get a little bit of rating boost */
+               if (r_ptr->flags1 & RF1_FRIENDS)
+               {
+                       if (5 <= get_monster_crowd_number(i)) delta += 1;
+               }
+               else
+               {
+                       if (2 <= get_monster_crowd_number(i)) delta += 1;
+               }
+
+
+               rating += RATING_BOOST(delta);
+       }
+
+       /* Examine each unidentified object */
+       for (i = 1; i < o_max; i++)
+       {
+               object_type *o_ptr = &o_list[i];
+               object_kind *k_ptr = &k_info[o_ptr->k_idx];
+               int delta = 0;
+
+               /* Skip dead objects */
+               if (!o_ptr->k_idx) continue;
+
+               /* Skip known objects */
+               if (object_is_known(o_ptr))
+               {
+                       /* Touched? */
+                       if (o_ptr->marked & OM_TOUCHED) continue;
+               }
+
+               /* Skip pseudo-known objects */
+               if (o_ptr->ident & IDENT_SENSE) continue;
+
+               /* Ego objects */
+               if (object_is_ego(o_ptr))
+               {
+                       ego_item_type *e_ptr = &e_info[o_ptr->name2];
+
+                       delta += e_ptr->rating * base;
+               }
+
+               /* Artifacts */
+               if (object_is_artifact(o_ptr))
+               {
+                       s32b cost = object_value_real(o_ptr);
+
+                       delta += 10 * base;
+                       if (cost > 10000L) delta += 10 * base;
+                       if (cost > 50000L) delta += 10 * base;
+                       if (cost > 100000L) delta += 10 * base;
+
+                       /* Special feeling */
+                       if (!preserve_mode) return 1;
+               }
+
+               if (o_ptr->tval == TV_DRAG_ARMOR) delta += 30 * base;
+               if (o_ptr->tval == TV_SHIELD &&
+                   o_ptr->sval == SV_DRAGON_SHIELD) delta += 5 * base;
+               if (o_ptr->tval == TV_GLOVES &&
+                   o_ptr->sval == SV_SET_OF_DRAGON_GLOVES) delta += 5 * base;
+               if (o_ptr->tval == TV_BOOTS &&
+                   o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE) delta += 5 * base;
+               if (o_ptr->tval == TV_HELM &&
+                   o_ptr->sval == SV_DRAGON_HELM) delta += 5 * base;
+               if (o_ptr->tval == TV_RING &&
+                   o_ptr->sval == SV_RING_SPEED &&
+                   !object_is_cursed(o_ptr)) delta += 25 * base;
+               if (o_ptr->tval == TV_RING &&
+                   o_ptr->sval == SV_RING_LORDLY &&
+                   !object_is_cursed(o_ptr)) delta += 15 * base;
+               if (o_ptr->tval == TV_AMULET &&
+                   o_ptr->sval == SV_AMULET_THE_MAGI &&
+                   !object_is_cursed(o_ptr)) delta += 15 * base;
+
+               /* Out-of-depth objects */
+               if (!object_is_cursed(o_ptr) && !object_is_broken(o_ptr) &&
+                   k_ptr->level > dun_level)
+               {
+                       /* Rating increase */
+                       delta += (k_ptr->level - dun_level) * base;
+               }
+
+               rating += RATING_BOOST(delta);
+       }
+
+
+       if (rating > RATING_BOOST(1000)) return 2;
+       if (rating > RATING_BOOST(800)) return 3;
+       if (rating > RATING_BOOST(600)) return 4;
+       if (rating > RATING_BOOST(400)) return 5;
+       if (rating > RATING_BOOST(300)) return 6;
+       if (rating > RATING_BOOST(200)) return 7;
+       if (rating > RATING_BOOST(100)) return 8;
+       if (rating > RATING_BOOST(0)) return 9;
+
+       return 10;
+}
+
+/*!
+ * @brief ダンジョンの雰囲気を更新し、変化があった場合メッセージを表示する
+ * / Update dungeon feeling, and announce it if changed
+ * @return なし
+ */
+static void update_dungeon_feeling(void)
+{
+       byte new_feeling;
+       int quest_num;
+       int delay;
+
+       /* No feeling on the surface */
+       if (!dun_level) return;
+
+       /* No feeling in the arena */
+       if (p_ptr->inside_battle) return;
+
+       /* Extract delay time */
+       delay = MAX(10, 150 - p_ptr->skill_fos) * (150 - dun_level) * TURNS_PER_TICK / 100;
+
+       /* Not yet felt anything */
+       if (turn < p_ptr->feeling_turn + delay && !cheat_xtra) return;
+
+       /* Extract quest number (if any) */
+       quest_num = quest_number(dun_level);
+
+       /* No feeling in a quest */
+       if (quest_num &&
+           (is_fixed_quest_idx(quest_num) &&
+            !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
+              !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) return;
+
+
+       /* Get new dungeon feeling */
+       new_feeling = get_dungeon_feeling();
+
+       /* Remember last time updated */
+       p_ptr->feeling_turn = turn;
+
+       /* No change */
+       if (p_ptr->feeling == new_feeling) return;
+
+       /* Dungeon feeling is changed */
+       p_ptr->feeling = new_feeling;
+
+       /* Announce feeling */
+       do_cmd_feeling();
+
+       select_floor_music();
+
+       /* Update the level indicator */
+       p_ptr->redraw |= (PR_DEPTH);
+
+       /* Disturb */
+       if (disturb_minor) disturb(0, 0);
+}
+
+/*!
+ * @brief 10ゲームターンが進行する毎にゲーム世界全体の処理を行う。
+ * / Handle certain things once every 10 game turns
+ * @return なし
+ */
+static void process_world(void)
+{
+       int day, hour, min;
+
+       const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
+       s32b prev_turn_in_today = ((turn - TURNS_PER_TICK) % A_DAY + A_DAY / 4) % A_DAY;
+       int prev_min = (1440 * prev_turn_in_today / A_DAY) % 60;
+       
+       extract_day_hour_min(&day, &hour, &min);
+
+       /* 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)
+       {
+               int i2, j2;
+               int win_m_idx = 0;
+               int number_mon = 0;
+
+               /* Count all hostile monsters */
+               for (i2 = 0; i2 < cur_wid; ++i2)
+                       for (j2 = 0; j2 < cur_hgt; j2++)
+                       {
+                               cave_type *c_ptr = &cave[j2][i2];
+
+                               if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
+                               {
+                                       number_mon++;
+                                       win_m_idx = c_ptr->m_idx;
+                               }
+                       }
+
+               if (number_mon == 0)
+               {
+                       msg_print(_("相打ちに終わりました。", "They have kill each other at the same time."));
+                       msg_print(NULL);
+                       p_ptr->energy_need = 0;
+                       battle_monsters();
+               }
+               else if ((number_mon-1) == 0)
+               {
+                       char m_name[80];
+                       monster_type *wm_ptr;
+
+                       wm_ptr = &m_list[win_m_idx];
+
+                       monster_desc(m_name, wm_ptr, 0);
+                       msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
+                       msg_print(NULL);
+
+                       if (win_m_idx == (sel_monster+1))
+                       {
+                               msg_print(_("おめでとうございます。", "Congratulations."));
+                               msg_format(_("%d$を受け取った。", "You received %d gold."), battle_odds);
+                               p_ptr->au += battle_odds;
+                       }
+                       else
+                       {
+                               msg_print(_("残念でした。", "You lost gold."));
+                       }
+                       msg_print(NULL);
+                       p_ptr->energy_need = 0;
+                       battle_monsters();
+               }
+               else if (turn - old_turn == 150 * TURNS_PER_TICK)
+               {
+                       msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
+                       p_ptr->au += kakekin;
+                       msg_print(NULL);
+                       p_ptr->energy_need = 0;
+                       battle_monsters();
+               }
+       }
+
+       /* Every 10 game turns */
+       if (turn % TURNS_PER_TICK) return;
+
+       /*** Check the Time and Load ***/
+
+       if (!(turn % (50*TURNS_PER_TICK)))
+       {
+               /* Check time and load */
+               if ((0 != check_time()) || (0 != check_load()))
+               {
+                       /* Warning */
+                       if (closing_flag <= 2)
+                       {
+                               /* Disturb */
+                               disturb(0, 1);
+
+                               /* Count warnings */
+                               closing_flag++;
+
+                               /* Message */
+                               msg_print(_("アングバンドへの門が閉じかかっています...", "The gates to ANGBAND are closing..."));
+                               msg_print(_("ゲームを終了するかセーブするかして下さい。", "Please finish up and/or save your game."));
+
+                       }
+
+                       /* Slam the gate */
+                       else
+                       {
+                               /* Message */
+                               msg_print(_("今、アングバンドへの門が閉ざされました。", "The gates to ANGBAND are now closed."));
+
+                               /* Stop playing */
+                               p_ptr->playing = FALSE;
+
+                               /* Leaving */
+                               p_ptr->leaving = TRUE;
+                       }
+               }
+       }
+
+       /*** Attempt timed autosave ***/
+       if (autosave_t && autosave_freq && !p_ptr->inside_battle)
+       {
+               if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
+                       do_cmd_save_game(TRUE);
+       }
+
+       if (mon_fight && !ignore_unview)
+       {
+               msg_print(_("何かが聞こえた。", "You hear noise."));
+       }
+
+       /*** Handle the wilderness/town (sunshine) ***/
+
+       /* While in town/wilderness */
+       if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)
+       {
+               /* Hack -- Daybreak/Nighfall in town */
+               if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
+               {
+                       bool dawn;
+
+                       /* Check for dawn */
+                       dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
+
+                       /* Day breaks */
+                       if (dawn)
+                       {
+                               int y, x;
+
+                               /* Message */
+                               msg_print(_("夜が明けた。", "The sun has risen."));
+
+                               if (!p_ptr->wild_mode)
+                               {
+                                       /* Hack -- Scan the town */
+                                       for (y = 0; y < cur_hgt; y++)
+                                       {
+                                               for (x = 0; x < cur_wid; x++)
+                                               {
+                                                       /* Get the cave grid */
+                                                       cave_type *c_ptr = &cave[y][x];
+
+                                                       /* Assume lit */
+                                                       c_ptr->info |= (CAVE_GLOW);
+
+                                                       /* Hack -- Memorize lit grids if allowed */
+                                                       if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
+
+                                                       /* Hack -- Notice spot */
+                                                       note_spot(y, x);
+                                               }
+                                       }
+                               }
+                       }
+
+                       /* Night falls */
+                       else
+                       {
+                               int y, x;
+
+                               /* Message */
+                               msg_print(_("日が沈んだ。", "The sun has fallen."));
+
+                               if (!p_ptr->wild_mode)
+                               {
+                                       /* Hack -- Scan the town */
+                                       for (y = 0; y < cur_hgt; y++)
+                                       {
+                                               for (x = 0; x < cur_wid; x++)
+                                               {
+                                                       /* Get the cave grid */
+                                                       cave_type *c_ptr = &cave[y][x];
+
+                                                       /* Feature code (applying "mimic" field) */
+                                                       feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
+
+                                                       if (!is_mirror_grid(c_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) &&
+                                                           !have_flag(f_ptr->flags, FF_ENTRANCE))
+                                                       {
+                                                               /* Assume dark */
+                                                               c_ptr->info &= ~(CAVE_GLOW);
+
+                                                               if (!have_flag(f_ptr->flags, FF_REMEMBER))
+                                                               {
+                                                                       /* Forget the normal floor grid */
+                                                                       c_ptr->info &= ~(CAVE_MARK);
+
+                                                                       /* Hack -- Notice spot */
+                                                                       note_spot(y, x);
+                                                               }
+                                                       }
+                                               }
+
+                                               /* Glow deep lava and building entrances */
+                                               glow_deep_lava_and_bldg();
+                                       }
+                               }
+                       }
+
+                       /* Update the monsters */
+                       p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
+
+                       /* Redraw map */
+                       p_ptr->redraw |= (PR_MAP);
+
+                       /* Window stuff */
+                       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+
+                       if (p_ptr->special_defense & NINJA_S_STEALTH)
+                       {
+                               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+                       }
+               }
+       }
+
+       /* While in the dungeon (vanilla_town or lite_town mode only) */
+       else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)) && dun_level)
+       {
+               /*** Shuffle the Storekeepers ***/
+
+               /* Chance is only once a day (while in dungeon) */
+               if (!(turn % (TURNS_PER_TICK * STORE_TICKS)))
+               {
+                       /* Sometimes, shuffle the shop-keepers */
+                       if (one_in_(STORE_SHUFFLE))
+                       {
+                               int n, i;
+
+                               /* Pick a random shop (except home and museum) */
+                               do
+                               {
+                                       n = randint0(MAX_STORES);
+                               }
+                               while ((n == STORE_HOME) || (n == STORE_MUSEUM));
+
+                               /* Check every feature */
+                               for (i = 1; i < max_f_idx; i++)
+                               {
+                                       /* Access the index */
+                                       feature_type *f_ptr = &f_info[i];
+
+                                       /* Skip empty index */
+                                       if (!f_ptr->name) continue;
+
+                                       /* Skip non-store features */
+                                       if (!have_flag(f_ptr->flags, FF_STORE)) continue;
+
+                                       /* Verify store type */
+                                       if (f_ptr->subtype == n)
+                                       {
+                                               /* Message */
+                                               if (cheat_xtra) msg_format(_("%sの店主をシャッフルします。", "Shuffle a Shopkeeper of %s."), f_name + f_ptr->name);
+
+                                               /* Shuffle it */
+                                               store_shuffle(n);
+
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+
+
+       /*** Process the monsters ***/
+
+       /* Check for creature generation. */
+       if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
+           !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
+       {
+               /* Make a new monster */
+               (void)alloc_monster(MAX_SIGHT + 5, 0);
+       }
+
+       /* Hack -- Check for creature regeneration */
+       if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
+       if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
+
+       if (!p_ptr->leaving)
+       {
+               int i;
+
+               /* Hack -- Process the counters of monsters if needed */
+               for (i = 0; i < MAX_MTIMED; i++)
+               {
+                       if (mproc_max[i] > 0) process_monsters_mtimed(i);
+               }
+       }
+
+
+       /* Date changes */
+       if (!hour && !min)
+       {
+               if (min != prev_min)
+               {
+                       do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
+                       determine_today_mon(FALSE);
+               }
+       }
+
+       /*
+        * 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, 1);
+
+                       switch (min / 15)
+                       {
+                       case 0:
+                               msg_print(_("遠くで不気味な鐘の音が鳴った。", "You hear a distant bell toll ominously."));
+                               break;
 
-                               dungeon_type = p_ptr->recall_dungeon;
+                       case 1:
+                               msg_print(_("遠くで鐘が二回鳴った。", "A distant bell sounds twice."));
+                               break;
 
-                               if (record_stair)
-                                       do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
+                       case 2:
+                               msg_print(_("遠くで鐘が三回鳴った。", "A distant bell sounds three times."));
+                               break;
 
-                               /* New depth */
-                               dun_level = max_dlv[dungeon_type];
-                               if (dun_level < 1) dun_level = 1;
+                       case 3:
+                               msg_print(_("遠くで鐘が四回鳴った。", "A distant bell tolls four times."));
+                               break;
+                       }
+               }
 
-                               /* Nightmare mode makes recall more dangerous */
-                               if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
-                               {
-                                       if (dun_level < 50)
-                                       {
-                                               dun_level *= 2;
-                                       }
-                                       else if (dun_level < 99)
-                                       {
-                                               dun_level = (dun_level + 99) / 2;
-                                       }
-                                       else if (dun_level > 100)
-                                       {
-                                               dun_level = d_info[dungeon_type].maxdepth - 1;
-                                       }
-                               }
+               /* TY_CURSE activates at midnight! */
+               if (!hour && !min)
+               {
 
-                               if (p_ptr->wild_mode)
-                               {
-                                       p_ptr->wilderness_y = py;
-                                       p_ptr->wilderness_x = px;
-                               }
-                               else
-                               {
-                                       /* Save player position */
-                                       p_ptr->oldpx = px;
-                                       p_ptr->oldpy = py;
-                               }
-                               p_ptr->wild_mode = FALSE;
+                       disturb(1, 1);
+                       msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
 
-                               prepare_change_floor_mode(CFM_CLEAR_ALL);
+                       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();
 
-                               /* Leaving */
-                               p_ptr->leaving = TRUE;
+                               /* Give first move to monsters */
+                               p_ptr->energy_use = 100;
 
-                               if (dungeon_type == DUNGEON_ANGBAND)
-                               {
-                                       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[i].status = QUEST_STATUS_FAILED;
-                                                       quest[i].complev = (byte)p_ptr->lev;
-                                                       r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
-                                               }
-                                       }
-                               }
+                               /* HACk -- set the encouter flag for the wilderness generation */
+                               generate_encounter = TRUE;
                        }
 
-                       /* Sound */
-                       sound(SOUND_TPLEVEL);
+                       invoking_midnight_curse = TRUE;
                }
        }
 
 
-       /* Delayed Alter reality */
-       if (p_ptr->alter_reality)
+       /*** Check the Food, and Regenerate ***/
+
+       if (!p_ptr->inside_battle)
        {
-               if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle)
-                       do_cmd_save_game(TRUE);
+               /* Digest quickly when gorged */
+               if (p_ptr->food >= PY_FOOD_MAX)
+               {
+                       /* Digest a lot of food */
+                       (void)set_food(p_ptr->food - 100);
+               }
 
-               /* Count down towards alter */
-               p_ptr->alter_reality--;
+               /* Digest normally -- Every 50 game turns */
+               else if (!(turn % (TURNS_PER_TICK*5)))
+               {
+                       /* Basic digestion rate based on speed */
+                       int digestion = SPEED_TO_ENERGY(p_ptr->pspeed);
 
-               p_ptr->redraw |= (PR_STATUS);
+                       /* Regeneration takes more food */
+                       if (p_ptr->regenerate)
+                               digestion += 20;
+                       if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
+                               digestion += 20;
+                       if (p_ptr->cursed & TRC_FAST_DIGEST)
+                               digestion += 30;
 
-               /* Activate the alter reality */
-               if (!p_ptr->alter_reality)
-               {
-                       /* Disturbing! */
-                       disturb(0, 0);
+                       /* Slow digestion takes less food */
+                       if (p_ptr->slow_digest)
+                               digestion -= 5;
 
-                       /* Determine the level */
-                       if (!quest_number(dun_level) && dun_level)
-                       {
-#ifdef JP
-                               msg_print("À¤³¦¤¬ÊѤï¤Ã¤¿¡ª");
-#else
-                               msg_print("The world changes!");
-#endif
+                       /* Minimal digestion */
+                       if (digestion < 1) digestion = 1;
+                       /* Maximal digestion */
+                       if (digestion > 100) digestion = 100;
 
-                               prepare_change_floor_mode(CFM_CLEAR_ALL);
+                       /* Digest some food */
+                       (void)set_food(p_ptr->food - digestion);
+               }
 
-                               /* Leaving */
-                               p_ptr->leaving = TRUE;
-                       }
-                       else
+
+               /* Getting Faint */
+               if ((p_ptr->food < PY_FOOD_FAINT))
+               {
+                       /* Faint occasionally */
+                       if (!p_ptr->paralyzed && (randint0(100) < 10))
                        {
-#ifdef JP
-                               msg_print("À¤³¦¤¬¾¯¤·¤Î´ÖÊѲ½¤·¤¿¤è¤¦¤À¡£");
-#else
-                               msg_print("The world seems to change for a moment!");
-#endif
+                               /* Message */
+                               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));
                        }
 
-                       /* Sound */
-                       sound(SOUND_TPLEVEL);
+                       /* Starve to death (slowly) */
+                       if (p_ptr->food < PY_FOOD_STARVE)
+                       {
+                               /* Calculate damage */
+                               HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
+
+                               /* Take damage */
+                               if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+                       }
                }
        }
-}
 
 
 
-/*
- * Verify use of "wizard" mode
+       /* Process timed damage and regeneration */
+       process_world_aux_hp_and_sp();
+
+       /* Process timeout */
+       process_world_aux_timeout();
+
+       /* Process light */
+       process_world_aux_light();
+
+       /* Process mutation effects */
+       process_world_aux_mutation();
+
+       /* Process curse effects */
+       process_world_aux_curse();
+
+       /* Process recharging */
+       process_world_aux_recharge();
+
+       /* Feel the inventory */
+       sense_inventory1();
+       sense_inventory2();
+
+       /* Involuntary Movement */
+       process_world_aux_movement();
+}
+
+/*!
+ * @brief ウィザードモードへの導入処理
+ * / Verify use of "wizard" mode
+ * @return 実際にウィザードモードへ移行したらTRUEを返す。
  */
 static bool enter_wizard_mode(void)
 {
@@ -4282,42 +3942,24 @@ static bool enter_wizard_mode(void)
        if (!p_ptr->noscore)
        {
                /* Wizard mode is not permitted */
-               if (!allow_debug_opts)
+               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;
        }
@@ -4329,8 +3971,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)
 {
@@ -4340,40 +3984,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;
        }
@@ -4392,8 +4019,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)
 {
@@ -4401,31 +4030,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;
        }
@@ -4442,16 +4058,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 */
 
@@ -4462,6 +4077,10 @@ static void process_command(void)
 
        now_message = 0;
 
+       /* Sniper */
+       if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->concent))
+               reset_concent = TRUE;
+
        /* Parse the command */
        switch (command_cmd)
        {
@@ -4487,22 +4106,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 */
@@ -4732,35 +4341,23 @@ msg_print("
                /* Go up staircase */
                case '<':
                {
-                       if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
+                       if (!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
                        {
-                               if (!vanilla_town)
+                               if (vanilla_town) break;
+
+                               if (ambush_flag)
                                {
-                                       if(ambush_flag)
-                                       {
-#ifdef JP
-                                               msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
-#else
-                                               msg_print("To flee the ambush you have to reach the edge of the map.");
-#endif
-                                       }
-                                       else if (p_ptr->food < PY_FOOD_WEAK)
-                                       {
-#ifdef JP
-                                               msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
-#else
-                                               msg_print("You must eat something here.");
-#endif
-                                       }
-                                       else
-                                       {
-                                               if (change_wild_mode())
-                                               {
-                                                       p_ptr->oldpx = px;
-                                                       p_ptr->oldpy = py;
-                                               }
-                                       }
+                                       msg_print(_("襲撃から逃げるにはマップの端まで移動しなければならない。", "To flee the ambush you have to reach the edge of the map."));
+                                       break;
+                               }
+
+                               if (p_ptr->food < PY_FOOD_WEAK)
+                               {
+                                       msg_print(_("その前に食事をとらないと。", "You must eat something here."));
+                                       break;
                                }
+
+                               change_wild_mode();
                        }
                        else
                                do_cmd_go_up();
@@ -4770,13 +4367,11 @@ msg_print("
                /* Go down staircase */
                case '>':
                {
-                       if(!p_ptr->wild_mode) do_cmd_go_down();
-                       else
-                       {
-                               p_ptr->wilderness_x = px;
-                               p_ptr->wilderness_y = py;
+                       if (p_ptr->wild_mode)
                                change_wild_mode();
-                       }
+                       else
+                               do_cmd_go_down();
+
                        break;
                }
 
@@ -4822,11 +4417,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)
@@ -4847,7 +4438,9 @@ 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();
                        break;
                }
@@ -4860,81 +4453,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
                                {
@@ -4947,13 +4495,15 @@ 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)
                                                do_cmd_cast_learned();
                                        else if (p_ptr->pclass == CLASS_SMITH)
                                                do_cmd_kaji(FALSE);
+                                       else if (p_ptr->pclass == CLASS_SNIPER)
+                                               do_cmd_snipe();
                                        else
                                                do_cmd_cast();
                                }
@@ -4993,12 +4543,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);
                        }
                        }
@@ -5045,12 +4590,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);
                        }
                        }
@@ -5064,12 +4604,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)
@@ -5093,12 +4628,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);
                        }
                        }
@@ -5114,12 +4644,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);
                        }
                        }
@@ -5133,12 +4658,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)
@@ -5233,7 +4753,7 @@ msg_print("
 
                case '$':
                {
-                       do_cmd_pickpref();
+                       do_cmd_reload_autopick();
                        break;
                }
 
@@ -5270,6 +4790,7 @@ msg_print("
                case '=':
                {
                        do_cmd_options();
+                       (void)combine_and_reorder_home(STORE_HOME);
                        do_cmd_redraw();
                        break;
                }
@@ -5381,7 +4902,14 @@ msg_print("
                /* Save "screen dump" */
                case ')':
                {
-                       do_cmd_save_screen();
+                       do_cmd_save_screen();
+                       break;
+               }
+
+               /* Record/stop "Movie" */
+               case ']':
+               {
+                       prepare_movie_hooks();
                        break;
                }
 
@@ -5392,6 +4920,18 @@ msg_print("
                        break;
                }
 
+#ifdef TRAVEL
+               case '`':
+               {
+                       if (!p_ptr->wild_mode) do_cmd_travel();
+                       if (p_ptr->special_defense & KATA_MUSOU)
+                       {
+                               set_action(ACTION_NONE);
+                       }
+                       break;
+               }
+#endif
+
                /* Hack -- Unknown command */
                default:
                {
@@ -5400,67 +4940,141 @@ 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];
 
-       if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
+       if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && my_strchr("Jjlw", r_ptr->d_char))
                return TRUE;
        else
                return FALSE;
 }
 
 
-/*
- * 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 アイテムの所持種類数が超えた場合にアイテムを床に落とす処理 / Hack -- Pack Overflow
+ * @return なし
+ */
+static void pack_overflow(void)
+{
+       if (inventory[INVEN_PACK].k_idx)
+       {
+               char o_name[MAX_NLEN];
+               object_type *o_ptr;
+
+               /* Is auto-destroy done? */
+               notice_stuff();
+               if (!inventory[INVEN_PACK].k_idx) return;
+
+               /* Access the slot to be dropped */
+               o_ptr = &inventory[INVEN_PACK];
+
+               /* Disturbing */
+               disturb(0, 1);
+
+               /* Warning */
+               msg_print(_("ザックからアイテムがあふれた!", "Your pack overflows!"));
+
+               /* Describe */
+               object_desc(o_name, o_ptr, 0);
+
+               /* Message */
+               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, p_ptr->y, p_ptr->x);
+
+               /* Modify, Describe, Optimize */
+               inven_item_increase(INVEN_PACK, -255);
+               inven_item_describe(INVEN_PACK);
+               inven_item_optimize(INVEN_PACK);
+
+               /* Handle "p_ptr->notice" */
+               notice_stuff();
+
+               /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
+               handle_stuff();
+       }
+}
+
+/*!
+ * @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();
+       }
+}
+
+/*!
+ * @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++)
@@ -5494,7 +5108,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) &&
@@ -5505,7 +5119,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) &&
@@ -5528,7 +5142,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);
@@ -5536,29 +5150,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);
                }
        }
 
@@ -5566,7 +5172,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;
@@ -5578,15 +5184,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."));
                        }
                }
        }
@@ -5594,152 +5195,72 @@ msg_print("
        if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
        {
                monster_type *m_ptr = &m_list[p_ptr->riding];
+               monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
-               if (m_ptr->csleep)
+               if (MON_CSLEEP(m_ptr))
                {
                        char m_name[80];
 
                        /* Recover fully */
-                       m_ptr->csleep = 0;
+                       (void)set_monster_csleep(p_ptr->riding, 0);
 
                        /* 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
-                       if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
-                       p_ptr->redraw |= (PR_UHEALTH);
+                       msg_format(_("%^sを起こした。", "You have waked %s up."), m_name);
                }
 
-               if (m_ptr->stunned)
+               if (MON_STUNNED(m_ptr))
                {
-                       int d = 1;
-
-                       /* Make a "saving throw" against stun */
-                       if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
-                       {
-                               /* Recover fully */
-                               d = m_ptr->stunned;
-                       }
-
                        /* Hack -- Recover from stun */
-                       if (m_ptr->stunned > d)
-                       {
-                               /* Recover somewhat */
-                               m_ptr->stunned -= d;
-                       }
-
-                       /* Fully recover */
-                       else
+                       if (set_monster_stunned(p_ptr->riding,
+                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1)))
                        {
                                char m_name[80];
 
-                               /* Recover fully */
-                               m_ptr->stunned = 0;
-
                                /* Acquire the monster name */
                                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
-                               if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
-                               p_ptr->redraw |= (PR_UHEALTH);
+                               msg_format(_("%^sを朦朧状態から立ち直らせた。", "%^s is no longer stunned."), m_name);
                        }
                }
 
-               if (m_ptr->confused)
+               if (MON_CONFUSED(m_ptr))
                {
-                       int d = 1;
-
-                       /* Make a "saving throw" against stun */
-                       if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
-                       {
-                               /* Recover fully */
-                               d = m_ptr->confused;
-                       }
-
-                       /* Hack -- Recover from stun */
-                       if (m_ptr->confused > d)
-                       {
-                               /* Recover somewhat */
-                               m_ptr->confused -= d;
-                       }
-
-                       /* Fully recover */
-                       else
+                       /* Hack -- Recover from confusion */
+                       if (set_monster_confused(p_ptr->riding,
+                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1)))
                        {
                                char m_name[80];
 
-                               /* Recover fully */
-                               m_ptr->confused = 0;
-
                                /* Acquire the monster name */
                                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
-                               if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
-                               p_ptr->redraw |= (PR_UHEALTH);
+                               msg_format(_("%^sを混乱状態から立ち直らせた。", "%^s is no longer confused."), m_name);
                        }
                }
 
-               if (m_ptr->monfear)
+               if (MON_MONFEAR(m_ptr))
                {
-                       int d = 1;
-
-                       /* Make a "saving throw" against stun */
-                       if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
-                       {
-                               /* Recover fully */
-                               d = m_ptr->monfear;
-                       }
-
-                       /* Hack -- Recover from stun */
-                       if (m_ptr->monfear > d)
-                       {
-                               /* Recover somewhat */
-                               m_ptr->monfear -= d;
-                       }
-
-                       /* Fully recover */
-                       else
+                       /* Hack -- Recover from fear */
+                       if (set_monster_monfear(p_ptr->riding,
+                               (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1)))
                        {
                                char m_name[80];
 
-                               /* Recover fully */
-                               m_ptr->monfear = 0;
-
                                /* Acquire the monster name */
                                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
-                               if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
-                               p_ptr->redraw |= (PR_UHEALTH);
+                               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();
-
+       
        load = FALSE;
 
        /* Fast */
@@ -5747,35 +5268,35 @@ msg_format("%^s
        {
                (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)
        {
-               int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
-               if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
+               s32b cost = 0L;
+               u32b cost_frac = (p_ptr->msp + 30L) * 256L;
+
+               /* Convert the unit (1/2^16) to (1/2^32) */
+               s64b_LSHIFT(cost, cost_frac, 16);
+
+               if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, cost, cost_frac) < 0)
                {
+                       /* Mana run out */
                        p_ptr->csp = 0;
                        p_ptr->csp_frac = 0;
                        set_action(ACTION_NONE);
                }
                else
                {
-                       p_ptr->csp -= (s16b)(hoge >> 16);
-                       hoge &= 0xFFFFL;
-                       if (p_ptr->csp_frac < hoge)
-                       {
-                               p_ptr->csp_frac += 0x10000L - hoge;
-                               p_ptr->csp--;
-                       }
-                       else
-                               p_ptr->csp_frac -= hoge;
+                       /* Reduce mana */
+                       s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), cost, cost_frac);
                }
                p_ptr->redraw |= PR_MANA;
        }
@@ -5813,60 +5334,14 @@ msg_format("%^s
                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();
 
 
                /* Hack -- Pack Overflow */
-               if (inventory[INVEN_PACK].k_idx)
-               {
-                       int item = INVEN_PACK;
-
-                       char o_name[MAX_NLEN];
-
-                       object_type *o_ptr;
-
-                       /* Access the slot to be dropped */
-                       o_ptr = &inventory[item];
-
-                       /* Disturbing */
-                       disturb(0, 0);
-
-                       /* Warning */
-#ifdef JP
-msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
-#else
-                       msg_print("Your pack overflows!");
-#endif
-
-
-                       /* Describe */
-                       object_desc(o_name, o_ptr, TRUE, 3);
-
-                       /* Message */
-#ifdef JP
-msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
-#else
-                       msg_format("You drop %s (%c).", o_name, index_to_label(item));
-#endif
-
-
-                       /* Drop it (carefully) near the player */
-                       (void)drop_near(o_ptr, 0, py, px);
-
-                       /* Modify, Describe, Optimize */
-                       inven_item_increase(item, -255);
-                       inven_item_describe(item);
-                       inven_item_optimize(item);
-
-                       /* Handle "p_ptr->notice" */
-                       notice_stuff();
-
-                       /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
-                       handle_stuff();
-               }
+               pack_overflow();
 
 
                /* Hack -- cancel "lurking browse mode" */
@@ -5874,13 +5349,13 @@ msg_format("%s(%c)
 
 
                /* 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;
 
@@ -5892,7 +5367,7 @@ msg_format("%s(%c)
                else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
                {
                        /* Take a turn */
-                       energy_use = 100;
+                       p_ptr->energy_use = 100;
                }
 
                /* Resting */
@@ -5911,14 +5386,14 @@ msg_format("%s(%c)
                        }
 
                        /* 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 */
@@ -5928,6 +5403,15 @@ msg_format("%s(%c)
                        run_step(0);
                }
 
+#ifdef TRAVEL
+               /* Traveling */
+               else if (travel.run)
+               {
+                       /* Take a step */
+                       travel_step();
+               }
+#endif
+
                /* Repeated command */
                else if (command_rep)
                {
@@ -5954,7 +5438,7 @@ msg_format("%s(%c)
                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) */
@@ -5966,21 +5450,25 @@ msg_format("%s(%c)
                }
 
 
+               /* Hack -- Pack Overflow */
+               pack_overflow();
+
+
                /*** 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 */
@@ -6005,11 +5493,15 @@ msg_format("%s(%c)
                                        /* Skip dead monsters */
                                        if (!m_ptr->r_idx) continue;
 
+                                       /* Skip unseen monsters */
+                                       if (!m_ptr->ml) continue;
+
                                        /* Access the monster race */
-                                       r_ptr = &r_info[m_ptr->r_idx];
+                                       r_ptr = &r_info[m_ptr->ap_r_idx];
 
                                        /* Skip non-multi-hued monsters */
-                                       if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
+                                       if (!(r_ptr->flags1 & (RF1_ATTR_MULTI | RF1_SHAPECHANGER)))
+                                               continue;
 
                                        /* Reset the flag */
                                        shimmer_monsters = TRUE;
@@ -6090,7 +5582,7 @@ msg_format("%s(%c)
                                        }
                                }
                                new_mane = FALSE;
-                               p_ptr->redraw |= (PR_MANE);
+                               p_ptr->redraw |= (PR_IMITATION);
                        }
                        if (p_ptr->action == ACTION_LEARN)
                        {
@@ -6109,11 +5601,7 @@ msg_format("%s(%c)
                                /* 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();
@@ -6130,6 +5618,9 @@ msg_format("%s(%c)
                        break;
                }
 
+               /* Sniper */
+               if (p_ptr->energy_use && reset_concent) reset_concentration(TRUE);
+
                /* Handle "leaving" */
                if (p_ptr->leaving) break;
        }
@@ -6138,12 +5629,18 @@ msg_format("%s(%c)
        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
+ * <p>
+ * この関数から現在の階層を出る、プレイヤーがキャラが死ぬ、
+ * ゲームを終了するかのいずれかまでループする。
+ * </p>
+ * <p>
+ * This function will not exit until the level is completed,\n
+ * the user dies, or the game is terminated.\n
+ * </p>
  */
 static void dungeon(bool load_game)
 {
@@ -6153,14 +5650,18 @@ 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;
 
        /* Reset the "command" vars */
        command_cmd = 0;
+
+#if 0 /* Don't reset here --- It's used for Arena */
        command_new = 0;
+#endif
+
        command_rep = 0;
        command_arg = 0;
        command_dir = 0;
@@ -6183,7 +5684,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);
@@ -6206,9 +5707,11 @@ static void dungeon(bool load_game)
        if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
        {
                max_dlv[dungeon_type] = dun_level;
-               if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
+               if (record_maxdepth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
        }
 
+       (void)calculate_upkeep();
+
        /* Validate the panel */
        panel_bounds_center();
 
@@ -6261,7 +5764,9 @@ static void dungeon(bool load_game)
        /* Refresh */
        Term_fresh();
 
-       if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
+       if (quest_num && (is_fixed_quest_idx(quest_num) &&
+           !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
+           !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
 
        if (p_ptr->inside_battle)
        {
@@ -6272,18 +5777,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;
@@ -6298,16 +5798,18 @@ 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
-               msg_format("%^s lives in this level as the keeper of %s.",
-                                  r_name+r_info[d_info[dungeon_type].final_guardian].name, 
-                                  d_name+d_info[dungeon_type].name);
+                       msg_format("%^s lives in this level as the keeper of %s.",
+                                          r_name+r_info[d_info[dungeon_type].final_guardian].name, 
+                                          d_name+d_info[dungeon_type].name);
 #endif
        }
 
+       if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(FALSE);
+
        /*** Process this dungeon level ***/
 
        /* Reset the monster generation level */
@@ -6316,7 +5818,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))
@@ -6325,6 +5827,9 @@ msg_print("
        /* Not leaving dungeon */
        p_ptr->leaving_dungeon = FALSE;
 
+       /* Initialize monster process */
+       mproc_init();
+
        /* Main loop */
        while (TRUE)
        {
@@ -6341,9 +5846,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();
@@ -6352,7 +5859,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();
@@ -6370,7 +5877,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();
@@ -6389,7 +5896,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();
@@ -6397,13 +5904,20 @@ msg_print("
                /* Hack -- Notice death or departure */
                if (!p_ptr->playing || p_ptr->is_dead) break;
 
+               /* Count game turns */
+               turn++;
+
+               if (dungeon_turn < dungeon_turn_limit)
+               {
+                       if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
+                       else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
+               }
+
+               prevent_turn_overflow();
+
                /* Handle "leaving" */
                if (p_ptr->leaving) break;
 
-               /* Count game turns */
-               turn++;
-               if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
-               else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
                if (wild_regen) wild_regen--;
        }
 
@@ -6432,16 +5946,16 @@ 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.
  */
 static void load_all_pref_files(void)
 {
        char buf[1024];
-       errr err;
 
        /* Access the "user" pref file */
        sprintf(buf, "user.prf");
@@ -6461,79 +5975,202 @@ static void load_all_pref_files(void)
        /* Process that file */
        process_pref_file(buf);
 
-       /* Access the "class" pref file */
-       sprintf(buf, "%s.prf", cp_ptr->title);
+       /* Access the "class" pref file */
+       sprintf(buf, "%s.prf", cp_ptr->title);
+
+       /* Process that file */
+       process_pref_file(buf);
+
+       /* Access the "character" pref file */
+       sprintf(buf, "%s.prf", player_base);
+
+       /* Process that file */
+       process_pref_file(buf);
+
+       /* Access the "realm 1" pref file */
+       if (p_ptr->realm1 != REALM_NONE)
+       {
+               sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
+
+               /* Process that file */
+               process_pref_file(buf);
+       }
+
+       /* Access the "realm 2" pref file */
+       if (p_ptr->realm2 != REALM_NONE)
+       {
+               sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
+
+               /* Process that file */
+               process_pref_file(buf);
+       }
+
+
+       /* Load an autopick preference file */
+       autopick_load_pref(FALSE);
+}
+
+
+/*!
+ * @brief ビットセットからゲームオプションを展開する / Extract option variables from bit sets
+ * @return なし
+ */
+void extract_option_vars(void)
+{
+       int i;
+
+       for (i = 0; option_info[i].o_desc; i++)
+       {
+               int os = option_info[i].o_set;
+               int ob = option_info[i].o_bit;
+
+               /* Set the "default" options */
+               if (option_info[i].o_var)
+               {
+                       /* Set */
+                       if (option_flag[os] & (1L << ob))
+                       {
+                               /* Set */
+                               (*option_info[i].o_var) = TRUE;
+                       }
+
+                       /* Clear */
+                       else
+                       {
+                               /* Clear */
+                               (*option_info[i].o_var) = FALSE;
+                       }
+               }
+       }
+}
+
+
+/*!
+ * @brief 賞金首となるユニークを確定する / Determine bounty uniques
+ * @return なし
+ */
+void determine_bounty_uniques(void)
+{
+       int i, j;
+       MONRACE_IDX tmp;
+       monster_race *r_ptr;
+
+       get_mon_num_prep(NULL, NULL);
+       for (i = 0; i < MAX_KUBI; i++)
+       {
+               while (1)
+               {
+                       kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
+                       r_ptr = &r_info[kubi_r_idx[i]];
 
-       /* Process that file */
-       process_pref_file(buf);
+                       if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
 
-       /* Access the "character" pref file */
-       sprintf(buf, "%s.prf", player_base);
+                       if (!(r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON))) continue;
 
-       /* Process that file */
-       process_pref_file(buf);
+                       if (r_ptr->rarity > 100) continue;
 
-       /* Free old entries */
-       init_autopicker();
+                       if (no_questor_or_bounty_uniques(kubi_r_idx[i])) continue;
 
-#ifdef JP
-       sprintf(buf, "picktype-%s.prf", player_base);
-#else
-       sprintf(buf, "pickpref-%s.prf", player_base);
-#endif
+                       for (j = 0; j < i; j++)
+                               if (kubi_r_idx[i] == kubi_r_idx[j]) break;
 
-       err = process_pickpref_file(buf);
+                       if (j == i) break;
+               }
+       }
 
-       /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
-       if (0 > err)
+       /* Sort them */
+       for (i = 0; i < MAX_KUBI - 1; i++)
        {
-#ifdef JP
-               process_pickpref_file("picktype.prf");
-#else
-               process_pickpref_file("pickpref.prf");
-#endif
+               for (j = i; j < MAX_KUBI; j++)
+               {
+                       if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
+                       {
+                               tmp = kubi_r_idx[i];
+                               kubi_r_idx[i] = kubi_r_idx[j];
+                               kubi_r_idx[j] = tmp;
+                       }
+               }
        }
+}
 
-       /* Access the "realm 1" pref file */
-       if (p_ptr->realm1 != REALM_NONE)
-       {
-               sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
 
-               /* Process that file */
-               process_pref_file(buf);
+/*!
+ * @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)
+{
+       int max_dl = 3, i;
+       bool old_inside_battle = p_ptr->inside_battle;
+       monster_race *r_ptr;
+
+       if (!conv_old)
+       {
+               for (i = 0; i < max_d_idx; i++)
+               {
+                       if (max_dlv[i] < d_info[i].mindepth) continue;
+                       if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
+               }
        }
+       else max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3);
 
-       /* Access the "realm 2" pref file */
-       if (p_ptr->realm2 != REALM_NONE)
+       p_ptr->inside_battle = TRUE;
+       get_mon_num_prep(NULL, NULL);
+
+       while (1)
        {
-               sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
+               today_mon = get_mon_num(max_dl);
+               r_ptr = &r_info[today_mon];
 
-               /* Process that file */
-               process_pref_file(buf);
+               if (r_ptr->flags1 & RF1_UNIQUE) continue;
+               if (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)) continue;
+               if (r_ptr->flags2 & RF2_MULTIPLY) continue;
+               if ((r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) != (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) continue;
+               if (r_ptr->level < MIN(max_dl / 2, 40)) continue;
+               if (r_ptr->rarity > 10) continue;
+               break;
        }
-}
 
+       p_ptr->today_mon = 0;
+       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){
-         reset_visuals();
-         browse_chuukei();
-         return;
+       if (chuukei_client)
+       {
+               reset_visuals();
+               browse_chuukei();
+               return;
+       }
+
+       else if (chuukei_server)
+       {
+               prepare_chuukei_hooks();
        }
 #endif
 
+       if (browsing_movie)
+       {
+               reset_visuals();
+               browse_movie();
+               return;
+       }
+
        hack_mutation = FALSE;
 
        /* Hack -- Character is "icky" */
@@ -6544,7 +6181,7 @@ void play_game(bool new_game)
 
        /* Initialise the resize hooks */
        angband_term[0]->resize_hook = resize_map;
-       
+
        for (i = 1; i < 8; i++)
        {
                /* Does the term exist? */
@@ -6563,38 +6200,11 @@ void play_game(bool new_game)
        if (!load_player())
        {
                /* Oops */
-#ifdef JP
-quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
-#else
-               quit("broken savefile");
-#endif
-
+               quit(_("セーブファイルが壊れています", "broken savefile"));
        }
 
        /* Extract the options */
-       for (i = 0; option_info[i].o_desc; i++)
-       {
-               int os = option_info[i].o_set;
-               int ob = option_info[i].o_bit;
-
-               /* Set the "default" options */
-               if (option_info[i].o_var)
-               {
-                       /* Set */
-                       if (option_flag[os] & (1L << ob))
-                       {
-                               /* Set */
-                               (*option_info[i].o_var) = TRUE;
-                       }
-
-                       /* Clear */
-                       else
-                       {
-                               /* Clear */
-                               (*option_info[i].o_var) = FALSE;
-                       }
-               }
-       }
+       extract_option_vars();
 
        /* Report waited score */
        if (p_ptr->wait_report_score)
@@ -6602,11 +6212,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 */
@@ -6617,7 +6223,7 @@ quit("
 
                p_ptr->is_dead = TRUE;
 
-               start_time = time(NULL);
+               start_time = (u32b)time(NULL);
 
                /* No suspending now */
                signals_ignore_tstp();
@@ -6634,28 +6240,16 @@ quit("
                /* 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);
@@ -6669,6 +6263,8 @@ quit("
                quit(0);
        }
 
+       creating_savefile = new_game;
+
        /* Nothing loaded */
        if (!character_loaded)
        {
@@ -6679,17 +6275,17 @@ quit("
                character_dungeon = FALSE;
 
                /* Prepare to init the RNG */
-               Rand_quick = TRUE;
+               init_random_seed = TRUE;
 
                /* Initialize the saved floors data */
-               init_saved_floors();
+               init_saved_floors(FALSE);
        }
 
        /* Old game is loaded.  But new game is requested. */
        else if (new_game)
        {
-               /* Delete expanded temporal files */
-               clear_saved_floor_files();
+               /* Initialize the saved floors data */
+               init_saved_floors(TRUE);
        }
 
        /* Process old character */
@@ -6700,32 +6296,14 @@ 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 */
        if (new_game)
        {
-               monster_race *r_ptr;
-
                /* The dungeon is not ready */
                character_dungeon = FALSE;
 
@@ -6749,85 +6327,32 @@ quit("
                counts_write(2,0);
                p_ptr->count = 0;
 
-#ifdef JP
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶­¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
-#else
-               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
-#endif
-
                load = FALSE;
-               get_mon_num_prep(NULL, NULL);
-               for (i = 0; i < MAX_KUBI; i++)
-               {
-                       while (1)
-                       {
-                               int j;
-
-                               kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
-                               r_ptr = &r_info[kubi_r_idx[i]];
-
-                               if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
-
-                               if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
-                               if (r_ptr->rarity > 100) continue;
-
-                               if(r_ptr->flags6 & RF6_SPECIAL) continue;
-
-                               for (j = 0; j < i; j++)
-                                       if (kubi_r_idx[i] == kubi_r_idx[j])break;
-
-                               if (j == i) break;
-                       }
-               }
-               for (i = 0; i < MAX_KUBI -1; i++)
-               {
-                       int j,tmp;
-                       for (j = i; j < MAX_KUBI; j++)
-                       {
-                               if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
-                               {
-                                       tmp = kubi_r_idx[i];
-                                       kubi_r_idx[i] = kubi_r_idx[j];
-                                       kubi_r_idx[j] = tmp;
-                               }
-                       }
-               }
 
-               p_ptr->inside_battle = TRUE;
-               while (1)
-               {
-                       today_mon = get_mon_num(3);
-                       r_ptr = &r_info[today_mon];
+               determine_bounty_uniques();
+               determine_today_mon(FALSE);
 
-                       if (r_ptr->flags1 & RF1_UNIQUE) continue;
-                       if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
-                       if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
-                       if (r_ptr->rarity > 10) continue;
-                       if (r_ptr->level == 0) continue;
-                       break;
-               }
-               p_ptr->inside_battle = FALSE;
+               /* Initialize object array */
+               wipe_o_list();
        }
        else
        {
                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)
                {
                        p_ptr->riding = 0;
-                       for(i = m_max; i > 0; i--)
+                       for (i = m_max; i > 0; i--)
                        {
-                               if ((m_list[i].fy == py) && (m_list[i].fx == px))
+                               if (player_bold(m_list[i].fy, m_list[i].fx))
                                {
                                        p_ptr->riding = i;
                                        break;
@@ -6836,6 +6361,8 @@ quit("
                }
        }
 
+       creating_savefile = FALSE;
+
        p_ptr->teleport_town = FALSE;
        p_ptr->sutemi = FALSE;
        world_monster = FALSE;
@@ -6850,26 +6377,16 @@ quit("
 
        /* Sexy gal gets bonus to maximum weapon skill of whip */
        if (p_ptr->pseikaku == SEIKAKU_SEXY)
-               s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = WEAPON_EXP_MASTER;
+               s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
 
        /* Fill the arrays of floors and walls in the good proportions */
        set_floor_and_wall(dungeon_type);
 
        /* Flavor the objects */
        flavor_init();
-       if (new_game)
-       {
-               wipe_o_list();
-               player_outfit();
-       }
 
        /* 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();
@@ -6878,8 +6395,26 @@ prt("
        /* Hack -- Enter wizard mode */
        if (arg_wizard)
        {
-               if (enter_wizard_mode()) p_ptr->wizard = TRUE;
-               else if (p_ptr->is_dead) quit("Already dead.");
+               if (enter_wizard_mode())
+               {
+                       p_ptr->wizard = TRUE;
+
+                       if (p_ptr->is_dead || !p_ptr->y || !p_ptr->x)
+                       {
+                               /* Initialize the saved floors data */
+                               init_saved_floors(TRUE);
+
+                               /* Avoid crash */
+                               p_ptr->inside_quest = 0;
+
+                               /* Avoid crash in update_view() */
+                               p_ptr->y = p_ptr->x = 10;
+                       }
+               }
+               else if (p_ptr->is_dead)
+               {
+                       quit("Already dead.");
+               }
        }
 
        /* Initialize the town-buildings if necessary */
@@ -6894,12 +6429,35 @@ prt("
 
                process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
 
+               select_floor_music();
        }
 
 
        /* Generate a dungeon level if needed */
-       if (!character_dungeon) change_floor();
+       if (!character_dungeon)
+       {
+               change_floor();
+       }
+
+       else
+       {
+               /* HACK -- Restore from panic-save */
+               if (p_ptr->panic_save)
+               {
+                       /* No player?  -- Try to regenerate floor */
+                       if (!p_ptr->y || !p_ptr->x)
+                       {
+                               msg_print(_("プレイヤーの位置がおかしい。フロアを再生成します。", "What a strange player location.  Regenerate the dungeon floor."));
+                               change_floor();
+                       }
 
+                       /* Still no player?  -- Try to locate random place */
+                       if (!p_ptr->y || !p_ptr->x) p_ptr->y = p_ptr->x = 10;
+
+                       /* No longer in panic */
+                       p_ptr->panic_save = 0;
+               }
+       }
 
        /* Character is now "complete" */
        character_generated = TRUE;
@@ -6909,6 +6467,14 @@ prt("
        character_icky = FALSE;
 
 
+       if (new_game)
+       {
+               char buf[80];
+               sprintf(buf, _("%sに降り立った。", "You are standing in the %s."), map_name());
+               do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
+       }
+
+
        /* Start game */
        p_ptr->playing = TRUE;
 
@@ -6918,6 +6484,12 @@ prt("
        /* Load the "pref" files */
        load_all_pref_files();
 
+       /* Give startup outfit (after loading pref files) */
+       if (new_game)
+       {
+               player_outfit();
+       }
+
        /* React to changes */
        Term_xtra(TERM_XTRA_REACT, 0);
 
@@ -6943,18 +6515,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)
        {
@@ -6964,9 +6542,14 @@ prt("
                /* Handle "p_ptr->notice" */
                notice_stuff();
 
+               /* Hack -- prevent "icky" message */
+               character_xtra = TRUE;
+
                /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
                handle_stuff();
 
+               character_xtra = FALSE;
+
                /* Cancel the target */
                target_who = 0;
 
@@ -7002,25 +6585,26 @@ prt("
                        if (p_ptr->inside_arena)
                        {
                                p_ptr->inside_arena = FALSE;
-                               if(p_ptr->arena_number > MAX_ARENA_MONS)
+                               if (p_ptr->arena_number > MAX_ARENA_MONS)
                                        p_ptr->arena_number++;
                                else
-                                       p_ptr->arena_number = 99;
+                                       p_ptr->arena_number = -1 - p_ptr->arena_number;
                                p_ptr->is_dead = FALSE;
                                p_ptr->chp = 0;
                                p_ptr->chp_frac = 0;
                                p_ptr->exit_bldg = TRUE;
                                reset_tim_flags();
+
+                               /* Leave through the exit */
+                               prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
+
+                               /* prepare next floor */
+                               leave_floor();
                        }
                        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;
@@ -7032,13 +6616,7 @@ if ((p_ptr->wizard || cheat_live) && !get_check("
                                        p_ptr->noscore |= 0x0001;
 
                                        /* Message */
-#ifdef JP
-msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
-#else
-                                       msg_print("You invoke wizard mode and cheat death.");
-#endif
-                                       wipe_m_list();
-
+                                       msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
                                        msg_print(NULL);
 
                                        /* Restore hit points */
@@ -7047,42 +6625,25 @@ msg_print("
 
                                        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;
 
-                                       /* 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);
-
                                        /* Hack -- cancel recall */
                                        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 */
@@ -7099,22 +6660,30 @@ msg_print("ĥ
                                        }
 
                                        /* 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);
+
                                        dun_level = 0;
                                        p_ptr->inside_arena = FALSE;
                                        p_ptr->inside_battle = FALSE;
                                        leaving_quest = 0;
                                        p_ptr->inside_quest = 0;
-                                       p_ptr->recall_dungeon = dungeon_type;
+                                       if (dungeon_type) p_ptr->recall_dungeon = dungeon_type;
                                        dungeon_type = 0;
                                        if (lite_town || vanilla_town)
                                        {
@@ -7143,11 +6712,13 @@ msg_print("ĥ
                                        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();
+                                       wipe_m_list();
                                }
                        }
                }
@@ -7166,6 +6737,12 @@ msg_print("ĥ
        quit(NULL);
 }
 
+/*!
+ * @brief ゲームターンからの実時間換算を行うための補正をかける
+ * @param hoge ゲームターン
+ * @details アンデッド種族は18:00からゲームを開始するので、この修正を予め行う。
+ * @return 修正をかけた後のゲームターン
+ */
 s32b turn_real(s32b hoge)
 {
        switch (p_ptr->start_race)
@@ -7179,3 +6756,48 @@ s32b turn_real(s32b hoge)
                return hoge;
        }
 }
+
+/*!
+ * @brief ターンのオーバーフローに対する対処
+ * @details ターン及びターンを記録する変数をターンの限界の1日前まで巻き戻す.
+ * @return 修正をかけた後のゲームターン
+ */
+void prevent_turn_overflow(void)
+{
+       int rollback_days, i, j;
+       s32b rollback_turns;
+
+       if (turn < turn_limit) return;
+
+       rollback_days = 1 + (turn - turn_limit) / (TURNS_PER_TICK * TOWN_DAWN);
+       rollback_turns = TURNS_PER_TICK * TOWN_DAWN * rollback_days;
+
+       if (turn > rollback_turns) turn -= rollback_turns;
+       else turn = 1; /* Paranoia */
+       if (old_turn > rollback_turns) old_turn -= rollback_turns;
+       else old_turn = 1;
+       if (old_battle > rollback_turns) old_battle -= rollback_turns;
+       else old_battle = 1;
+       if (p_ptr->feeling_turn > rollback_turns) p_ptr->feeling_turn -= rollback_turns;
+       else p_ptr->feeling_turn = 1;
+
+       for (i = 1; i < max_towns; i++)
+       {
+               for (j = 0; j < MAX_STORES; j++)
+               {
+                       store_type *st_ptr = &town[i].store[j];
+
+                       if (st_ptr->last_visit > -10L * TURNS_PER_TICK * STORE_TICKS)
+                       {
+                               st_ptr->last_visit -= rollback_turns;
+                               if (st_ptr->last_visit < -10L * TURNS_PER_TICK * STORE_TICKS) st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
+                       }
+
+                       if (st_ptr->store_open)
+                       {
+                               st_ptr->store_open -= rollback_turns;
+                               if (st_ptr->store_open < 1) st_ptr->store_open = 1;
+                       }
+               }
+       }
+}