OSDN Git Service

[Refactor] #37353 notice_stuff() の直接呼出しを抑止。 / Forbid call of notice_stuff() except...
[hengband/hengband.git] / src / dungeon.c
index f2ee0e4..2f77d8b 100644 (file)
 #include "cmd-zaprod.h"
 #include "cmd-zapwand.h"
 #include "cmd-pet.h"
+#include "floor-events.h"
+#include "object-curse.h"
+#include "store.h"
+#include "monsterrace-hook.h"
 
 static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
 static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
@@ -99,7 +103,7 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
        }
 
        /* Stop everything */
-       if (disturb_minor) disturb(0, 0);
+       if (disturb_minor) disturb(FALSE, FALSE);
 
        /* Get an object description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -108,8 +112,8 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
        if (slot >= INVEN_RARM)
        {
 #ifdef JP
-msg_format("%s%s(%c)は%sという感じがする...",
-describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
+               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...",
                           o_name, index_to_label(slot), describe_use(slot),
@@ -123,8 +127,8 @@ describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
        else
        {
 #ifdef JP
-msg_format("ザックの中の%s(%c)は%sという感じがする...",
-o_name, index_to_label(slot),game_inscriptions[feel]);
+               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...",
                           o_name, index_to_label(slot),
@@ -146,7 +150,6 @@ o_name, index_to_label(slot),game_inscriptions[feel]);
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP);
 }
 
@@ -192,7 +195,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -204,7 +206,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -216,7 +217,6 @@ static void sense_inventory1(void)
                        /* Very bad (light) sensing */
                        if (0 != randint0(240000L / (plev + 5))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -226,7 +226,6 @@ static void sense_inventory1(void)
                        /* Good (light) sensing */
                        if (0 != randint0(10000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -239,7 +238,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -251,7 +249,6 @@ static void sense_inventory1(void)
                        /* Changed! */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -264,7 +261,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -274,7 +270,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(75000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -286,7 +281,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(55000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -298,7 +292,6 @@ static void sense_inventory1(void)
                        /* Changed! */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -308,7 +301,6 @@ static void sense_inventory1(void)
                        /* Okay sensing */
                        if (0 != randint0(20000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -320,7 +312,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -329,7 +320,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(65000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
                case CLASS_BERSERKER:
@@ -337,7 +327,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
        }
@@ -438,7 +427,6 @@ static void sense_inventory2(void)
                        /* Very bad (light) sensing */
                        if (0 != randint0(240000L / (plev + 5))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -450,7 +438,6 @@ static void sense_inventory2(void)
                        /* Bad sensing */
                        if (0 != randint0(95000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -463,7 +450,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(20000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -477,7 +463,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(9000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -486,7 +471,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
 
-                       /* Done */
                        break;
                }
        }
@@ -719,9 +703,9 @@ static bool pattern_effect(void)
  */
 static void regenhp(int percent)
 {
-       s32b new_chp;
+       HIT_POINT new_chp;
        u32b new_chp_frac;
-       s32b old_chp;
+       HIT_POINT old_chp;
 
        if (p_ptr->special_defense & KATA_KOUKIJIN) return;
        if (p_ptr->action == ACTION_HAYAGAKE) return;
@@ -754,12 +738,8 @@ static void regenhp(int percent)
        /* Notice changes */
        if (old_chp != p_ptr->chp)
        {
-               /* Redraw */
                p_ptr->redraw |= (PR_HP);
-
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
-
                wild_regen = 20;
        }
 }
@@ -771,9 +751,9 @@ static void regenhp(int percent)
  * @param regen_amount 回復量
  * @return なし
  */
-static void regenmana(int upkeep_factor, int regen_amount)
+static void regenmana(MANA_POINT upkeep_factor, MANA_POINT regen_amount)
 {
-       s32b old_csp = p_ptr->csp;
+       MANA_POINT old_csp = p_ptr->csp;
        s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL;
 
        /*
@@ -804,7 +784,7 @@ static void regenmana(int upkeep_factor, int regen_amount)
        else if (regen_rate > 0)
        {
                /* (percent/100) is the Regen factor in unit (1/2^16) */
-               s32b new_mana = 0;
+               MANA_POINT 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) */
@@ -843,17 +823,11 @@ static void regenmana(int upkeep_factor, int regen_amount)
                }
        }
 
-
-       /* Redraw mana */
        if (old_csp != p_ptr->csp)
        {
-               /* Redraw */
                p_ptr->redraw |= (PR_MANA);
-
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
                p_ptr->window |= (PW_SPELL);
-
                wild_regen = 20;
        }
 }
@@ -865,7 +839,7 @@ static void regenmana(int upkeep_factor, int regen_amount)
  */
 static void regenmagic(int regen_amount)
 {
-       s32b new_mana;
+       MANA_POINT 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 */
@@ -906,7 +880,7 @@ static void regenmagic(int regen_amount)
 /*!
  * @brief 100ゲームターン毎のモンスターのHP自然回復処理 / Regenerate the monsters (once per 100 game turns)
  * @return なし
- * @note XXX XXX XXX Should probably be done during monster turns.
+ * @note Should probably be done during monster turns.
  */
 static void regen_monsters(void)
 {
@@ -953,7 +927,7 @@ static void regen_monsters(void)
 /*!
  * @brief 30ゲームターン毎のボール中モンスターのHP自然回復処理 / Regenerate the captured monsters (once per 30 game turns)
  * @return なし
- * @note XXX XXX XXX Should probably be done during monster turns.
+ * @note Should probably be done during monster turns.
  */
 static void regen_captured_monsters(void)
 {
@@ -998,8 +972,6 @@ static void regen_captured_monsters(void)
        {
                /* Combine pack */
                p_ptr->notice |= (PN_COMBINE);
-
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN);
                p_ptr->window |= (PW_EQUIP);
                wild_regen = 20;
@@ -1016,7 +988,6 @@ 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);
        }
 
@@ -1030,7 +1001,7 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is now out */
        else if (o_ptr->xtra4 == 0)
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("明かりが消えてしまった!", "Your light has gone out!"));
 
                /* Recalculate torch radius */
@@ -1046,7 +1017,7 @@ static void notice_lite_change(object_type *o_ptr)
                if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
                    && (turn % (TURNS_PER_TICK*2)))
                {
-                       if (disturb_minor) disturb(0, 1);
+                       if (disturb_minor) disturb(FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
                }
        }
@@ -1054,7 +1025,7 @@ static void notice_lite_change(object_type *o_ptr)
        /* The light is getting dim */
        else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
        {
-               if (disturb_minor) disturb(0, 1);
+               if (disturb_minor) disturb(FALSE, TRUE);
                        msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
        }
 }
@@ -1171,7 +1142,7 @@ static void recharged_notice(object_type *o_ptr)
                                msg_format("Your %s is recharged.", o_name);
 #endif
 
-                       disturb(0, 0);
+                       disturb(FALSE, FALSE);
 
                        /* Done. */
                        return;
@@ -1190,7 +1161,7 @@ static void check_music(void)
 {
        const magic_type *s_ptr;
        int spell;
-       s32b need_mana;
+       MANA_POINT need_mana;
        u32b need_mana_frac;
 
        /* Music singed by player */
@@ -1234,11 +1205,8 @@ static void check_music(void)
 
                        /* Redraw map and status bar */
                        p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1261,7 +1229,7 @@ static void check_music(void)
  * @return 該当の呪いが一つでもあった場合にランダムに選ばれた装備品のオブジェクト構造体参照ポインタを返す。\n
  * 呪いがない場合NULLを返す。
  */
-static object_type *choose_cursed_obj_name(u32b flag)
+static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
 {
        int i;
        int choices[INVEN_TOTAL-INVEN_RARM];
@@ -1295,8 +1263,8 @@ static object_type *choose_cursed_obj_name(u32b flag)
                                        (flag == TRC_FAST_DIGEST) || 
                                        (flag == TRC_SLOW_REGEN) )
                {
-                       u32b cf;
-                       u32b flgs[TR_FLAG_SIZE];
+                       u32b cf = 0L;
+                       BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_flags(o_ptr, flgs);
                        switch (flag)
                        {
@@ -1328,6 +1296,70 @@ static object_type *choose_cursed_obj_name(u32b flag)
        return (&inventory[choices[randint0(number)]]);
 }
 
+static void process_world_aux_digestion(void)
+{
+       if (!p_ptr->inside_battle)
+       {
+               /* Digest quickly when gorged */
+               if (p_ptr->food >= PY_FOOD_MAX)
+               {
+                       /* Digest a lot of food */
+                       (void)set_food(p_ptr->food - 100);
+               }
+
+               /* 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);
+
+                       /* 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;
+
+                       /* Slow digestion takes less food */
+                       if (p_ptr->slow_digest)
+                               digestion -= 5;
+
+                       /* Minimal digestion */
+                       if (digestion < 1) digestion = 1;
+                       /* Maximal digestion */
+                       if (digestion > 100) digestion = 100;
+
+                       /* Digest some food */
+                       (void)set_food(p_ptr->food - digestion);
+               }
+
+
+               /* Getting Faint */
+               if ((p_ptr->food < PY_FOOD_FAINT))
+               {
+                       /* Faint occasionally */
+                       if (!p_ptr->paralyzed && (randint0(100) < 10))
+                       {
+                               msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food."));
+                               disturb(TRUE, TRUE);
+
+                               /* Hack -- faint (bypass free action) */
+                               (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
+                       }
+
+                       /* Starve to death (slowly) */
+                       if (p_ptr->food < PY_FOOD_STARVE)
+                       {
+                               /* Calculate damage */
+                               HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
+
+                               if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
+                       }
+               }
+       }
+}
+
 /*!
  * @brief 10ゲームターンが進行するごとにプレイヤーのHPとMPの増減処理を行う。
  *  / Handle timed damage and regeneration every 10 game turns
@@ -1348,7 +1380,6 @@ static void process_world_aux_hp_and_sp(void)
        /* Take damage from poison */
        if (p_ptr->poisoned && !IS_INVULN())
        {
-               /* Take damage */
                take_hit(DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1);
        }
 
@@ -1395,11 +1426,9 @@ static void process_world_aux_hp_and_sp(void)
                        dam = 1;
                }
 
-               /* Take damage */
                take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
        }
 
-
        /* (Vampires) Take damage from sunlight */
        if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
        {
@@ -1407,10 +1436,8 @@ static void process_world_aux_hp_and_sp(void)
                {
                        if ((cave[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
                        {
-                               /* Take damage */
                                msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
                                take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
-
                                cave_no_regen = TRUE;
                        }
                }
@@ -1451,11 +1478,10 @@ static void process_world_aux_hp_and_sp(void)
 
                if (damage)
                {
-                       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;
+                       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));
 
@@ -1481,7 +1507,6 @@ static void process_world_aux_hp_and_sp(void)
        {
                if (p_ptr->total_weight > weight_limit())
                {
-                       /* Take damage */
                        msg_print(_("溺れている!", "You are drowning!"));
                        take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
                        cave_no_regen = TRUE;
@@ -1490,7 +1515,7 @@ static void process_world_aux_hp_and_sp(void)
 
        if (p_ptr->riding)
        {
-               int damage;
+               HIT_POINT damage;
                if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
                {
                        damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
@@ -1528,11 +1553,9 @@ static void process_world_aux_hp_and_sp(void)
         */
        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
        {
-               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke &&
-                   ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
+               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke && ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
                {
                        cptr dam_desc;
-
                        cave_no_regen = TRUE;
 
                        if (p_ptr->pass_wall)
@@ -2010,13 +2033,11 @@ static void process_world_aux_mutation(void)
        /* No effect on the global map */
        if (p_ptr->wild_mode) return;
 
-
        if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("ウガァァア!", "RAAAAGHH!"));
                msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
-
                (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
                (void)set_afraid(0);
        }
@@ -2025,7 +2046,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_fear)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
                        set_afraid(p_ptr->afraid + 13 + randint1(26));
                }
@@ -2033,12 +2054,9 @@ static void process_world_aux_mutation(void)
 
        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_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele)
                {
-                       disturb(0, 1);
-
-                       /* Teleport player */
+                       disturb(FALSE, TRUE);
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2049,7 +2067,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        p_ptr->redraw |= PR_EXTRA;
                        msg_print(_("いひきがもーろーとひてきたきがふる...ヒック!", "You feel a SSSCHtupor cOmINg over yOu... *HIC*!"));
                }
@@ -2086,7 +2104,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_chaos)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        p_ptr->redraw |= PR_EXTRA;
                        (void)set_image(p_ptr->image + randint0(50) + 20);
                }
@@ -2094,10 +2112,8 @@ static void process_world_aux_mutation(void)
 
        if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
        {
-               disturb(0, 1);
-
+               disturb(FALSE, TRUE);
                msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
-
                msg_print(NULL);
                fire_ball(GF_POIS, 0, p_ptr->lev, 3);
        }
@@ -2106,7 +2122,7 @@ static void process_world_aux_mutation(void)
            !p_ptr->anti_magic && one_in_(9000))
        {
                int dire = 0;
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!", 
                                                "Magical energy flows through you! You must release it!"));
 
@@ -2116,8 +2132,7 @@ static void process_world_aux_mutation(void)
                fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
        }
 
-       if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
-           !p_ptr->anti_magic && (randint1(6666) == 666))
+       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;
@@ -2125,17 +2140,16 @@ static void process_world_aux_mutation(void)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x,
-                                   dun_level, SUMMON_DEMON, mode))
+               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
        if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                if (one_in_(2))
                {
                        msg_print(_("精力的でなくなった気がする。", "You feel less energetic."));
@@ -2166,7 +2180,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
 
                banish_monsters(100);
@@ -2227,8 +2241,7 @@ static void process_world_aux_mutation(void)
                unlite_area(50, 10);
        }
 
-       if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
-           !p_ptr->anti_magic && one_in_(7000))
+       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;
@@ -2239,14 +2252,13 @@ static void process_world_aux_mutation(void)
                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);
