OSDN Git Service

[Refactor] #37353 マジックナンバー修正(A_MAX) / Fix magic number (A_MAX).
[hengband/hengband.git] / src / spells2.c
index 079df11..0b7a86e 100644 (file)
 
 #include "angband.h"
 #include "grid.h"
+#include "trap.h"
+#include "monsterrace-hook.h"
+#include "melee.h"
+#include "world.h"
 
 
 /*!
@@ -24,8 +28,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;
@@ -37,8 +41,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 */
@@ -51,7 +53,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
 
                                        c_ptr->info &= ~(CAVE_UNSAFE);
 
-                                       /* Redraw */
                                        lite_spot(y, x);
                                }
                        }
@@ -65,16 +66,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;
 }
 
@@ -92,14 +89,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;
 }
 
@@ -114,14 +107,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;
 }
 
@@ -136,14 +125,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;
 }
 
@@ -158,14 +143,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;
 }
 
@@ -177,7 +158,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;
@@ -195,7 +177,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;
 
@@ -205,20 +186,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!"));
@@ -228,8 +202,6 @@ bool detect_objects_gold(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -241,7 +213,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;
@@ -259,7 +232,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;
 
@@ -269,20 +241,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!"));
@@ -292,8 +257,6 @@ bool detect_objects_normal(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -313,7 +276,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;
 
@@ -330,7 +295,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;
 
@@ -368,16 +332,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!"));
@@ -397,12 +355,10 @@ bool detect_monsters_normal(POSITION range)
 {
        MONSTER_IDX i;
        POSITION y, x;
-
        bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -411,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;
 
@@ -424,27 +379,17 @@ bool detect_monsters_normal(POSITION range)
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -462,7 +407,6 @@ bool detect_monsters_invis(POSITION range)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -471,7 +415,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;
 
@@ -484,34 +427,23 @@ 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);
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -528,7 +460,6 @@ bool detect_monsters_evil(POSITION range)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -537,7 +468,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;
 
@@ -555,7 +485,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);
                                }
                        }
@@ -563,25 +492,15 @@ bool detect_monsters_evil(POSITION range)
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -598,16 +517,13 @@ bool detect_monsters_nonliving(POSITION range)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
-               monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -615,37 +531,26 @@ bool detect_monsters_nonliving(POSITION range)
                if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
 
                /* Detect non-living monsters */
-               if (!monster_living(r_ptr))
+               if (!monster_living(m_ptr->r_idx))
                {
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
                        {
-                               /* Window stuff */
                                p_ptr->window |= (PW_MONSTER);
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -658,11 +563,10 @@ 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;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -671,7 +575,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;
 
@@ -684,32 +587,21 @@ 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);
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -728,7 +620,6 @@ bool detect_monsters_string(POSITION range, cptr Match)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -737,7 +628,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;
 
@@ -750,34 +640,23 @@ 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);
                        }
 
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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);
 }
 
@@ -796,7 +675,6 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
-       /* Scan monsters */
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
@@ -805,7 +683,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;
 
@@ -823,7 +700,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);
                                }
                        }
@@ -831,18 +707,11 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
                        /* Repair visibility later */
                        repair_monsters = TRUE;
 
-                       /* 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)
@@ -855,12 +724,9 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
                                break;
                }
 
-               /* Describe result */
                msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
                msg_print(NULL);
        }
-
-       /* Result */
        return (flag);
 }
 
@@ -886,8 +752,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);
 }
 
@@ -905,11 +769,12 @@ bool detect_all(POSITION range)
  * this is done in two passes. -- JDL
  * </pre>
  */
-bool project_hack(int typ, HIT_POINT dam)
+bool project_all_los(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 */
@@ -920,7 +785,6 @@ bool project_hack(int typ, HIT_POINT dam)
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
 
-               /* Location */
                y = m_ptr->fy;
                x = m_ptr->fx;
 
@@ -942,15 +806,12 @@ bool project_hack(int 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);
 }
 
@@ -961,7 +822,7 @@ bool project_hack(int typ, HIT_POINT dam)
  */
 bool speed_monsters(void)
 {
-       return (project_hack(GF_OLD_SPEED, p_ptr->lev));
+       return (project_all_los(GF_OLD_SPEED, p_ptr->lev));
 }
 
 /*!
@@ -970,7 +831,7 @@ bool speed_monsters(void)
  */
 bool slow_monsters(int power)
 {
-       return (project_hack(GF_OLD_SLOW, power));
+       return (project_all_los(GF_OLD_SLOW, power));
 }
 
 /*!
@@ -979,7 +840,7 @@ bool slow_monsters(int power)
  */
 bool sleep_monsters(int power)
 {
-       return (project_hack(GF_OLD_SLEEP, power));
+       return (project_all_los(GF_OLD_SLEEP, power));
 }
 
 /*!
@@ -988,7 +849,7 @@ bool sleep_monsters(int power)
  */
 bool banish_evil(int dist)
 {
-       return (project_hack(GF_AWAY_EVIL, dist));
+       return (project_all_los(GF_AWAY_EVIL, dist));
 }
 
 /*!
@@ -997,7 +858,7 @@ bool banish_evil(int dist)
  */
 bool turn_undead(void)
 {
-       bool tester = (project_hack(GF_TURN_UNDEAD, p_ptr->lev));
+       bool tester = (project_all_los(GF_TURN_UNDEAD, p_ptr->lev));
        if (tester)
                chg_virtue(V_UNLIFE, -1);
        return tester;
@@ -1009,7 +870,7 @@ bool turn_undead(void)
  */
 bool dispel_undead(HIT_POINT dam)
 {
-       bool tester = (project_hack(GF_DISP_UNDEAD, dam));
+       bool tester = (project_all_los(GF_DISP_UNDEAD, dam));
        if (tester)
                chg_virtue(V_UNLIFE, -2);
        return tester;
@@ -1021,7 +882,7 @@ bool dispel_undead(HIT_POINT dam)
  */
 bool dispel_evil(HIT_POINT dam)
 {
-       return (project_hack(GF_DISP_EVIL, dam));
+       return (project_all_los(GF_DISP_EVIL, dam));
 }
 
 /*!
@@ -1030,7 +891,7 @@ bool dispel_evil(HIT_POINT dam)
  */
 bool dispel_good(HIT_POINT dam)
 {
-       return (project_hack(GF_DISP_GOOD, dam));
+       return (project_all_los(GF_DISP_GOOD, dam));
 }
 
 /*!
@@ -1039,7 +900,7 @@ bool dispel_good(HIT_POINT dam)
  */
 bool dispel_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_DISP_ALL, dam));
