OSDN Git Service

[Refactor] #37353 monster1~monster-hook間整理。 / Refactor between monster1 and monster...
[hengband/hengband.git] / src / spells2.c
index d31dff9..354d56b 100644 (file)
@@ -14,6 +14,7 @@
 #include "angband.h"
 #include "grid.h"
 #include "trap.h"
+#include "monster-hook.h"
 
 
 /*!
@@ -25,8 +26,8 @@
  */
 static bool detect_feat_flag(POSITION range, int flag, bool known)
 {
-       int       x, y;
-       bool      detect = FALSE;
+       POSITION x, y;
+       bool detect = FALSE;
        cave_type *c_ptr;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
@@ -38,8 +39,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
                {
                        int dist = distance(p_ptr->y, p_ptr->x, y, x);
                        if (dist > range) continue;
-
-                       /* Access the grid */
                        c_ptr = &cave[y][x];
 
                        /* Hack -- Safe */
@@ -52,7 +51,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
 
                                        c_ptr->info &= ~(CAVE_UNSAFE);
 
-                                       /* Redraw */
                                        lite_spot(y, x);
                                }
                        }
@@ -66,16 +64,12 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
                                /* Hack -- Memorize */
                                c_ptr->info |= (CAVE_MARK);
 
-                               /* Redraw */
                                lite_spot(y, x);
 
-                               /* Obvious */
                                detect = TRUE;
                        }
                }
        }
-
-       /* Result */
        return detect;
 }
 
@@ -93,14 +87,10 @@ bool detect_traps(POSITION range, bool known)
        if (known) p_ptr->dtrap = TRUE;
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
        }
-
-       /* Result */
        return detect;
 }
 
@@ -115,14 +105,10 @@ bool detect_doors(POSITION range)
        bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
        }
-
-       /* Result */
        return detect;
 }
 
@@ -137,14 +123,10 @@ bool detect_stairs(POSITION range)
        bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
        }
-
-       /* Result */
        return detect;
 }
 
@@ -159,14 +141,10 @@ bool detect_treasure(POSITION range)
        bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
        }
-
-       /* Result */
        return detect;
 }
 