+                       disturb(FALSE, TRUE);
                }
        }
 
-       if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
-           !p_ptr->anti_magic && one_in_(8000))
+       if ((p_ptr->muta2 & MUT2_RAW_CHAOS) && !p_ptr->anti_magic && one_in_(8000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
 
                msg_print(NULL);
@@ -2259,7 +2271,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("非物質化した!", "You feel insubstantial!"));
 
                msg_print(NULL);
@@ -2271,7 +2283,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
        {
-               int which_stat = randint0(6);
+               int which_stat = randint0(A_MAX);
                int sustained = FALSE;
 
                switch (which_stat)
@@ -2301,14 +2313,13 @@ static void process_world_aux_mutation(void)
 
                if (!sustained)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("自分が衰弱していくのが分かる!", "You can feel yourself wasting away!"));
                        msg_print(NULL);
                        (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
                }
        }
-       if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
-           !p_ptr->anti_magic && one_in_(3000))
+       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;
@@ -2319,11 +2330,10 @@ static void process_world_aux_mutation(void)
                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);
+                       disturb(FALSE, TRUE);
                }
        }
-       if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
-           one_in_(3000))
+       if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic && one_in_(3000))
        {
                if (p_ptr->tim_esp > 0)
                {
@@ -2336,10 +2346,9 @@ static void process_world_aux_mutation(void)
                        set_tim_esp(p_ptr->lev, FALSE);
                }
        }