+       return (project_all_los(GF_DISP_ALL, dam));
 }
 
 /*!
@@ -1048,7 +909,7 @@ bool dispel_monsters(HIT_POINT dam)
  */
 bool dispel_living(HIT_POINT dam)
 {
-       return (project_hack(GF_DISP_LIVING, dam));
+       return (project_all_los(GF_DISP_LIVING, dam));
 }
 
 /*!
@@ -1057,7 +918,7 @@ bool dispel_living(HIT_POINT dam)
  */
 bool dispel_demons(HIT_POINT dam)
 {
-       return (project_hack(GF_DISP_DEMON, dam));
+       return (project_all_los(GF_DISP_DEMON, dam));
 }
 
 /*!
@@ -1066,7 +927,7 @@ bool dispel_demons(HIT_POINT dam)
  */
 bool crusade(void)
 {
-       return (project_hack(GF_CRUSADE, p_ptr->lev*4));
+       return (project_all_los(GF_CRUSADE, p_ptr->lev*4));
 }
 
 /*!
@@ -1080,12 +941,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;
@@ -1116,14 +975,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;
 }
 
@@ -1148,23 +1001,18 @@ 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)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
 
                        monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                        do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
@@ -1176,7 +1024,7 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
        if (resist && player_cast)
        {
                bool see_m = is_seen(m_ptr);
-               char m_name[80];
+               GAME_TEXT m_name[MAX_NLEN];
 
                monster_desc(m_name, m_ptr, 0);
                if (see_m)
@@ -1204,26 +1052,18 @@ 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;
@@ -1263,7 +1103,6 @@ bool symbol_genocide(int power, bool player_cast)
                /* Skip "wrong" monsters */
                if (r_ptr->d_char != typ) continue;
 
-               /* Take note */
                result |= genocide_aux(i, power, player_cast, 4, _("抹殺", "Genocide"));
        }
 
@@ -1370,7 +1209,8 @@ bool mass_genocide_undead(int power, bool player_cast)
  */
 bool probing(void)
 {
-       int i, speed;
+       int i;
+       int speed; /* TODO */
        bool_hack cu, cv;
        bool probe = FALSE;
        char buf[256];
@@ -1396,7 +1236,7 @@ bool probing(void)
                /* Probe visible monsters */
                if (m_ptr->ml)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
 
                        /* Start the message */
                        if (!probe)
@@ -1423,23 +1263,13 @@ bool probing(void)
                        if (ironman_nightmare) speed += 5;
 
                        /* Get the monster's alignment */
-#ifdef JP
-                       if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "善悪";
-                       else if (r_ptr->flags3 & RF3_EVIL) align = "邪悪";
-                       else if (r_ptr->flags3 & RF3_GOOD) align = "善良";
-                       else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "中立(善悪)";
-                       else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "中立(邪悪)";
-                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "中立(善良)";
-                       else align = "中立";
-#else
-                       if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "good&evil";
-                       else if (r_ptr->flags3 & RF3_EVIL) align = "evil";
-                       else if (r_ptr->flags3 & RF3_GOOD) align = "good";
-                       else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "neutral(good&evil)";
-                       else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "neutral(evil)";
-                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "neutral(good)";
-                       else align = "neutral";
-#endif
+                       if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
+                       else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
+                       else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
+                       else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) _(align = "中立(善悪)", "neutral(good&evil)");
+                       else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
+                       else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
+                       else align = _("中立", "neutral");
 
                        /* Describe the monster */
                        sprintf(buf,_("%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"),
@@ -1454,26 +1284,19 @@ bool probing(void)
                                strcat(buf, "xxx ");
                        }
 
-#ifdef JP
-                       if (MON_CSLEEP(m_ptr)) strcat(buf,"睡眠 ");
-                       if (MON_STUNNED(m_ptr)) strcat(buf,"朦朧 ");
-                       if (MON_MONFEAR(m_ptr)) strcat(buf,"恐怖 ");
-                       if (MON_CONFUSED(m_ptr)) strcat(buf,"混乱 ");
-                       if (MON_INVULNER(m_ptr)) strcat(buf,"無敵 ");
-#else
-                       if (MON_CSLEEP(m_ptr)) strcat(buf,"sleeping ");
-                       if (MON_STUNNED(m_ptr)) strcat(buf,"stunned ");
-                       if (MON_MONFEAR(m_ptr)) strcat(buf,"scared ");
-                       if (MON_CONFUSED(m_ptr)) strcat(buf,"confused ");
-                       if (MON_INVULNER(m_ptr)) strcat(buf,"invulnerable ");
-#endif
+                       if (MON_CSLEEP(m_ptr)) strcat(buf,_("睡眠 ", "sleeping "));
+                       if (MON_STUNNED(m_ptr)) strcat(buf, _("朦朧 ", "stunned "));
+                       if (MON_MONFEAR(m_ptr)) strcat(buf, _("恐怖 ", "scared "));
+                       if (MON_CONFUSED(m_ptr)) strcat(buf, _("混乱 ", "confused "));
+                       if (MON_INVULNER(m_ptr)) strcat(buf, _("無敵 ", "invulnerable "));
                        buf[strlen(buf)-1] = '\0';
-                       prt(buf,0,0);
+                       prt(buf, 0, 0);
 
                        /* HACK : Add the line to message buffer */
                        message_add(buf);
