OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / dungeon.c
index 16abf63..bcc0a28 100644 (file)
@@ -22,6 +22,9 @@
 #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回処理を基本とする)*/
@@ -100,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));
@@ -147,7 +150,6 @@ static void sense_inventory_aux(INVENTORY_IDX slot, bool heavy)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP);
 }
 
@@ -193,7 +195,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -205,7 +206,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -217,7 +217,6 @@ static void sense_inventory1(void)
                        /* Very bad (light) sensing */
                        if (0 != randint0(240000L / (plev + 5))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -227,7 +226,6 @@ static void sense_inventory1(void)
                        /* Good (light) sensing */
                        if (0 != randint0(10000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -240,7 +238,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -252,7 +249,6 @@ static void sense_inventory1(void)
                        /* Changed! */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -265,7 +261,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -275,7 +270,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(75000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -287,7 +281,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(55000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -299,7 +292,6 @@ static void sense_inventory1(void)
                        /* Changed! */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -309,7 +301,6 @@ static void sense_inventory1(void)
                        /* Okay sensing */
                        if (0 != randint0(20000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -321,7 +312,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
 
@@ -330,7 +320,6 @@ static void sense_inventory1(void)
                        /* Bad sensing */
                        if (0 != randint0(65000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
                case CLASS_BERSERKER:
@@ -338,7 +327,6 @@ static void sense_inventory1(void)
                        /* Heavy sensing */
                        heavy = TRUE;
 
-                       /* Done */
                        break;
                }
        }
@@ -439,7 +427,6 @@ static void sense_inventory2(void)
                        /* Very bad (light) sensing */
                        if (0 != randint0(240000L / (plev + 5))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -451,7 +438,6 @@ static void sense_inventory2(void)
                        /* Bad sensing */
                        if (0 != randint0(95000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -464,7 +450,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(20000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -478,7 +463,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(9000L / (plev * plev + 40))) return;
 
-                       /* Done */
                        break;
                }
 
@@ -487,7 +471,6 @@ static void sense_inventory2(void)
                        /* Good sensing */
                        if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
 
-                       /* Done */
                        break;
                }
        }
@@ -720,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;
@@ -755,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;
        }
 }
@@ -772,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;
 
        /*
@@ -805,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) */
@@ -844,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;
        }
 }
@@ -866,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 */
@@ -907,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)
 {
@@ -954,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)
 {
@@ -999,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;
@@ -1017,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);
        }
 
@@ -1031,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 */
@@ -1047,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."));
                }
        }
@@ -1055,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."));
        }
 }
@@ -1172,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;
@@ -1191,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 */
@@ -1239,7 +1209,6 @@ static void check_music(void)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1296,7 +1265,7 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
                                        (flag == TRC_FAST_DIGEST) || 
                                        (flag == TRC_SLOW_REGEN) )
                {
-                       u32b cf;
+                       u32b cf = 0L;
                        BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_flags(o_ptr, flgs);
                        switch (flag)
@@ -1374,9 +1343,8 @@ static void process_world_aux_digestion(void)
                        /* Faint occasionally */
                        if (!p_ptr->paralyzed && (randint0(100) < 10))
                        {
-                               /* Message */
                                msg_print(_("あまりにも空腹で気絶してしまった。", "You faint from the lack of food."));
-                               disturb(1, 1);
+                               disturb(TRUE, TRUE);
 
                                /* Hack -- faint (bypass free action) */
                                (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
@@ -1388,7 +1356,6 @@ static void process_world_aux_digestion(void)
                                /* Calculate damage */
                                HIT_POINT dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
 
-                               /* Take damage */
                                if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1);
                        }
                }
@@ -1415,7 +1382,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);
        }
 
@@ -1462,7 +1428,6 @@ static void process_world_aux_hp_and_sp(void)
                        dam = 1;
                }
 
-               /* Take damage */
                take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
        }
 
@@ -1473,7 +1438,6 @@ 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;
@@ -1545,7 +1509,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;
@@ -1554,7 +1517,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;
@@ -2074,7 +2037,7 @@ static void process_world_aux_mutation(void)
 
        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);
@@ -2085,7 +2048,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));
                }
@@ -2095,7 +2058,7 @@ static void process_world_aux_mutation(void)
        {
                if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele)
                {
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2106,7 +2069,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*!"));
                }
@@ -2143,7 +2106,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);
                }
@@ -2151,7 +2114,7 @@ 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);
@@ -2161,7 +2124,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!"));
 
@@ -2182,13 +2145,13 @@ static void process_world_aux_mutation(void)
                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."));
@@ -2219,7 +2182,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);
@@ -2291,13 +2254,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))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!"));
 
                msg_print(NULL);
@@ -2310,7 +2273,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);
@@ -2352,7 +2315,7 @@ 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));
@@ -2369,7 +2332,7 @@ 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))
@@ -2387,7 +2350,7 @@ static void process_world_aux_mutation(void)
        }
        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);
@@ -2435,7 +2398,7 @@ static void process_world_aux_mutation(void)
 
        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);
@@ -2476,7 +2439,7 @@ static void process_world_aux_mutation(void)
                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);
 