-       if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
-           one_in_(9000))
+       if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!"));
                msg_print(NULL);
                set_food(PY_FOOD_WEAK);
@@ -2347,8 +2356,7 @@ static void process_world_aux_mutation(void)
                if (hex_spelling_any()) stop_hex_spell_all();
        }
 
-       if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
-           !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
+       if ((p_ptr->muta2 & MUT2_WALK_SHAD) && !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
        {
                alter_reality();
        }
@@ -2356,12 +2364,12 @@ static void process_world_aux_mutation(void)
        if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
        {
                int danger_amount = 0;
-               int monster;
+               MONSTER_IDX monster;
 
                for (monster = 0; monster < m_max; monster++)
                {
-                       monster_type    *m_ptr = &m_list[monster];
-                       monster_race    *r_ptr = &r_info[m_ptr->r_idx];
+                       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;
@@ -2385,61 +2393,51 @@ static void process_world_aux_mutation(void)
                else
                        msg_print(_("寂しい気がする。", "You feel lonely."));
        }
-       if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
-           one_in_(5000))
+
+       if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic && one_in_(5000))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                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;
+               MANA_POINT wounds = (MANA_POINT)(p_ptr->mhp - p_ptr->chp);
 
                if (wounds > 0)
                {
-                       int healing = p_ptr->csp;
-
-                       if (healing > wounds)
-                       {
-                               healing = wounds;
-                       }
+                       HIT_POINT healing = p_ptr->csp;
+                       if (healing > wounds) healing = wounds;
 
                        hp_player(healing);
                        p_ptr->csp -= healing;
-
-                       /* Redraw mana */
-                       p_ptr->redraw |= (PR_MANA);
+                       p_ptr->redraw |= (PR_HP | PR_MANA);
                }
        }