+
                        p_ptr->window |= (PW_MESSAGE);
-                       window_stuff();
+                       handle_stuff();
 
                        if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
                        inkey();
@@ -1509,14 +1332,11 @@ bool probing(void)
        Term->scr->cv = cv;
        Term_fresh();
 
-       /* Done */
        if (probe)
        {
                chg_virtue(V_KNOWLEDGE, 1);
                msg_print(_("これで全部です。", "That's all."));
        }
-
-       /* Result */
        return (probe);
 }
 
@@ -1537,11 +1357,12 @@ bool probing(void)
  * "earthquake" by using the "full" to select "destruction".
  * </pre>
  */
-bool destroy_area(int y1, int x1, int r, bool in_generate)
+bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 {
-       int       y, x, k, t;
+       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)
@@ -1565,8 +1386,6 @@ bool destroy_area(int y1, int x1, int 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 */
@@ -1616,7 +1435,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                                {
                                        if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
                                        {
-                                               char m_name[80];
+                                               GAME_TEXT m_name[MAX_NLEN];
 
                                                monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                                                do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name);
@@ -1630,14 +1449,12 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                        /* During generation, destroyed artifacts are "preserved" */
                        if (preserve_mode || in_generate)
                        {
-                               s16b this_o_idx, next_o_idx = 0;
+                               OBJECT_IDX this_o_idx, next_o_idx = 0;
 
                                /* Scan all objects in the grid */
                                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 */
@@ -1651,7 +1468,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
 
                                                if (in_generate && cheat_peek)
                                                {
-                                                       char o_name[MAX_NLEN];
+                                                       GAME_TEXT o_name[MAX_NLEN];
                                                        object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
                                                        msg_format(_("伝説のアイテム (%s) は生成中に*破壊*された。", "Artifact (%s) was *destroyed* during generation."), o_name);
                                                }
@@ -1741,8 +1558,6 @@ bool destroy_area(int y1, int x1, int 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;
@@ -1770,7 +1585,6 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                /* Hack -- Affect player */
                if (flag)
                {
-                       /* Message */
                        msg_print(_("燃えるような閃光が発生した!", "There is a searing blast of light!"));
 
                        /* Blind the player */
@@ -1786,13 +1600,10 @@ bool destroy_area(int y1, int x1, int 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)
@@ -1833,9 +1644,11 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
  * This has allowed massive simplification of the "monster" code.
  * </pre>
  */
-bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
+bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 {
-       int             i, t, y, x, yy, xx, dy, dx;
+       DIRECTION i;
+       int t;
+       POSITION y, x, yy, xx, dy, dx;
        int             damage = 0;
        int             sn = 0;
        POSITION        sy = 0, sx = 0;
@@ -1876,8 +1689,6 @@ bool earthquake_aux(int cy, int cx, int 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 */
@@ -1991,14 +1802,13 @@ bool earthquake_aux(int cy, int cx, int 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;
 
                        if (m_idx)
                        {
-                               char m_name[80];
+                               GAME_TEXT m_name[MAX_NLEN];
                                monster_type *m_ptr = &m_list[m_idx];
 
                                /* Get the monster's real name */
@@ -2026,8 +1836,6 @@ bool earthquake_aux(int cy, int cx, int 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;
@@ -2051,7 +1859,7 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
                                if (!(r_ptr->flags2 & (RF2_KILL_WALL)) &&
                                    !(r_ptr->flags2 & (RF2_PASS_WALL)))
                                {
-                                       char m_name[80];
+                                       GAME_TEXT m_name[MAX_NLEN];
 
                                        /* Assume not safe */
                                        sn = 0;
@@ -2062,7 +1870,6 @@ bool earthquake_aux(int cy, int cx, int 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];
 
@@ -2111,7 +1918,6 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
                                        /* Delete (not kill) "dead" monsters */
                                        if (m_ptr->hp < 0)
                                        {
-                                               /* Message */
                                                if (!ignore_unview || is_seen(m_ptr)) 
                                                        msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
 
@@ -2119,14 +1925,13 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
                                                {
                                                        if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname)
                                                        {
-                                                               char m2_name[80];
+                                                               char m2_name[MAX_NLEN];
 
                                                                monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
                                                                do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
                                                        }
                                                }
 
-                                               /* Delete the monster */
                                                delete_monster(yy, xx);
 
                                                /* No longer safe */
@@ -2148,13 +1953,8 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
                                                m_ptr->fy = sy;
                                                m_ptr->fx = sx;
 
-                                               /* Update the monster (new location) */
-                                               update_mon(m_idx, TRUE);
-
-                                               /* Redraw the old grid */
+                                               update_monster(m_idx, TRUE);
                                                lite_spot(yy, xx);
-
-                                               /* Redraw the new grid */
                                                lite_spot(sy, sx);
                                        }
                                }
@@ -2238,8 +2038,6 @@ bool earthquake_aux(int cy, int cx, int 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;
@@ -2268,16 +2066,13 @@ bool earthquake_aux(int cy, int cx, int 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)
@@ -2297,7 +2092,7 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
  * @param cx 中心X座標
  * @param r 効果半径
  */
-bool earthquake(int cy, int cx, int r)
+bool earthquake(POSITION cy, POSITION cx, POSITION r)
 {
        return earthquake_aux(cy, cx, r, 0);
 }
@@ -2334,7 +2129,7 @@ void discharge_minion(void)
                /* Uniques resist discharging */
                if (r_ptr->flags1 & RF1_UNIQUE)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
                        monster_desc(m_name, m_ptr, 0x00);
                        msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
                        delete_monster_idx(i);
@@ -2350,7 +2145,7 @@ void discharge_minion(void)
 
                if (record_named_pet && m_ptr->nickname)
                {
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
 
                        monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                        do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
@@ -2384,8 +2179,8 @@ static void cave_temp_room_lite(void)
        /* Clear them all */
        for (i = 0; i < temp_n; i++)
        {
-               int y = temp_y[i];
-               int x = temp_x[i];
+               POSITION y = temp_y[i];
+               POSITION x = temp_x[i];
 
                cave_type *c_ptr = &cave[y][x];
 
@@ -2402,13 +2197,9 @@ static void cave_temp_room_lite(void)
                if (c_ptr->m_idx)
                {
                        int chance = 25;
-
                        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;
@@ -2425,12 +2216,8 @@ static void cave_temp_room_lite(void)
                                /* Notice the "waking up" */
                                if (m_ptr->ml)
                                {
-                                       char m_name[80];
-
-                                       /* Acquire the monster name */
+                                       GAME_TEXT m_name[MAX_NLEN];
                                        monster_desc(m_name, m_ptr, 0);
-
-                                       /* Dump a message */
                                        msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
                                }
                        }
@@ -2439,7 +2226,6 @@ static void cave_temp_room_lite(void)
                /* Note */
                note_spot(y, x);
 
-               /* Redraw */
                lite_spot(y, x);
 
                update_local_illumination(y, x);
@@ -2470,8 +2256,8 @@ static void cave_temp_room_unlite(void)
        /* Clear them all */
        for (i = 0; i < temp_n; i++)
        {
-               int y = temp_y[i];
-               int x = temp_x[i];
+               POSITION y = temp_y[i];
+               POSITION x = temp_x[i];
                int j;
 
                cave_type *c_ptr = &cave[y][x];
@@ -2513,18 +2299,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);
@@ -2543,12 +2326,10 @@ static void cave_temp_room_unlite(void)
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
 {
        int i;
-
-       int y, x;
-
+       POSITION y, x;
        int len = 0;
        int blen = 0;
 
@@ -2584,12 +2365,10 @@ static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
 {
-       int i;
-
-       int y, x;
-
+       DIRECTION i;
+       POSITION y, x;
        int c = 0;
 
        for (i = 0; i < 8; i++)
@@ -2612,7 +2391,7 @@ static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(int, int))
+static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
 {
        cave_type *c_ptr;
 
@@ -2664,7 +2443,7 @@ static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(i
  * @param x 指定X座標
  * @return 光を通すならばtrueを返す。
  */
-static bool cave_pass_lite_bold(int y, int x)
+static bool cave_pass_lite_bold(POSITION y, POSITION x)
 {
        return cave_los_bold(y, x);
 }
@@ -2675,7 +2454,7 @@ static bool cave_pass_lite_bold(int y, int x)
  * @param x 指定X座標
  * @return なし
  */
-static void cave_temp_lite_room_aux(int y, int x)
+static void cave_temp_lite_room_aux(POSITION y, POSITION x)
 {
        cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
 }
@@ -2686,7 +2465,7 @@ static void cave_temp_lite_room_aux(int y, int x)
  * @param x 指定X座標
  * @return 射線を通すならばtrueを返す。
  */
-static bool cave_pass_dark_bold(int y, int x)
+static bool cave_pass_dark_bold(POSITION y, POSITION x)
 {
        return cave_have_flag_bold(y, x, FF_PROJECT);
 }
@@ -2698,7 +2477,7 @@ static bool cave_pass_dark_bold(int y, int x)
  * @param x 指定X座標
  * @return なし
  */
-static void cave_temp_unlite_room_aux(int y, int x)
+static void cave_temp_unlite_room_aux(POSITION y, POSITION x)
 {
        cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
 }
@@ -2710,9 +2489,10 @@ static void cave_temp_unlite_room_aux(int y, int x)
  * @param x1 指定X座標
  * @return なし
  */
-void lite_room(int y1, int x1)
+void lite_room(POSITION y1, POSITION x1)
 {
-       int i, x, y;
+       int i;
+       POSITION x, y;
 
        /* Add the initial grid */
        cave_temp_lite_room_aux(y1, x1);
@@ -2754,9 +2534,10 @@ void lite_room(int y1, int x1)
  * @param x1 指定X座標
  * @return なし
  */
-void unlite_room(int y1, int x1)
+void unlite_room(POSITION y1, POSITION x1)
 {
-       int i, x, y;
+       int i;
+       POSITION x, y;
 
        /* Add the initial grid */
        cave_temp_unlite_room_aux(y1, x1);
@@ -2794,7 +2575,7 @@ void unlite_room(int y1, int x1)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_area(HIT_POINT dam, int rad)
+bool lite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
@@ -2827,7 +2608,7 @@ bool lite_area(HIT_POINT dam, int rad)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool unlite_area(HIT_POINT dam, int rad)
+bool unlite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
@@ -2863,9 +2644,9 @@ bool unlite_area(HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       int tx, ty;
+       POSITION tx, ty;
 
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
@@ -2900,9 +2681,9 @@ bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
 * Affect grids, objects, and monsters
 * </pre>
 */
-bool fire_breath(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       fire_ball(typ, dir, dam, -rad);
+       return fire_ball(typ, dir, dam, -rad);
 }
 
 
@@ -2920,10 +2701,9 @@ bool fire_breath(int typ, int dir, HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       int tx, ty;
-
+       POSITION tx, ty;
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        /* Use the given direction */
@@ -2956,10 +2736,9 @@ bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball_hide(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       int tx, ty;
-
+       POSITION tx, ty;
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
 
        /* Use the given direction */
@@ -3016,10 +2795,11 @@ bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POI
  * @param dev 回数分散
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
+bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
 {
-       int ly, lx, ld;
-       int ty, tx, y, x;
+       POSITION ly, lx;
+       int ld;
+       POSITION ty, tx, y, x;
        int i;
 
        BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
@@ -3074,12 +2854,12 @@ bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool teleport_swap(int dir)
+bool teleport_swap(DIRECTION dir)
 {
-       int tx, ty;
-       cave_type * c_ptr;
-       monster_type * m_ptr;
-       monster_race * r_ptr;
+       POSITION tx, ty;
+       cave_type* c_ptr;
+       monster_type* m_ptr;
+       monster_race* r_ptr;
 
        if ((dir == 5) && target_okay())
        {
@@ -3148,7 +2928,7 @@ bool teleport_swap(int dir)
  * @param flg フラグ
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
+bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
 {
        int tx, ty;
 
@@ -3183,7 +2963,7 @@ bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
  * Affect monsters and grids (not objects).
  * </pre>
  */
-bool fire_bolt(int typ, int dir, HIT_POINT dam)
+bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
        if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
@@ -3203,7 +2983,7 @@ bool fire_bolt(int typ, int dir, HIT_POINT dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_beam(int typ, int dir, HIT_POINT dam)
+bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(typ, dir, dam, flg));
@@ -3223,7 +3003,7 @@ bool fire_beam(int typ, int dir, HIT_POINT dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
+bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        if (randint0(100) < prob)
        {
@@ -3241,7 +3021,7 @@ bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_line(int dir, HIT_POINT dam)
+bool lite_line(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
        return (project_hook(GF_LITE_WEAK, dir, dam, flg));
@@ -3253,7 +3033,7 @@ bool lite_line(int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool hypodynamic_bolt(int dir, HIT_POINT dam)
+bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
@@ -3265,7 +3045,7 @@ bool hypodynamic_bolt(int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wall_to_mud(int dir, HIT_POINT dam)
+bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_KILL_WALL, dir, dam, flg));
@@ -3276,7 +3056,7 @@ bool wall_to_mud(int dir, HIT_POINT dam)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wizard_lock(int dir)
+bool wizard_lock(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
@@ -3287,7 +3067,7 @@ bool wizard_lock(int dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool destroy_door(int dir)
+bool destroy_door(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_DOOR, dir, 0, flg));
@@ -3298,7 +3078,7 @@ bool destroy_door(int dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool disarm_trap(int dir)
+bool disarm_trap(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_TRAP, dir, 0, flg));
@@ -3310,7 +3090,7 @@ bool disarm_trap(int dir)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool heal_monster(int dir, HIT_POINT dam)
+bool heal_monster(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_HEAL, dir, dam, flg));
@@ -3322,7 +3102,7 @@ bool heal_monster(int dir, HIT_POINT dam)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool speed_monster(int dir, int power)
+bool speed_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SPEED, dir, power, flg));
@@ -3334,7 +3114,7 @@ bool speed_monster(int dir, int power)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool slow_monster(int dir, int power)
+bool slow_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLOW, dir, power, flg));
@@ -3346,7 +3126,7 @@ bool slow_monster(int dir, int power)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool sleep_monster(int dir, int power)
+bool sleep_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLEEP, dir, power, flg));
@@ -3358,7 +3138,7 @@ bool sleep_monster(int dir, int power)
  * @return 作用が実際にあった場合TRUEを返す
  * @details 威力はプレイヤーレベル*2に固定
  */
-bool stasis_monster(int dir)
+bool stasis_monster(DIRECTION dir)
 {
        return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
 }
@@ -3369,7 +3149,7 @@ bool stasis_monster(int dir)
  * @return 作用が実際にあった場合TRUEを返す
  * @details 威力はプレイヤーレベル*2に固定
  */
-bool stasis_evil(int dir)
+bool stasis_evil(DIRECTION dir)
 {
        return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
 }
@@ -3380,7 +3160,7 @@ bool stasis_evil(int dir)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool confuse_monster(int dir, int plev)
+bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CONF, dir, plev, flg));
@@ -3392,7 +3172,7 @@ bool confuse_monster(int dir, int plev)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool stun_monster(int dir, int plev)
+bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_STUN, dir, plev, flg));
@@ -3404,7 +3184,7 @@ bool stun_monster(int dir, int plev)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool poly_monster(int dir, int power)
+bool poly_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
@@ -3418,7 +3198,7 @@ bool poly_monster(int dir, int power)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool clone_monster(int dir)
+bool clone_monster(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CLONE, dir, 0, flg));
@@ -3430,7 +3210,7 @@ bool clone_monster(int dir)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool fear_monster(int dir, int plev)
+bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_TURN_ALL, dir, plev, flg));
@@ -3442,7 +3222,7 @@ bool fear_monster(int dir, int plev)
  * @param plev プレイヤーレベル(効力はplev*200)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool death_ray(int dir, int plev)
+bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
@@ -3454,7 +3234,7 @@ bool death_ray(int dir, int plev)
  * @param distance 移動距離
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool teleport_monster(int dir, int distance)
+bool teleport_monster(DIRECTION dir, int distance)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
        return (project_hook(GF_AWAY_ALL, dir, distance, flg));
@@ -3476,7 +3256,7 @@ bool door_creation(void)
  * @param x 起点X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool trap_creation(int y, int x)
+bool trap_creation(POSITION y, POSITION x)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
@@ -3512,10 +3292,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;
@@ -3554,7 +3332,7 @@ bool sleep_monsters_touch(void)
 
 /*!
  * @brief 死者復活処理(起点より周囲5マス)
- * @param who è¡\93è\80\85ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID(0ã\81ªã\82\89ã\81°ã\83\97ã\83¬ã\82¤ã\82\84ー)
+ * @param who è¡\93è\80\85ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID(0ã\81ªã\82\89ã\81°ã\83\97ã\83¬ã\82¤ã\83¤ー)
  * @param y 起点Y座標
  * @param x 起点X座標
  * @return 作用が実際にあった場合TRUEを返す
@@ -3572,7 +3350,7 @@ bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x)
 void call_chaos(void)
 {
        int Chaos_type, dummy, dir;
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        bool line_chaos = FALSE;
 
        int hurt_types[31] =
@@ -3678,7 +3456,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
                        if (!one_in_(6)) break;
                case 7: case 8: case 9: case 18:
-                       (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
                        if (!one_in_(6)) break;
                case 10: case 11: case 12:
                        msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
@@ -3718,7 +3496,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        }
                        if (!one_in_(6)) break;
                default:
-                       while (i < 6)
+                       while (i < A_MAX)
                        {
                                do
                                {
@@ -3772,51 +3550,51 @@ int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
                switch (randint1(25) + (dun_level / 20))
                {
                        case 1: case 2:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode, '\0');
                                break;
                        case 3: case 4:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode, '\0');
                                break;
                        case 5: case 6:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode, '\0');
                                break;
                        case 7: case 8:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode, '\0');
                                break;
                        case 9: case 10:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode, '\0');
                                break;
                        case 11: case 12:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode, '\0');
                                break;
                        case 13: case 14:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode, '\0');
                                break;
                        case 15: case 16:
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode, '\0');
                                break;
                        case 17:
                                if (can_pet) break;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE), '\0');
                                break;
                        case 18: case 19:
                                if (can_pet) break;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE), '\0');
                                break;
                        case 20: case 21:
                                if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode, '\0');
                                break;
                        case 22: case 23:
                                if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode, '\0');
                                break;
                        case 24:
-                               count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode, '\0');
                                break;
                        default:
                                if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                               count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
+                               count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode, '\0');
                }
        }
 
@@ -3849,7 +3627,7 @@ int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
 
        for (i = 0; i < max_cyber; i++)
        {
-               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode);
+               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
        }
 
        return count;
@@ -3910,7 +3688,7 @@ void wall_breaker(void)
  */
 bool confuse_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_OLD_CONF, dam));
+       return (project_all_los(GF_OLD_CONF, dam));
 }
 
 
@@ -3921,7 +3699,7 @@ bool confuse_monsters(HIT_POINT dam)
  */
 bool charm_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_CHARM, dam));
+       return (project_all_los(GF_CHARM, dam));
 }
 
 
@@ -3932,7 +3710,7 @@ bool charm_monsters(HIT_POINT dam)
  */
 bool charm_animals(HIT_POINT dam)
 {
-       return (project_hack(GF_CONTROL_ANIMAL, dam));
+       return (project_all_los(GF_CONTROL_ANIMAL, dam));
 }
 
 
@@ -3943,7 +3721,7 @@ bool charm_animals(HIT_POINT dam)
  */
 bool stun_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_STUN, dam));
+       return (project_all_los(GF_STUN, dam));
 }
 
 
@@ -3954,7 +3732,7 @@ bool stun_monsters(HIT_POINT dam)
  */
 bool stasis_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_STASIS, dam));
+       return (project_all_los(GF_STASIS, dam));
 }
 
 
@@ -3965,7 +3743,7 @@ bool stasis_monsters(HIT_POINT dam)
  */
 bool mindblast_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_PSI, dam));