@@ -2553,14 +2516,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 */
@@ -2589,7 +2552,7 @@ static void process_world_aux_curse(void)
                /* 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);
@@ -2612,7 +2575,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);
@@ -2641,7 +2604,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 */
@@ -2653,7 +2616,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 */
@@ -2666,7 +2629,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 */
@@ -2679,14 +2642,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));
                        }
@@ -2694,7 +2657,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);
@@ -2732,19 +2695,11 @@ static void process_world_aux_curse(void)
 
                if (o_ptr->name1 == ART_JUDGE)
                {
-#ifdef JP
                        if (object_is_known(o_ptr))
-                               msg_print("『審判の宝石』はあなたの体力を吸収した!");
+                               msg_print(_("『審判の宝石』はあなたの体力を吸収した!", "The Jewel of Judgement drains life from you!"));
                        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!");
-                       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);
                }
        }
 }
@@ -2787,7 +2742,6 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               /* Window stuff */
                p_ptr->window |= (PW_EQUIP);
                wild_regen = 20;
        }
@@ -2836,7 +2790,6 @@ static void process_world_aux_recharge(void)
        /* Notice changes */
        if (changed)
        {
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN);
                wild_regen = 20;
        }
@@ -2890,13 +2843,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)
@@ -2914,8 +2866,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;
 
@@ -3008,7 +2959,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)
@@ -3044,8 +2995,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;
 
@@ -3164,7 +3115,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;
@@ -3176,27 +3127,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;
@@ -3271,8 +3211,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);
 }
 
 /*!
@@ -3379,13 +3318,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."));
 
@@ -3394,7 +3331,6 @@ static void process_world(void)
                        /* Slam the gate */
                        else
                        {
-                               /* Message */
                                msg_print(_("今、アングバンドへの門が閉ざされました。", "The gates to ANGBAND are now closed."));
 
                                /* Stop playing */
@@ -3473,7 +3409,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 */
@@ -3535,7 +3470,7 @@ static void process_world(void)
                if ((hour == 23) && !(min % 15))
                {
                        /* Disturbing */
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
 
                        switch (min / 15)
                        {
@@ -3561,7 +3496,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)
@@ -3743,20 +3678,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 */
@@ -3921,32 +3852,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;
                }
 
@@ -4669,15 +4582,12 @@ static void pack_overflow(void)
                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 */
@@ -4764,9 +4674,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();
        }
@@ -4817,7 +4725,6 @@ static void process_player(void)
 
        if (p_ptr->action == ACTION_FISH)
        {
-               /* Delay */
                Term_xtra(TERM_XTRA_DELAY, 10);
                if (one_in_(1000))
                {
@@ -4829,8 +4736,8 @@ static void process_player(void)
                        if (r_idx && one_in_(2))
                        {
                                POSITION y, x;
-                               y = p_ptr->y + ddy[tsuri_dir];
-                               x = p_ptr->x + ddx[tsuri_dir];
+                               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];
@@ -4843,7 +4750,7 @@ static void process_player(void)
                        {
                                msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn!  The fish stole your bait!"));
                        }
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
@@ -4861,8 +4768,7 @@ static void process_player(void)
                        {
                                flush(); /* Flush input */
 
-                               /* Disturb */
-                               disturb(0, 1);
+                               disturb(FALSE, TRUE);
 
                                /* Hack -- Show a Message */
                                msg_print(_("中断しました。", "Canceled."));
@@ -4881,8 +4787,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);
                }
@@ -4894,8 +4798,6 @@ 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 */
@@ -4910,8 +4812,6 @@ 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 */
@@ -4926,8 +4826,6 @@ static void process_player(void)
                                (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 */
@@ -5085,10 +4983,7 @@ static void process_player(void)
                        /* Count this execution */
                        command_rep--;
 
-                       /* Redraw the state */
                        p_ptr->redraw |= (PR_STATE);
-
-                       /* Redraw stuff */
                        redraw_stuff();
 
                        /* Hack -- Assume messages were seen */
@@ -5224,9 +5119,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);
@@ -5259,13 +5152,12 @@ static void process_player(void)
 
                        if (world_player && (p_ptr->energy_need > - 1000))
                        {
-                               /* Redraw map */
+
                                p_ptr->redraw |= (PR_MAP);
 
                                /* Update monsters */
                                p_ptr->update |= (PU_MONSTERS);
 
-                               /* Window stuff */
                                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                                msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
@@ -5350,8 +5242,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);
@@ -5392,16 +5283,13 @@ 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 */
@@ -5416,7 +5304,6 @@ 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 */
@@ -5866,7 +5753,6 @@ void play_game(bool new_game)
        /* Attempt to load */
        if (!load_player())
        {
-               /* Oops */
                quit(_("セーブファイルが壊れています", "broken savefile"));
        }
 
@@ -5882,10 +5768,8 @@ 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();
 
                p_ptr->is_dead = TRUE;
@@ -6163,13 +6047,10 @@ 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();
 
 
@@ -6244,7 +6125,6 @@ void play_game(bool new_game)
                if (!p_ptr->is_dead) wipe_m_list();
 
 
-               /* XXX XXX XXX */
                msg_print(NULL);
 
                load_game = FALSE;
@@ -6285,7 +6165,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);
 
@@ -6311,7 +6190,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);
 
@@ -6328,7 +6206,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 */