-       if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
-           one_in_(4000))
+
+       if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic && one_in_(4000))
        {
-               int wounds = p_ptr->msp - p_ptr->csp;
+               HIT_POINT wounds = (HIT_POINT)(p_ptr->msp - p_ptr->csp);
 
                if (wounds > 0)
                {
-                       int healing = p_ptr->chp;
-
-                       if (healing > wounds)
-                       {
-                               healing = wounds;
-                       }
+                       HIT_POINT healing = p_ptr->chp;
+                       if (healing > wounds) healing = wounds;
 
                        p_ptr->csp += healing;
-
-                       /* Redraw mana */
-                       p_ptr->redraw |= (PR_MANA);
+                       p_ptr->redraw |= (PR_HP | PR_MANA);
                        take_hit(DAMAGE_LOSELIFE, healing, _("頭に昇った血", "blood rushing to the head"), -1);
                }
        }
+
        if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
        {
                INVENTORY_IDX slot = 0;
                object_type *o_ptr = NULL;
 
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
                take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
 
@@ -2460,13 +2458,13 @@ static void process_world_aux_mutation(void)
                        o_ptr = &inventory[INVEN_LARM];
                        slot = INVEN_LARM;
                }
-
                if (slot && !object_is_cursed(o_ptr))
                {
                        msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
                        inven_drop(slot, 1);
                }
        }
+
 }
 
 /*!
@@ -2491,7 +2489,7 @@ static void process_world_aux_curse(void)
                        /* Scan the equipment with random teleport ability */
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
                        {
-                               u32b flgs[TR_FLAG_SIZE];
+                               BIT_FLAGS flgs[TR_FLAG_SIZE];
                                o_ptr = &inventory[i];
 
                                /* Skip non-objects */
@@ -2516,14 +2514,14 @@ static void process_world_aux_curse(void)
                        msg_format(_("%sがテレポートの能力を発動させようとしている。", "Your %s is activating teleportation."), o_name);
                        if (get_check_strict(_("テレポートしますか?", "Teleport? "), CHECK_OKAY_CANCEL))
                        {
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                                teleport_player(50, 0L);
                        }
                        else
                        {
                                msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。", 
                                                         "You can inscribe {.} on your %s to disable random teleportation. "), o_name);
-                               disturb(1, 1);
+                               disturb(TRUE, TRUE);
                        }
                }
                /* Make a chainsword noise */
@@ -2541,19 +2539,18 @@ static void process_world_aux_curse(void)
                        (void)activate_ty_curse(FALSE, &count);
                }
                /* Handle experience draining */