+       return (project_all_los(GF_PSI, dam));
 }
 
 
@@ -3976,7 +3754,7 @@ bool mindblast_monsters(HIT_POINT dam)
  */
 bool banish_monsters(int dist)
 {
-       return (project_hack(GF_AWAY_ALL, dist));
+       return (project_all_los(GF_AWAY_ALL, dist));
 }
 
 
@@ -3987,7 +3765,7 @@ bool banish_monsters(int dist)
  */
 bool turn_evil(HIT_POINT dam)
 {
-       return (project_hack(GF_TURN_EVIL, dam));
+       return (project_all_los(GF_TURN_EVIL, dam));
 }
 
 
@@ -3998,7 +3776,7 @@ bool turn_evil(HIT_POINT dam)
  */
 bool turn_monsters(HIT_POINT dam)
 {
-       return (project_hack(GF_TURN_ALL, dam));
+       return (project_all_los(GF_TURN_ALL, dam));
 }
 
 
@@ -4008,7 +3786,7 @@ bool turn_monsters(HIT_POINT dam)
  */
 bool deathray_monsters(void)
 {
-       return (project_hack(GF_DEATH_RAY, p_ptr->lev * 200));
+       return (project_all_los(GF_DEATH_RAY, p_ptr->lev * 200));
 }
 
 /*!
@@ -4017,7 +3795,7 @@ bool deathray_monsters(void)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_monster(int dir, int plev)
+bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CHARM, dir, plev, flg));
@@ -4029,7 +3807,7 @@ bool charm_monster(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool control_one_undead(int dir, int plev)
+bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
@@ -4041,7 +3819,7 @@ bool control_one_undead(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool control_one_demon(int dir, int plev)
+bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
@@ -4053,7 +3831,7 @@ bool control_one_demon(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_animal(int dir, int plev)
+bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
@@ -4069,7 +3847,7 @@ bool kawarimi(bool success)
 {
        object_type forge;
        object_type *q_ptr = &forge;
-       int y, x;
+       POSITION y, x;
 
        if (p_ptr->is_dead) return FALSE;
        if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
@@ -4087,23 +3865,14 @@ bool kawarimi(bool success)
        x = p_ptr->x;
 
        teleport_player(10 + randint1(90), 0L);
-
        object_wipe(q_ptr);
-
        object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
 
        q_ptr->pval = MON_NINJA;
-
-       /* Drop it in the dungeon */
        (void)drop_near(q_ptr, -1, y, x);
 