@@ -178,7 +156,8 @@ bool detect_treasure(POSITION range)
  */
 bool detect_objects_gold(POSITION range)
 {
-       int i, y, x;
+       OBJECT_IDX i;
+       POSITION y, x;
        POSITION range2 = range;
 
        bool detect = FALSE;
@@ -196,7 +175,6 @@ bool detect_objects_gold(POSITION range)
                /* Skip held objects */
                if (o_ptr->held_m_idx) continue;
 
-               /* Location */
                y = o_ptr->iy;
                x = o_ptr->ix;
 
@@ -206,20 +184,13 @@ bool detect_objects_gold(POSITION range)
                /* Detect "gold" objects */
                if (o_ptr->tval == TV_GOLD)
                {
-                       /* Hack -- memorize it */
                        o_ptr->marked |= OM_FOUND;
-
-                       /* Redraw */
                        lite_spot(y, x);
-
-                       /* Detect */
                        detect = TRUE;
                }
        }
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
@@ -229,8 +200,6 @@ bool detect_objects_gold(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -242,7 +211,8 @@ bool detect_objects_gold(POSITION range)
  */
 bool detect_objects_normal(POSITION range)
 {
-       int i, y, x;
+       OBJECT_IDX i;
+       POSITION y, x;
        POSITION range2 = range;
 
        bool detect = FALSE;
@@ -260,7 +230,6 @@ bool detect_objects_normal(POSITION range)
                /* Skip held objects */
                if (o_ptr->held_m_idx) continue;
 
-               /* Location */
                y = o_ptr->iy;
                x = o_ptr->ix;
 
@@ -270,20 +239,13 @@ bool detect_objects_normal(POSITION range)
                /* Detect "real" objects */
                if (o_ptr->tval != TV_GOLD)
                {
-                       /* Hack -- memorize it */
                        o_ptr->marked |= OM_FOUND;
-
-                       /* Redraw */
                        lite_spot(y, x);
-
-                       /* Detect */
                        detect = TRUE;
                }
        }
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
@@ -293,8 +255,6 @@ bool detect_objects_normal(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -314,7 +274,9 @@ bool detect_objects_normal(POSITION range)
  */
 bool detect_objects_magic(POSITION range)
 {
-       int i, y, x, tv;
+       OBJECT_TYPE_VALUE tv;
+       OBJECT_IDX i;
+       POSITION y, x;
 
        bool detect = FALSE;
 
@@ -331,7 +293,6 @@ bool detect_objects_magic(POSITION range)
                /* Skip held objects */
                if (o_ptr->held_m_idx) continue;
 
-               /* Location */
                y = o_ptr->iy;
                x = o_ptr->ix;
 
@@ -369,16 +330,10 @@ bool detect_objects_magic(POSITION range)
                {
                        /* Memorize the item */
                        o_ptr->marked |= OM_FOUND;
-
-                       /* Redraw */
                        lite_spot(y, x);
-
-                       /* Detect */
                        detect = TRUE;
                }
        }
-
-       /* Describe */
        if (detect)
        {
                msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
@@ -412,7 +367,6 @@ bool detect_monsters_normal(POSITION range)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -427,25 +381,17 @@ bool detect_monsters_normal(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -472,7 +418,6 @@ bool detect_monsters_invis(POSITION range)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -485,7 +430,6 @@ bool detect_monsters_invis(POSITION range)
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
                        {
-                               /* Window stuff */
                                p_ptr->window |= (PW_MONSTER);
                        }
 
@@ -494,25 +438,17 @@ bool detect_monsters_invis(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -538,7 +474,6 @@ bool detect_monsters_evil(POSITION range)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -556,7 +491,6 @@ bool detect_monsters_evil(POSITION range)
                                /* Update monster recall window */
                                if (p_ptr->monster_race_idx == m_ptr->r_idx)
                                {
-                                       /* Window stuff */
                                        p_ptr->window |= (PW_MONSTER);
                                }
                        }
@@ -566,23 +500,15 @@ bool detect_monsters_evil(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -608,7 +534,6 @@ bool detect_monsters_nonliving(POSITION range)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -621,7 +546,6 @@ bool detect_monsters_nonliving(POSITION range)
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
                        {
-                               /* Window stuff */
                                p_ptr->window |= (PW_MONSTER);
                        }
 
@@ -630,23 +554,15 @@ bool detect_monsters_nonliving(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -659,7 +575,7 @@ bool detect_monsters_mind(POSITION range)
 {
        MONSTER_IDX i;
        POSITION y, x;
-       bool    flag = FALSE;
+       bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
@@ -672,7 +588,6 @@ bool detect_monsters_mind(POSITION range)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -685,7 +600,6 @@ bool detect_monsters_mind(POSITION range)
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
                        {
-                               /* Window stuff */
                                p_ptr->window |= (PW_MONSTER);
                        }
 
@@ -694,23 +608,15 @@ bool detect_monsters_mind(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -738,7 +644,6 @@ bool detect_monsters_string(POSITION range, cptr Match)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -751,7 +656,6 @@ bool detect_monsters_string(POSITION range, cptr Match)
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
                        {
-                               /* Window stuff */
                                p_ptr->window |= (PW_MONSTER);
                        }
 
@@ -760,25 +664,17 @@ bool detect_monsters_string(POSITION range, cptr Match)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
 
        if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
-
-       /* Describe */
        if (flag)
        {
                /* Describe result */
                msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -806,7 +702,6 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -824,7 +719,6 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
                                /* Update monster recall window */
                                if (p_ptr->monster_race_idx == m_ptr->r_idx)
                                {
-                                       /* Window stuff */
                                        p_ptr->window |= (PW_MONSTER);
                                }
                        }
@@ -834,16 +728,10 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
-
-                       /* Detect */
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
-
-       /* Describe */
        if (flag)
        {
                switch (match_flag)
@@ -860,8 +748,6 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
                msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
                msg_print(NULL);
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -887,8 +773,6 @@ bool detect_all(POSITION range)
        if (detect_objects_normal(range)) detect = TRUE;
        if (detect_monsters_invis(range)) detect = TRUE;
        if (detect_monsters_normal(range)) detect = TRUE;
-
-       /* Result */
        return (detect);
 }
 
@@ -908,9 +792,10 @@ bool detect_all(POSITION range)
  */
 bool project_hack(EFFECT_ID typ, HIT_POINT dam)
 {
-       int     i, x, y;
-       int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
-       bool    obvious = FALSE;
+       MONSTER_IDX i;
+       POSITION x, y;
+       BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
+       bool obvious = FALSE;
 
 
        /* Mark all (nearby) monsters */
@@ -921,7 +806,6 @@ bool project_hack(EFFECT_ID typ, HIT_POINT dam)
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -943,15 +827,12 @@ bool project_hack(EFFECT_ID typ, HIT_POINT dam)
                /* Remove mark */
                m_ptr->mflag &= ~(MFLAG_TEMP);
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
                /* Jump directly to the target monster */
                if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE;
        }
-
-       /* Result */
        return (obvious);
 }
 
@@ -1081,12 +962,10 @@ void aggravate_monsters(MONSTER_IDX who)
        bool    sleep = FALSE;
        bool    speed = FALSE;
 
-
        /* Aggravate everyone nearby */
        for (i = 1; i < m_max; i++)
        {
-               monster_type    *m_ptr = &m_list[i];
-/*             monster_race    *r_ptr = &r_info[m_ptr->r_idx]; */
+               monster_type *m_ptr = &m_list[i];
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -1117,14 +996,8 @@ void aggravate_monsters(MONSTER_IDX who)
                }
        }
 
-       /* Messages */
-#ifdef JP
-       if (speed) msg_print("付近で何かが突如興奮したような感じを受けた!");
-       else if (sleep) msg_print("何かが突如興奮したような騒々しい音が遠くに聞こえた!");
-#else
-       if (speed) msg_print("You feel a sudden stirring nearby!");
-       else if (sleep) msg_print("You hear a sudden stirring in the distance!");
-#endif
+       if (speed) msg_print(_("付近で何かが突如興奮したような感じを受けた!", "You feel a sudden stirring nearby!"));
+       else if (sleep) msg_print(_("何かが突如興奮したような騒々しい音が遠くに聞こえた!", "You hear a sudden stirring in the distance!"));
        if (p_ptr->riding) p_ptr->update |= PU_BONUS;
 }
 
@@ -1149,18 +1022,13 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
 
        /* Hack -- Skip Unique Monsters or Quest Monsters */
        if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
-
        else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
-
        else if (m_idx == p_ptr->riding) resist = TRUE;
-
        else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
-
        else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
-
        else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
 
-       /* Delete the monster */
+
        else
        {
                if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
@@ -1205,26 +1073,19 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
 
        if (player_cast)
        {
-               /* Take damage */
                take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
        }
 
        /* Visual feedback */
        move_cursor_relative(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        p_ptr->redraw |= (PR_HP);
-
-       /* Window stuff */
        p_ptr->window |= (PW_PLAYER);
 
        /* Handle */
        handle_stuff();
-
-       /* Fresh */
        Term_fresh();
 
-       /* Delay */
        Term_xtra(TERM_XTRA_DELAY, msec);
 
        return !resist;
@@ -1371,7 +1232,8 @@ bool mass_genocide_undead(int power, bool player_cast)
  */
 bool probing(void)
 {
-       int i, speed;
+       int i;
+       SPEED speed;
        bool_hack cu, cv;
        bool probe = FALSE;
        char buf[256];
@@ -1497,8 +1359,6 @@ bool probing(void)
                chg_virtue(V_KNOWLEDGE, 1);
                msg_print(_("これで全部です。", "That's all."));
        }
-
-       /* Result */
        return (probe);
 }
 
@@ -1524,7 +1384,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
        POSITION y, x;
        int k, t;
        cave_type *c_ptr;
-       bool      flag = FALSE;
+       bool flag = FALSE;
 
        /* Prevent destruction of quest levels and town */
        if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
@@ -1548,8 +1408,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                        /* Stay in the circle of death */
                        if (k > r) continue;
-
-                       /* Access the grid */
                        c_ptr = &cave[y][x];
 
                        /* Lose room and vault */
@@ -1619,8 +1477,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                                {
                                        object_type *o_ptr;
-
-                                       /* Acquire object */
                                        o_ptr = &o_list[this_o_idx];
 
                                        /* Acquire next object */
@@ -1724,8 +1580,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                                /* Stay in the circle of death */
                                if (k > r) continue;
-
-                               /* Access the grid */
                                c_ptr = &cave[y][x];
 
                                if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
@@ -1768,13 +1622,10 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                /* Mega-Hack -- Forget the view and lite */
                p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
-               /* Update stuff */
                p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
-               /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                if (p_ptr->special_defense & NINJA_S_STEALTH)
@@ -1860,8 +1711,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-
-                       /* Access the grid */
                        c_ptr = &cave[yy][xx];
 
                        /* Lose room and vault */
@@ -1975,7 +1824,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                /* Important -- no wall on player */
                map[16+p_ptr->y-cy][16+p_ptr->x-cx] = FALSE;
 
-               /* Take some damage */
                if (damage)
                {
                        cptr killer;
@@ -2010,8 +1858,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip unaffected grids */
                        if (!map[16+yy-cy][16+xx-cx]) continue;
-
-                       /* Access the grid */
                        c_ptr = &cave[yy][xx];
 
                        if (c_ptr->m_idx == p_ptr->riding) continue;
@@ -2046,7 +1892,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                /* Look for safety */
                                                for (i = 0; i < 8; i++)
                                                {
-                                                       /* Access the grid */
                                                        y = yy + ddy_ddd[i];
                                                        x = xx + ddx_ddd[i];
 
@@ -2109,7 +1954,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        }
                                                }
 
-                                               /* Delete the monster */
+
                                                delete_monster(yy, xx);
 
                                                /* No longer safe */
@@ -2132,7 +1977,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                m_ptr->fx = sx;
 
                                                /* Update the monster (new location) */
-                                               update_mon(m_idx, TRUE);
+                                               update_monster(m_idx, TRUE);
 
                                                /* Redraw the old grid */
                                                lite_spot(yy, xx);
@@ -2221,8 +2066,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-
-                       /* Access the grid */
                        c_ptr = &cave[yy][xx];
 
                        if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
@@ -2251,16 +2094,13 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        /* Mega-Hack -- Forget the view and lite */
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
-       /* Update stuff */
        p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
        /* Update the health bar */
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
@@ -2389,9 +2229,7 @@ static void cave_temp_room_lite(void)
                        monster_type    *m_ptr = &m_list[c_ptr->m_idx];
 
                        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-
-                       /* Update the monster */
-                       update_mon(c_ptr->m_idx, FALSE);
+                       update_monster(c_ptr->m_idx, FALSE);
 
                        /* Stupid monsters rarely wake up */
                        if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
@@ -2422,7 +2260,6 @@ static void cave_temp_room_lite(void)
                /* Note */
                note_spot(y, x);
 
-               /* Redraw */
                lite_spot(y, x);
 
                update_local_illumination(y, x);
@@ -2496,18 +2333,15 @@ static void cave_temp_room_unlite(void)
                                /* Forget the grid */
                                if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
 
-                               /* Notice */
                                note_spot(y, x);
                        }
 
                        /* Process affected monsters */
                        if (c_ptr->m_idx)
                        {
-                               /* Update the monster */
-                               update_mon(c_ptr->m_idx, FALSE);
+                               update_monster(c_ptr->m_idx, FALSE);
                        }
 
-                       /* Redraw */
                        lite_spot(y, x);
 
                        update_local_illumination(y, x);
@@ -3492,10 +3326,8 @@ bool wall_stone(void)
 
        bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
 
-       /* Update stuff */
        p_ptr->update |= (PU_FLOW);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        return dummy;
@@ -4170,9 +4002,7 @@ bool rush_attack(bool *mdeath)
 
                /* Move player before updating the monster */
                if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
-
-               /* Update the monster */
-               update_mon(cave[ny][nx].m_idx, TRUE);
+               update_monster(cave[ny][nx].m_idx, TRUE);
 
                /* Found a monster */
                m_ptr = &m_list[cave[ny][nx].m_idx];
@@ -5117,7 +4947,7 @@ bool_hack vampirism(void)
        }
 
        /* Only works on adjacent monsters */
-       if (!get_rep_dir2(&dir)) return FALSE;
+       if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
        c_ptr = &cave[y][x];
@@ -5160,7 +4990,7 @@ bool panic_hit(void)
        DIRECTION dir;
        POSITION x, y;
 
-       if (!get_rep_dir2(&dir)) return FALSE;
+       if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
        if (cave[y][x].m_idx)
@@ -5203,7 +5033,6 @@ bool psychometry(void)
        bool okay = FALSE;
 
        item_tester_no_ryoute = TRUE;
-       /* Get an item */
        q = _("どのアイテムを調べますか?", "Meditate on which item? ");
        s = _("調べるアイテムがありません。", "You have nothing appropriate.");
 
@@ -5263,7 +5092,6 @@ bool psychometry(void)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Valid "tval" codes */