-               if (p_ptr->prace != RACE_ANDROID && 
-                       ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
+               if (p_ptr->prace != RACE_ANDROID && ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
                {
-                       p_ptr->exp -= (p_ptr->lev+1)/2;
+                       p_ptr->exp -= (p_ptr->lev + 1) / 2;
                        if (p_ptr->exp < 0) p_ptr->exp = 0;
-                       p_ptr->max_exp -= (p_ptr->lev+1)/2;
+                       p_ptr->max_exp -= (p_ptr->lev + 1) / 2;
                        if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
                        check_experience();
                }
                /* Add light curse (Later) */
                if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
                {
-                       u32b new_curse;
+                       BIT_FLAGS new_curse;
                        object_type *o_ptr;
 
                        o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
@@ -2576,7 +2573,7 @@ static void process_world_aux_curse(void)
                /* Add heavy curse (Later) */
                if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
                {
-                       u32b new_curse;
+                       BIT_FLAGS new_curse;
                        object_type *o_ptr;
 
                        o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
@@ -2605,7 +2602,7 @@ static void process_world_aux_curse(void)
 
                                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);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call demon */
@@ -2617,7 +2614,7 @@ static void process_world_aux_curse(void)
 
                                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);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call dragon */
@@ -2630,7 +2627,7 @@ static void process_world_aux_curse(void)
 
                                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);
+                               disturb(FALSE, TRUE);
                        }
                }
                /* Call undead */
@@ -2643,14 +2640,14 @@ static void process_world_aux_curse(void)
 
                                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);
+                               disturb(FALSE, TRUE);
                        }
                }
                if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
                {
                        if (!p_ptr->resist_fear)
                        {
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
                                msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
                                set_afraid(p_ptr->afraid + 13 + randint1(26));
                        }
@@ -2658,7 +2655,7 @@ static void process_world_aux_curse(void)
                /* Teleport player */
                if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Teleport player */
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2696,19 +2693,11 @@ static void process_world_aux_curse(void)
 
                if (o_ptr->name1 == ART_JUDGE)
                {
-#ifdef JP
-                       if (object_is_known(o_ptr))
-                               msg_print("『審判の宝石』はあなたの体力を吸収した!");
-                       else
-                               msg_print("なにかがあなたの体力を吸収した!");
-                       take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "審判の宝石", -1);
-#else
                        if (object_is_known(o_ptr))
-                               msg_print("The Jewel of Judgement drains life from you!");
+                               msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!"));
                        else
-                               msg_print("Something drains life from you!");
-                       take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
-#endif
+                               msg_print(_("なにかがあなたの体力を吸収した!", "Something drains life from you!"));
+                       take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), _("審判の宝石", "the Jewel of Judgement"), -1);
                }
        }
 }
@@ -2751,7 +2740,6 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               /* Window stuff */
                p_ptr->window |= (PW_EQUIP);
                wild_regen = 20;
        }
@@ -2800,7 +2788,6 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN);
                wild_regen = 20;
        }
@@ -2854,13 +2841,12 @@ static void process_world_aux_movement(void)
                if (!p_ptr->word_recall)
                {
                        /* Disturbing! */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Determine the level */
                        if (dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon)
                        {
-                               msg_print(_("上に引っ張りあげられる感じがする!",
-                                                       "You feel yourself yanked upwards!"));
+                               msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
 
                                if (dungeon_type) p_ptr->recall_dungeon = dungeon_type;
                                if (record_stair)
@@ -2878,8 +2864,7 @@ static void process_world_aux_movement(void)
                        }
                        else
                        {
-                               msg_print(_("下に引きずり降ろされる感じがする!",
-                                                       "You feel yourself yanked downwards!"));
+                               msg_print(_("下に引きずり降ろされる感じがする!", "You feel yourself yanked downwards!"));
 
                                dungeon_type = p_ptr->recall_dungeon;
 
@@ -2952,7 +2937,6 @@ static void process_world_aux_movement(void)
                                }
                        }
 
-                       /* Sound */
                        sound(SOUND_TPLEVEL);
                }
        }
@@ -2973,7 +2957,7 @@ static void process_world_aux_movement(void)
                if (!p_ptr->alter_reality)
                {
                        /* Disturbing! */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        /* Determine the level */
                        if (!quest_number(dun_level) && dun_level)
@@ -2994,7 +2978,6 @@ static void process_world_aux_movement(void)
                                msg_print(_("世界が少しの間変化したようだ。", "The world seems to change for a moment!"));
                        }
 
-                       /* Sound */
                        sound(SOUND_TPLEVEL);
                }
        }
@@ -3010,8 +2993,8 @@ static void process_world_aux_movement(void)
 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;
+       POSITION my = m_ptr->fy;
+       POSITION mx = m_ptr->fx;
        int i;
        int count = 0;
 
@@ -3130,7 +3113,7 @@ static byte get_dungeon_feeling(void)
                /* Artifacts */
                if (object_is_artifact(o_ptr))
                {
-                       s32b cost = object_value_real(o_ptr);
+                       PRICE cost = object_value_real(o_ptr);
 
                        delta += 10 * base;
                        if (cost > 10000L) delta += 10 * base;
@@ -3142,27 +3125,16 @@ static byte get_dungeon_feeling(void)
                }
 
                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;
+               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)
+               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;
@@ -3237,8 +3209,7 @@ static void update_dungeon_feeling(void)
        /* Update the level indicator */
        p_ptr->redraw |= (PR_DEPTH);
 