-#ifdef JP
-       if (success) msg_print("攻撃を受ける前に素早く身をひるがえした。");
-       else msg_print("失敗!攻撃を受けてしまった。");
-#else
-       if (success) msg_print("You have turned around just before the attack hit you.");
-       else msg_print("Failed! You are hit by the attack.");
-#endif
+       if (success) msg_print(_("攻撃を受ける前に素早く身をひるがえした。", "You have turned around just before the attack hit you."));
+       else msg_print(_("失敗!攻撃を受けてしまった。", "Failed! You are hit by the attack."));
 
        p_ptr->special_defense &= ~(NINJA_KAWARIMI);
        p_ptr->redraw |= (PR_STATUS);
@@ -4120,7 +3889,7 @@ bool kawarimi(bool success)
  */
 bool rush_attack(bool *mdeath)
 {
-       int dir;
+       DIRECTION dir;
        int tx, ty;
        int tm_idx = 0;
        u16b path_g[32];
@@ -4190,9 +3959,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];
@@ -4200,8 +3967,7 @@ bool rush_attack(bool *mdeath)
                if (tm_idx != cave[ny][nx].m_idx)
                {
 #ifdef JP
-                       msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "",
-                                  m_ptr->ml ? "モンスター" : "何か");
+                       msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
 #else
                        msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone");
 #endif