-       /* Disturb */
-       if (disturb_minor) disturb(0, 0);
+       if (disturb_minor) disturb(FALSE, FALSE);
 }
 
 /*!
@@ -3345,13 +3316,11 @@ static void process_world(void)
                        /* Warning */
                        if (closing_flag <= 2)
                        {
-                               /* Disturb */
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
 
                                /* Count warnings */
                                closing_flag++;
 
-                               /* Message */
                                msg_print(_("アングバンドへの門が閉じかかっています...", "The gates to ANGBAND are closing..."));
                                msg_print(_("ゲームを終了するかセーブするかして下さい。", "Please finish up and/or save your game."));
 
@@ -3360,7 +3329,6 @@ static void process_world(void)
                        /* Slam the gate */
                        else
                        {
-                               /* Message */
                                msg_print(_("今、アングバンドへの門が閉ざされました。", "The gates to ANGBAND are now closed."));
 
                                /* Stop playing */
@@ -3397,94 +3365,9 @@ static void process_world(void)
                        /* 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);
+                       if (dawn) day_break();
+                       else night_falls();
 
-                       /* 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);
-                       }
                }
        }
 
@@ -3499,7 +3382,8 @@ static void process_world(void)
                        /* Sometimes, shuffle the shop-keepers */
                        if (one_in_(STORE_SHUFFLE))
                        {
-                               int n, i;
+                               int n;
+                               FEAT_IDX i;
 
                                /* Pick a random shop (except home and museum) */
                                do
@@ -3523,7 +3407,6 @@ static void process_world(void)
                                        /* 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 */
@@ -3548,8 +3431,8 @@ static void process_world(void)
        }
 
        /* 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 (!(turn % (TURNS_PER_TICK * 10)) && !p_ptr->inside_battle) regen_monsters();
+       if (!(turn % (TURNS_PER_TICK * 3))) regen_captured_monsters();
 
        if (!p_ptr->leaving)
        {
@@ -3585,7 +3468,7 @@ static void process_world(void)
                if ((hour == 23) && !(min % 15))
                {
                        /* Disturbing */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        switch (min / 15)
                        {
@@ -3611,7 +3494,7 @@ static void process_world(void)
                if (!hour && !min)
                {
 
-                       disturb(1, 1);
+                       disturb(TRUE, TRUE);
                        msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
 
                        if (p_ptr->wild_mode)
@@ -3633,72 +3516,9 @@ static void process_world(void)
        }
 
 
-       /*** Check the Food, and Regenerate ***/
-
-       if (!p_ptr->inside_battle)
-       {
-               /* Digest quickly when gorged */
-               if (p_ptr->food >= PY_FOOD_MAX)
-               {
-                       /* Digest a lot of food */
-                       (void)set_food(p_ptr->food - 100);
-               }
-
-               /* 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);
-
-                       /* 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;
-
-                       /* Slow digestion takes less food */
-                       if (p_ptr->slow_digest)
-                               digestion -= 5;
-
-                       /* Minimal digestion */
-                       if (digestion < 1) digestion = 1;
-                       /* Maximal digestion */
-                       if (digestion > 100) digestion = 100;
-
-                       /* Digest some food */
-                       (void)set_food(p_ptr->food - digestion);
-               }
-
-
-               /* Getting Faint */
-               if ((p_ptr->food < PY_FOOD_FAINT))
-               {
-                       /* Faint occasionally */
-                       if (!p_ptr->paralyzed && (randint0(100) < 10))
-                       {
-                               /* 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));
-                       }
-
-                       /* 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);
-                       }
-               }
-       }
-
 
+       /* Check the Food */
+       process_world_aux_digestion();
 
        /* Process timed damage and regeneration */
        process_world_aux_hp_and_sp();
@@ -3856,20 +3676,16 @@ extern void do_cmd_borg(void);
 /*!
  * @brief プレイヤーから受けた入力コマンドの分岐処理。
  * / Parse and execute the current command Give "Warning" on illegal commands.
- * @todo XXX XXX XXX Make some "blocks"
+ * @todo Make some "blocks"
  * @return なし
  */
 static void process_command(void)
 {
        COMMAND_CODE old_now_message = now_message;
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        /* Handle repeating the last command */
        repeat_check();
 
-#endif /* ALLOW_REPEAT -- TNB */
-
        now_message = 0;
 
        /* Sniper */
@@ -3908,8 +3724,6 @@ static void process_command(void)
                                p_ptr->wizard = TRUE;
                                msg_print(_("ウィザードモード突入。", "Wizard mode on."));
                        }
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
                        /* Redraw "title" */
@@ -4034,32 +3848,14 @@ static void process_command(void)
                /* Move (usually pick up things) */
                case ';':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
                /* Move (usually do not pick up) */
                case '-':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(TRUE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(!always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
@@ -4775,22 +4571,19 @@ static void pack_overflow(void)
                object_type *o_ptr;
 
                /* Is auto-destroy done? */
-               notice_stuff();
+               handle_stuff();
                if (!inventory[INVEN_PACK].k_idx) return;
 
                /* Access the slot to be dropped */
                o_ptr = &inventory[INVEN_PACK];
 
                /* Disturbing */
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                /* 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 */
@@ -4801,10 +4594,6 @@ static void pack_overflow(void)
                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();
        }
 }
@@ -4877,9 +4666,7 @@ static void process_player(void)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                }
                prt_time();
        }
@@ -4930,7 +4717,6 @@ static void process_player(void)
 
        if (p_ptr->action == ACTION_FISH)
        {
-               /* Delay */
                Term_xtra(TERM_XTRA_DELAY, 10);
                if (one_in_(1000))
                {
@@ -4941,9 +4727,9 @@ static void process_player(void)
                        msg_print(NULL);
                        if (r_idx && one_in_(2))
                        {
-                               int y, x;
-                               y = p_ptr->y+ddy[tsuri_dir];
-                               x = p_ptr->x+ddx[tsuri_dir];
+                               POSITION y, x;
+                               y = p_ptr->y + ddy[p_ptr->fishing_dir];
+                               x = p_ptr->x + ddx[p_ptr->fishing_dir];
                                if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
                                {
                                        char m_name[80];
@@ -4956,7 +4742,7 @@ static void process_player(void)
                        {
                                msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn!  The fish stole your bait!"));
                        }
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
@@ -4972,11 +4758,9 @@ static void process_player(void)
                        /* Check for a key */
                        if (inkey())
                        {
-                               /* Flush input */
-                               flush();
+                               flush(); /* Flush input */
 
-                               /* Disturb */
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
 
                                /* Hack -- Show a Message */
                                msg_print(_("中断しました。", "Canceled."));
@@ -4995,8 +4779,6 @@ static void process_player(void)
 
                        /* Recover fully */
                        (void)set_monster_csleep(p_ptr->riding, 0);
-
-                       /* Acquire the monster name */
                        monster_desc(m_name, m_ptr, 0);
                        msg_format(_("%^sを起こした。", "You have waked %s up."), m_name);
                }
@@ -5008,11 +4790,7 @@ static void process_player(void)
                                (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1)))
                        {
                                char m_name[80];
-
-                               /* Acquire the monster name */
                                monster_desc(m_name, m_ptr, 0);
-
-                               /* Dump a message */
                                msg_format(_("%^sを朦朧状態から立ち直らせた。", "%^s is no longer stunned."), m_name);
                        }
                }
@@ -5024,11 +4802,7 @@ static void process_player(void)
                                (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1)))
                        {
                                char m_name[80];
-
-                               /* Acquire the monster name */
                                monster_desc(m_name, m_ptr, 0);
-
-                               /* Dump a message */
                                msg_format(_("%^sを混乱状態から立ち直らせた。", "%^s is no longer confused."), m_name);
                        }
                }
@@ -5036,15 +4810,11 @@ static void process_player(void)
                if (MON_MONFEAR(m_ptr))
                {
                        /* Hack -- Recover from fear */
-                       if (set_monster_monfear(p_ptr->riding,
+                       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];
-
-                               /* Acquire the monster name */
                                monster_desc(m_name, m_ptr, 0);
-
-                               /* Dump a message */
                                msg_format(_("%^sを恐怖から立ち直らせた。", "%^s is no longer fear."), m_name);
                        }
                }
@@ -5062,10 +4832,7 @@ static void process_player(void)
        }
        if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
        {
-               if (P_PTR_KI < 40)
-               {
-                       P_PTR_KI = 0;
-               }
+               if(P_PTR_KI < 40) P_PTR_KI = 0;
                else P_PTR_KI -= 40;
                p_ptr->update |= (PU_BONUS);
        }