@@ -4209,7 +3975,7 @@ bool rush_attack(bool *mdeath)
                else if (!player_bold(ty, tx))
                {
                        /* Hold the monster name */
-                       char m_name[80];
+                       GAME_TEXT m_name[MAX_NLEN];
 
                        /* Get the monster name (BEFORE polymorphing) */
                        monster_desc(m_name, m_ptr, 0);
@@ -4237,7 +4003,7 @@ bool rush_attack(bool *mdeath)
  */
 void remove_all_mirrors(bool explode)
 {
-       int x, y;
+       POSITION x, y;
 
        for (x = 0; x < cur_wid; x++)
        {
@@ -4260,7 +4026,7 @@ void remove_all_mirrors(bool explode)
  * @param dir 発動の方向ID
  * @return なし
  */
-void ring_of_power(int dir)
+void ring_of_power(DIRECTION dir)
 {
        /* Pick a random effect */
        switch (randint1(10))
@@ -4268,7 +4034,6 @@ void ring_of_power(int dir)
        case 1:
        case 2:
        {
-               /* Message */
                msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
                sound(SOUND_EVIL);
 
@@ -4290,7 +4055,6 @@ void ring_of_power(int dir)
 
        case 3:
        {
-               /* Message */
                msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
 
                /* Dispel monsters */
@@ -4406,7 +4170,7 @@ void wild_magic(int spell)
        case 35:
                while (counter++ < 8)
                {
-                       (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+                       (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
                }
                break;
        case 36:
@@ -4434,7 +4198,7 @@ void wild_magic(int spell)
 * @param rad 効力の半径
 * @return なし
 */
-void cast_meteor(HIT_POINT dam, int rad)
+void cast_meteor(HIT_POINT dam, POSITION rad)
 {
        int i;
        int b = 10 + randint1(10);
@@ -4479,11 +4243,12 @@ void cast_meteor(HIT_POINT dam, int rad)
 * @param rad 効力の半径
 * @return ターゲットを指定し、実行したならばTRUEを返す。
 */
-bool cast_wrath_of_the_god(HIT_POINT dam, int rad)
+bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
 {
-       int x, y, tx, ty;
-       int nx, ny;
-       int dir, i;
+       POSITION x, y, tx, ty;
+       POSITION nx, ny;
+       DIRECTION dir;
+       int i;
        int b = 10 + randint1(10);
 
        if (!get_aim_dir(&dir)) return FALSE;
@@ -4572,9 +4337,9 @@ bool cast_wrath_of_the_god(HIT_POINT dam, int rad)
 * while keeping the results quite random.  It also allows some potent\n
 * effects only at high level.
 */
-void cast_wonder(int dir)
+void cast_wonder(DIRECTION dir)
 {
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        int die = randint1(100) + plev / 5;
        int vir = virtue_number(V_CHANCE);
 
@@ -4654,9 +4419,9 @@ void cast_wonder(int dir)
 * @param dir 方向ID
 * @return なし
 */
-void cast_invoke_spirits(int dir)
+void cast_invoke_spirits(DIRECTION dir)
 {
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        int die = randint1(100) + plev / 5;
        int vir = virtue_number(V_CHANCE);
 
@@ -4686,7 +4451,7 @@ void cast_invoke_spirits(int dir)
                msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
                        "Oh no! Mouldering forms rise from the earth around you!"));
 
-               (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+               (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
                chg_virtue(V_UNLIFE, 1);
        }
        else if (die < 14)
@@ -4804,8 +4569,8 @@ void cast_invoke_spirits(int dir)
 */
 void cast_shuffle(void)
 {
-       int plev = p_ptr->lev;
-       int dir;
+       PLAYER_LEVEL plev = p_ptr->lev;
+       DIRECTION dir;
        int die;
        int vir = virtue_number(V_CHANCE);
        int i;
@@ -4846,7 +4611,7 @@ void cast_shuffle(void)
        else if (die < 14)
        {
                msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
-               summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+               summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
        }
        else if (die < 18)
        {
@@ -4974,3 +4739,348 @@ void cast_shuffle(void)
        }
 }
 
+bool_hack life_stream(bool_hack message, bool_hack virtue)
+{
+       if(virtue)
+       {
+               chg_virtue(V_VITALITY, 1);
+               chg_virtue(V_UNLIFE, -5);
+       }
+       if(message)
+       {
+               msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
+       }
+       restore_level();
+       (void)set_poisoned(0);
+       (void)set_blind(0);
+       (void)set_confused(0);
+       (void)set_image(0);
+       (void)set_stun(0);
+       (void)set_cut(0);
+       (void)restore_all_status();
+       (void)set_shero(0, TRUE);
+       handle_stuff();
+       hp_player(5000);
+
+       return TRUE;
+}
+
+bool_hack heroism(int base)
+{
+       bool_hack ident = FALSE;
+       if(set_afraid(0)) ident = TRUE;
+       if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if(hp_player(10)) ident = TRUE;
+       return ident;
+}
+
+bool_hack berserk(int base)
+{
+       bool_hack ident = FALSE;
+       if (set_afraid(0)) ident = TRUE;
+       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(30)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_critical_wounds(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack true_healing(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_image(0)) ident = TRUE;
+       return ident;
+}
+
+bool_hack restore_mana(bool_hack magic_eater)
+{
+       bool_hack ident = FALSE;
+
+       if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
+       {
+               int i;
+               for (i = 0; i < EATER_EXT * 2; i++)
+               {
+                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
+                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
+               }
+               for (; i < EATER_EXT * 3; i++)
+               {
+                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
+                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
+                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+               }
+               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+               p_ptr->window |= (PW_PLAYER);
+               ident = TRUE;
+       }
+       else if (p_ptr->csp < p_ptr->msp)
+       {
+               p_ptr->csp = p_ptr->msp;
+               p_ptr->csp_frac = 0;
+               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+               p_ptr->redraw |= (PR_MANA);
+               p_ptr->window |= (PW_PLAYER);
+               p_ptr->window |= (PW_SPELL);
+               ident = TRUE;
+       }
+
+       return ident;
+}
+
+bool restore_all_status(void)
+{
+       bool ident = FALSE; 
+       if (do_res_stat(A_STR)) ident = TRUE;
+       if (do_res_stat(A_INT)) ident = TRUE;
+       if (do_res_stat(A_WIS)) ident = TRUE;
+       if (do_res_stat(A_DEX)) ident = TRUE;
+       if (do_res_stat(A_CON)) ident = TRUE;
+       if (do_res_stat(A_CHR)) ident = TRUE;
+       return ident;
+}
+
+/*!
+ * @brief 口を使う継続的な処理を中断する
+ * @return なし
+ */
+void stop_mouth(void)
+{
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
+bool_hack vampirism(void)
+{
+       DIRECTION dir;
+       POSITION x, y;
+       int dummy;
+       cave_type *c_ptr;
+
+       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       {
+               msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
+               return FALSE;
+       }
+
+       /* Only works on adjacent monsters */
+       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];
+
+       stop_mouth();
+
+       if (!(c_ptr->m_idx))
+       {
+               msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
+               return FALSE;
+       }
+
+       msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
+
+       dummy = p_ptr->lev * 2;
+
+       if (hypodynamic_bolt(dir, dummy))
+       {
+               if (p_ptr->food < PY_FOOD_FULL)
+                       /* No heal if we are "full" */
+                       (void)hp_player(dummy);
+               else
+                       msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
+
+               /* Gain nutritional sustenance: 150/hp drained */
+               /* A Food ration gives 5000 food points (by contrast) */
+               /* Don't ever get more than "Full" this way */
+               /* But if we ARE Gorged,  it won't cure us */
+               dummy = p_ptr->food + MIN(5000, 100 * dummy);
+               if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
+                       (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
+       }
+       else
+               msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
+       return TRUE;
+}
+
+bool panic_hit(void)
+{
+       DIRECTION dir;
+       POSITION x, y;
+
+       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)
+       {
+               py_attack(y, x, 0);
+               if (randint0(p_ptr->skill_dis) < 7)
+                       msg_print(_("うまく逃げられなかった。", "You failed to run away."));
+               else
+                       teleport_player(30, 0L);
+               return TRUE;
+       }
+       else
+       {
+               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+               msg_print(NULL);
+               return FALSE;
+       }
+
+}
+
+/*!
+* @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
+* @return なし
+* @note
+* currently this function allows pseudo-id of any object,
+* including silly ones like potions & scrolls, which always
+* get '{average}'. This should be changed, either to stop such
+* items from being pseudo-id'd, or to allow psychometry to
+* detect whether the unidentified potion/scroll/etc is
+* good (Cure Light Wounds, Restore Strength, etc) or
+* bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
+*/
+bool psychometry(void)
+{
+       OBJECT_IDX      item;
+       object_type     *o_ptr;
+       GAME_TEXT o_name[MAX_NLEN];
+       byte            feel;
+       cptr            q, s;
+       bool okay = FALSE;
+
+       q = _("どのアイテムを調べますか?", "Meditate on which item? ");
+       s = _("調べるアイテムがありません。", "You have nothing appropriate.");
+
+       if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT))) return (FALSE);
+
+       /* Get the item (in the pack) */
+       if (item >= 0)
+       {
+               o_ptr = &inventory[item];
+       }
+
+       /* Get the item (on the floor) */
+       else
+       {
+               o_ptr = &o_list[0 - item];
+       }
+
+       /* It is fully known, no information needed */
+       if (object_is_known(o_ptr))
+       {
+               msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
+               return TRUE;
+       }
+
+       /* Check for a feeling */
+       feel = value_check_aux1(o_ptr);
+
+       /* Get an object description */
+       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+
+       /* Skip non-feelings */
+       if (!feel)
+       {
+               msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
+               return TRUE;
+       }
+
+#ifdef JP
+       msg_format("%sは%sという感じがする...",
+               o_name, game_inscriptions[feel]);
+#else
+       msg_format("You feel that the %s %s %s...",
+               o_name, ((o_ptr->number == 1) ? "is" : "are"),
+               game_inscriptions[feel]);
+#endif
+
+
+       /* We have "felt" it */
+       o_ptr->ident |= (IDENT_SENSE);
+
+       /* "Inscribe" it */
+       o_ptr->feeling = feel;
+
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
+       /* Combine / Reorder the pack (later) */
+       p_ptr->update |= (PU_COMBINE | PU_REORDER);
+
+       p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+
+       /* Valid "tval" codes */
+       switch (o_ptr->tval)
+       {
+       case TV_SHOT:
+       case TV_ARROW:
+       case TV_BOLT:
+       case TV_BOW:
+       case TV_DIGGING:
+       case TV_HAFTED:
+       case TV_POLEARM:
+       case TV_SWORD:
+       case TV_BOOTS:
+       case TV_GLOVES:
+       case TV_HELM:
+       case TV_CROWN:
+       case TV_SHIELD:
+       case TV_CLOAK:
+       case TV_SOFT_ARMOR:
+       case TV_HARD_ARMOR:
+       case TV_DRAG_ARMOR:
+       case TV_CARD:
+       case TV_RING:
+       case TV_AMULET:
+       case TV_LITE:
+       case TV_FIGURINE:
+               okay = TRUE;
+               break;
+       }
+
+       /* Auto-inscription/destroy */
+       autopick_alter_item(item, (bool)(okay && destroy_feeling));
+
+       /* Something happened */
+       return (TRUE);
+}