@@ -5076,7 +4843,6 @@ static void process_player(void)
 
                /* 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)
                {
@@ -5119,10 +4885,6 @@ static void process_player(void)
                p_ptr->counter = FALSE;
                now_damaged = FALSE;
 
-               /* Handle "p_ptr->notice" */
-               notice_stuff();
-
-               /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
                handle_stuff();
 
                /* Place the cursor on the player */
@@ -5131,19 +4893,15 @@ static void process_player(void)
                /* Refresh (optional) */
                if (fresh_before) Term_fresh();
 
-
                /* Hack -- Pack Overflow */
                pack_overflow();
 
-
                /* Hack -- cancel "lurking browse mode" */
                if (!command_new) command_see = FALSE;
 
-
                /* Assume free turn */
                p_ptr->energy_use = 0;
 
-
                if (p_ptr->inside_battle)
                {
                        /* Place the cursor on the player */
@@ -5158,7 +4916,6 @@ static void process_player(void)
                /* Paralyzed or Knocked Out */
                else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
@@ -5177,14 +4934,12 @@ static void process_player(void)
                                p_ptr->redraw |= (PR_STATE);
                        }
 
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
                /* Fishing */
                else if (p_ptr->action == ACTION_FISH)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
@@ -5210,11 +4965,8 @@ static void process_player(void)
                        /* Count this execution */
                        command_rep--;
 
-                       /* Redraw the state */
                        p_ptr->redraw |= (PR_STATE);
-
-                       /* Redraw stuff */
-                       redraw_stuff();
+                       handle_stuff();
 
                        /* Hack -- Assume messages were seen */
                        msg_flag = FALSE;
@@ -5349,9 +5101,7 @@ static void process_player(void)
 
                                                        /* Assume invisible */
                                                        m_ptr->ml = FALSE;
-
-                                                       /* Update the monster */
-                                                       update_mon(i, FALSE);
+                                                       update_monster(i, FALSE);
 
                                                        if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
                                                        if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
@@ -5384,13 +5134,10 @@ static void process_player(void)
 
                        if (world_player && (p_ptr->energy_need > - 1000))
                        {
-                               /* Redraw map */
-                               p_ptr->redraw |= (PR_MAP);
 
-                               /* Update monsters */
+                               p_ptr->redraw |= (PR_MAP);
                                p_ptr->update |= (PU_MONSTERS);
 
-                               /* Window stuff */
                                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                                msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
@@ -5475,8 +5222,7 @@ static void dungeon(bool load_game)
        repair_objects = TRUE;
 
 
-       /* Disturb */
-       disturb(1, 1);
+       disturb(TRUE, TRUE);
 
        /* Get index of current quest (if any) */
        quest_num = quest_number(dun_level);
@@ -5517,22 +5263,17 @@ static void dungeon(bool load_game)
        /* Enter "xtra" mode */
        character_xtra = TRUE;
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
 
        /* Redraw dungeon */
        p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Update stuff */
        p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
 
        /* Update lite/view */
        p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH);
-
-       /* Update monsters */
        p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
 
        /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
@@ -5541,16 +5282,8 @@ static void dungeon(bool load_game)
        /* Leave "xtra" mode */
        character_xtra = FALSE;
 
-       /* Update stuff */
        p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
-
-       /* Combine / Reorder the pack */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
-
-       /* Handle "p_ptr->notice" */
-       notice_stuff();
-
-       /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
        handle_stuff();
 
        /* Refresh */
@@ -5638,15 +5371,10 @@ static void dungeon(bool load_game)
                /* 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();
-
                /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
                handle_stuff();
 
@@ -5662,10 +5390,6 @@ static void dungeon(bool load_game)
                /* Process all of the monsters */
                process_monsters();
 
-               /* Handle "p_ptr->notice" */
-               notice_stuff();
-
-               /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
                handle_stuff();
 
                /* Hack -- Hilite the player */
@@ -5677,14 +5401,9 @@ static void dungeon(bool load_game)
                /* Hack -- Notice death or departure */
                if (!p_ptr->playing || p_ptr->is_dead) break;
 
-
                /* Process the world */
                process_world();
 
-               /* Handle "p_ptr->notice" */
-               notice_stuff();
-
-               /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
                handle_stuff();
 
                /* Hack -- Hilite the player */
@@ -5991,7 +5710,6 @@ void play_game(bool new_game)
        /* Attempt to load */
        if (!load_player())
        {
-               /* Oops */
                quit(_("セーブファイルが壊れています", "broken savefile"));
        }
 
@@ -6007,11 +5725,9 @@ void play_game(bool new_game)
                if (!get_check_strict(_("待機していたスコア登録を今行ないますか?", "Do you register score now? "), CHECK_NO_HISTORY))
                        quit(0);
 
-               /* Update stuff */
                p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
 
-               /* Update stuff */
-               update_stuff();
+               handle_stuff();
 
                p_ptr->is_dead = TRUE;
 
@@ -6288,15 +6004,9 @@ void play_game(bool new_game)
        /* React to changes */
        Term_xtra(TERM_XTRA_REACT, 0);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
-
-       /* Window stuff */
        p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
-
-       /* Window stuff */
-       window_stuff();
-
+       handle_stuff();
 
        /* Set or clear "rogue_like_commands" if requested */
        if (arg_force_original) rogue_like_commands = FALSE;
@@ -6334,13 +6044,10 @@ void play_game(bool new_game)
                /* Process the level */
                dungeon(load_game);
 
-               /* 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;
@@ -6369,7 +6076,6 @@ void play_game(bool new_game)
                if (!p_ptr->is_dead) wipe_m_list();
 
 
-               /* XXX XXX XXX */
                msg_print(NULL);
 
                load_game = FALSE;
@@ -6410,7 +6116,6 @@ void play_game(bool new_game)
                                        /* Mark savefile */
                                        p_ptr->noscore |= 0x0001;
 
-                                       /* Message */
                                        msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
                                        msg_print(NULL);
 
@@ -6436,7 +6141,6 @@ void play_game(bool new_game)
                                        /* Hack -- cancel recall */
                                        if (p_ptr->word_recall)
                                        {
-                                               /* Message */
                                                msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
                                                msg_print(NULL);
 
@@ -6453,7 +6157,7 @@ void play_game(bool new_game)
                                                p_ptr->redraw |= (PR_STATUS);
                                        }
 
-                                       /* Note cause of death XXX XXX XXX */
+                                       /* Note cause of death */
                                        (void)strcpy(p_ptr->died_from, _("死の欺き", "Cheating death"));
 
                                        /* Do not die */