OSDN Git Service

[Refactor] #37353 鏡使いのレイシャル「静水」を mirror_concentration() に分離。 / Separate Mirror master...
[hengband/hengband.git] / src / spells2.c
index 94194fa..a10c445 100644 (file)
 #include "angband.h"
 #include "grid.h"
 #include "trap.h"
+#include "monsterrace-hook.h"
+#include "melee.h"
+#include "world.h"
+#include "projection.h"
+#include "spells-summon.h"
+#include "mutation.h"
+#include "quest.h"
+#include "avatar.h"
 
+#include "spells-status.h"
 
 /*!
  * @brief プレイヤー周辺の地形を感知する
@@ -25,8 +34,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 +47,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 +59,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
 
                                        c_ptr->info &= ~(CAVE_UNSAFE);
 
-                                       /* Redraw */
                                        lite_spot(y, x);
                                }
                        }
@@ -66,16 +72,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 +95,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 +113,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 +131,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 +149,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 +164,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 +183,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 +192,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 +208,6 @@ bool detect_objects_gold(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -242,7 +219,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 +238,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 +247,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 +263,6 @@ bool detect_objects_normal(POSITION range)
        {
                detect = TRUE;
        }
-
-       /* Result */
        return (detect);
 }
 
@@ -314,7 +282,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 +301,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 +338,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!"));
@@ -398,12 +361,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];
@@ -412,7 +373,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;
 
@@ -425,27 +385,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);
 }
 
@@ -463,7 +413,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];
@@ -472,7 +421,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,34 +433,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);
 }
 
@@ -529,7 +466,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];
@@ -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);
                                }
                        }
@@ -564,25 +498,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);
 }
 
@@ -599,16 +523,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;
 
@@ -616,37 +537,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);
 }
 
@@ -659,11 +569,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];
@@ -672,7 +581,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,32 +593,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);
 }
 
@@ -721,7 +618,7 @@ bool detect_monsters_mind(POSITION range)
  * @param Match 対応シンボルの混じったモンスター文字列(複数指定化)
  * @return 効力があった場合TRUEを返す
  */
-bool detect_monsters_string(POSITION range, cptr Match)
+bool detect_monsters_string(POSITION range, concptr Match)
 {
        MONSTER_IDX i;
        POSITION y, x;
@@ -729,7 +626,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];
@@ -738,7 +634,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,34 +646,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);
 }
 
@@ -793,11 +677,10 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
        MONSTER_IDX i;
        POSITION y, x;
        bool flag = FALSE;
-       cptr desc_monsters = _("変なモンスター", "weird monsters");
+       concptr desc_monsters = _("変なモンスター", "weird monsters");
 
        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];
@@ -806,7 +689,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 +706,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);
                                }
                        }
@@ -832,18 +713,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)
@@ -856,12 +730,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);
 }
 
@@ -887,8 +758,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);
 }
 
@@ -906,11 +775,12 @@ bool detect_all(POSITION range)
  * this is done in two passes. -- JDL
  * </pre>
  */
-bool project_hack(EFFECT_ID 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 */
@@ -921,7 +791,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 +812,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);
 }
 
@@ -962,7 +828,7 @@ bool project_hack(EFFECT_ID 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));
 }
 
 /*!
@@ -971,7 +837,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));
 }
 
 /*!
@@ -980,7 +846,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));
 }
 
 /*!
@@ -989,7 +855,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));
 }
 
 /*!
@@ -998,7 +864,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;
@@ -1010,7 +876,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;
@@ -1022,7 +888,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));
 }
 
 /*!
@@ -1031,7 +897,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));
 }
 
 /*!
@@ -1040,7 +906,33 @@ 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));
+}
+
+bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
+{
+       bool ident = FALSE;
+       if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
+       int k = 3 * creature_ptr->lev;
+       if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_afraid(0)) ident = TRUE;
+       if (hp_player(50)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       return ident;
+}
+
+bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
+{
+       msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
+       project(0, (powerful ? 7 : 5), p_ptr->y, p_ptr->x,
+       (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
+       if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
+       {
+               (void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
+       }
+       return TRUE;
 }
 
 /*!
@@ -1049,7 +941,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));
 }
 
 /*!
@@ -1058,7 +950,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));
 }
 
 /*!
@@ -1067,7 +959,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));
 }
 
 /*!
@@ -1081,12 +973,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 +1007,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;
 }
 
@@ -1138,7 +1022,7 @@ void aggravate_monsters(MONSTER_IDX who)
  * @param spell_name 抹殺効果を起こした魔法の名前
  * @return 効力があった場合TRUEを返す
  */
-bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, cptr spell_name)
+bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name)
 {
        int          msec = delay_factor * delay_factor * delay_factor;
        monster_type *m_ptr = &m_list[m_idx];
@@ -1149,23 +1033,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);
@@ -1177,7 +1056,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)
@@ -1205,26 +1084,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;
@@ -1246,6 +1117,7 @@ bool symbol_genocide(int power, bool player_cast)
        /* Prevent genocide in quest levels */
        if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
+               msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
                return (FALSE);
        }
 
@@ -1264,7 +1136,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"));
        }
 
@@ -1371,11 +1242,12 @@ 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];
-       cptr align;
+       concptr align;
 
        cu = Term->scr->cu;
        cv = Term->scr->cv;
@@ -1397,7 +1269,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)
@@ -1424,25 +1296,14 @@ 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:"),
                                m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
 
@@ -1455,26 +1316,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();
@@ -1515,8 +1369,6 @@ bool probing(void)
                chg_virtue(V_KNOWLEDGE, 1);
                msg_print(_("これで全部です。", "That's all."));
        }
-
-       /* Result */
        return (probe);
 }
 
@@ -1542,7 +1394,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)
@@ -1566,8 +1418,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 */
@@ -1617,7 +1467,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION 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);
@@ -1637,8 +1487,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 */
@@ -1652,7 +1500,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION 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);
                                                }
@@ -1665,7 +1513,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                }
                        }
 
-                       /* Delete objects */
                        delete_object(y, x);
 
                        /* Destroy "non-permanent" grids */
@@ -1742,14 +1589,13 @@ 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;
                                else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
                                {
-                                       int i, yy, xx;
+                                       DIRECTION i;
+                                       POSITION yy, xx;
                                        cave_type *cc_ptr;
 
                                        for (i = 0; i < 9; i++)
@@ -1784,15 +1630,8 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                forget_flow();
 
                /* 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->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
                p_ptr->redraw |= (PR_MAP);
-
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                if (p_ptr->special_defense & NINJA_S_STEALTH)
@@ -1835,15 +1674,15 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
  */
 bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 {
-       int i, t;
+       DIRECTION i;
+       int t;
        POSITION y, x, yy, xx, dy, dx;
-       int             damage = 0;
-       int             sn = 0;
-       POSITION        sy = 0, sx = 0;
-       bool            hurt = FALSE;
-       cave_type       *c_ptr;
-       bool            map[32][32];
-
+       int damage = 0;
+       int sn = 0;
+       POSITION sy = 0, sx = 0;
+       bool hurt = FALSE;
+       cave_type *c_ptr;
+       bool map[32][32];
 
        /* Prevent destruction of quest levels and town */
        if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
@@ -1877,14 +1716,10 @@ 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 */
+                       /* Lose room and vault / Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
-
-                       /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
 
                        /* Skip the epicenter */
@@ -1992,14 +1827,13 @@ 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;
+                       concptr 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 */
@@ -2027,8 +1861,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;
@@ -2052,7 +1884,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION 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;
@@ -2063,7 +1895,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];
 
@@ -2094,7 +1925,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                }
                                        }
 
-                                       /* Describe the monster */
                                        monster_desc(m_name, m_ptr, 0);
 
                                        /* Scream in pain */
@@ -2119,14 +1949,13 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION 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 +1977,8 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION 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);
                                        }
                                }
@@ -2177,7 +2001,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 cave grid */
                        c_ptr = &cave[yy][xx];
 
                        /* Paranoia -- never affect player */
@@ -2186,7 +2009,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Destroy location (if valid) */
                        if (cave_valid_bold(yy, xx))
                        {
-                               /* Delete objects */
                                delete_object(yy, xx);
 
                                /* Wall (or floor) type */
@@ -2223,7 +2045,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                }
        }
 
-
        /* Process "re-glowing" */
        for (dy = -r; dy <= r; dy++)
        {
@@ -2238,14 +2059,13 @@ 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;
                        else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
                        {
-                               int ii, yyy, xxx;
+                               DIRECTION ii;
+                               POSITION yyy, xxx;
                                cave_type *cc_ptr;
 
                                for (ii = 0; ii < 9; ii++)
@@ -2264,20 +2084,10 @@ 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->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
+       p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH | PR_MAP);
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
@@ -2334,23 +2144,22 @@ 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);
                        continue;
                }
                dam = m_ptr->maxhp / 2;
-               if (dam > 100) dam = (dam-100)/2 + 100;
-               if (dam > 400) dam = (dam-400)/2 + 400;
+               if (dam > 100) dam = (dam - 100) / 2 + 100;
+               if (dam > 400) dam = (dam - 400) / 2 + 400;
                if (dam > 800) dam = 800;
-               project(i, 2+(r_ptr->level/20), m_ptr->fy,
-                       m_ptr->fx, dam, GF_PLASMA, 
+               project(i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA, 
                        PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
 
                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);
@@ -2402,13 +2211,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 +2230,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 +2240,6 @@ static void cave_temp_room_lite(void)
                /* Note */
                note_spot(y, x);
 
-               /* Redraw */
                lite_spot(y, x);
 
                update_local_illumination(y, x);
@@ -2513,18 +2313,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);
@@ -2546,9 +2343,7 @@ static void cave_temp_room_unlite(void)
 static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
 {
        int i;
-
        POSITION y, x;
-
        int len = 0;
        int blen = 0;
 
@@ -2786,6 +2581,34 @@ void unlite_room(POSITION y1, POSITION x1)
        cave_temp_room_unlite();
 }
 
+bool starlight(bool magic)
+{
+       HIT_POINT num = damroll(5, 3);
+       POSITION y = 0, x = 0;
+       int k;
+       int attempts;
+
+       if (!p_ptr->blind && !magic)
+       {
+               msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
+       }
+       for (k = 0; k < num; k++)
+       {
+               attempts = 1000;
+
+               while (attempts--)
+               {
+                       scatter(&y, &x, p_ptr->y, p_ptr->x, 4, PROJECT_LOS);
+                       if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
+                       if (!player_bold(y, x)) break;
+               }
+
+               project(0, 0, p_ptr->y, p_ptr->x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+                       (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
+       }
+       return TRUE;
+}
+
 
 
 /*!
@@ -2922,8 +2745,7 @@ bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION 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 */
@@ -2958,8 +2780,7 @@ bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION 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 +2837,11 @@ bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POI
  * @param dev 回数分散
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
+bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID 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;
@@ -3141,7 +2963,7 @@ bool teleport_swap(DIRECTION dir)
 
 
 /*!
- * @brief 指定方向に飛び道具を飛ばす(フラグ任意指定) / Hack -- apply a "projection()" in a direction (or at the target)
+ * @brief 指定方向に飛び道具を飛ばす(フラグ任意指定) / Hack -- apply a "project()" in a direction (or at the target)
  * @param typ 効果属性
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @param dam 威力
@@ -3150,7 +2972,7 @@ bool teleport_swap(DIRECTION dir)
  */
 bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
 {
-       int tx, ty;
+       POSITION tx, ty;
 
        /* Pass through the target if needed */
        flg |= (PROJECT_THRU);
@@ -3304,137 +3126,6 @@ bool disarm_trap(DIRECTION dir)
        return (project_hook(GF_KILL_TRAP, dir, 0, flg));
 }
 
-/*!
- * @brief モンスター回復処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param dam 威力
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief モンスター加速処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief モンスター減速処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief モンスター催眠処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief モンスター拘束(STASIS)処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- * @details 威力はプレイヤーレベル*2に固定
- */
-bool stasis_monster(DIRECTION dir)
-{
-       return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
-}
-
-/*!
- * @brief 邪悪なモンスター拘束(STASIS)処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- * @details 威力はプレイヤーレベル*2に固定
- */
-bool stasis_evil(DIRECTION dir)
-{
-       return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
-}
-
-/*!
- * @brief モンスター混乱処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief モンスター朦朧処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
-
-/*!
- * @brief チェンジモンスター処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-       if (tester)
-               chg_virtue(V_CHANCE, 1);
-       return(tester);
-}
-
-/*!
- * @brief クローンモンスター処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool clone_monster(DIRECTION dir)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_CLONE, dir, 0, flg));
-}
-
-/*!
- * @brief モンスター恐慌処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-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));
-}
 
 /*!
  * @brief 死の光線処理
@@ -3512,10 +3203,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 +3243,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を返す
@@ -3678,7 +3367,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 +3407,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 +3461,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 +3538,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 +3599,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 +3610,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 +3621,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 +3632,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 +3643,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 +3654,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 +3665,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 +3676,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 +3687,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 +3697,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));
 }
 
 /*!
@@ -4087,23 +3776,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);
@@ -4190,9 +3870,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 +3878,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 +3886,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);
@@ -4404,7 +4081,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:
@@ -4685,7 +4362,7 @@ void cast_invoke_spirits(DIRECTION 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)
@@ -4845,7 +4522,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)
        {
@@ -4973,9 +4650,9 @@ void cast_shuffle(void)
        }
 }
 
-bool_hack life_stream(bool_hack message, bool_hack virtue)
+bool_hack life_stream(bool_hack message, bool_hack virtue_change)
 {
-       if(virtue)
+       if(virtue_change)
        {
                chg_virtue(V_VITALITY, 1);
                chg_virtue(V_UNLIFE, -5);
@@ -4993,7 +4670,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue)
        (void)set_cut(0);
        (void)restore_all_status();
        (void)set_shero(0, TRUE);
-       update_stuff();
+       handle_stuff();
        hp_player(5000);
 
        return TRUE;
@@ -5137,7 +4814,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];
@@ -5180,7 +4857,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)
@@ -5217,29 +4894,16 @@ bool psychometry(void)
 {
        OBJECT_IDX      item;
        object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        byte            feel;
-       cptr            q, s;
+       concptr            q, s;
        bool okay = FALSE;
 
-       item_tester_no_ryoute = TRUE;
-       /* Get an item */
        q = _("どのアイテムを調べますか?", "Meditate on which item? ");
        s = _("調べるアイテムがありません。", "You have nothing appropriate.");
 
-       if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) 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];
-       }
+       o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+       if (!o_ptr) return (FALSE);
 
        /* It is fully known, no information needed */
        if (object_is_known(o_ptr))
@@ -5262,12 +4926,10 @@ bool psychometry(void)
        }
 
 #ifdef JP
-       msg_format("%sは%sという感じがする...",
-               o_name, game_inscriptions[feel]);
+       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]);
+               o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
 #endif
 
 
@@ -5281,9 +4943,8 @@ bool psychometry(void)
        o_ptr->marked |= OM_TOUCHED;
 
        /* Combine / Reorder the pack (later) */
-       p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+       p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Valid "tval" codes */
@@ -5321,3 +4982,319 @@ bool psychometry(void)
        /* Something happened */
        return (TRUE);
 }
+
+
+bool draconian_breath(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
+       concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
+
+       if (!get_aim_dir(&dir)) return FALSE;
+
+       if (randint1(100) < creature_ptr->lev)
+       {
+               switch (creature_ptr->pclass)
+               {
+               case CLASS_WARRIOR:
+               case CLASS_BERSERKER:
+               case CLASS_RANGER:
+               case CLASS_TOURIST:
+               case CLASS_IMITATOR:
+               case CLASS_ARCHER:
+               case CLASS_SMITH:
+                       if (one_in_(3))
+                       {
+                               Type = GF_MISSILE;
+                               Type_desc = _("エレメント", "the elements");
+                       }
+                       else
+                       {
+                               Type = GF_SHARDS;
+                               Type_desc = _("破片", "shards");
+                       }
+                       break;
+               case CLASS_MAGE:
+               case CLASS_WARRIOR_MAGE:
+               case CLASS_HIGH_MAGE:
+               case CLASS_SORCERER:
+               case CLASS_MAGIC_EATER:
+               case CLASS_RED_MAGE:
+               case CLASS_BLUE_MAGE:
+               case CLASS_MIRROR_MASTER:
+                       if (one_in_(3))
+                       {
+                               Type = GF_MANA;
+                               Type_desc = _("魔力", "mana");
+                       }
+                       else
+                       {
+                               Type = GF_DISENCHANT;
+                               Type_desc = _("劣化", "disenchantment");
+                       }
+                       break;
+               case CLASS_CHAOS_WARRIOR:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_CHAOS;
+                               Type_desc = _("カオス", "chaos");
+                       }
+                       break;
+               case CLASS_MONK:
+               case CLASS_SAMURAI:
+               case CLASS_FORCETRAINER:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_SOUND;
+                               Type_desc = _("轟音", "sound");
+                       }
+                       break;
+               case CLASS_MINDCRAFTER:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_PSI;
+                               Type_desc = _("精神エネルギー", "mental energy");
+                       }
+                       break;
+               case CLASS_PRIEST:
+               case CLASS_PALADIN:
+                       if (one_in_(3))
+                       {
+                               Type = GF_HELL_FIRE;
+                               Type_desc = _("地獄の劫火", "hellfire");
+                       }
+                       else
+                       {
+                               Type = GF_HOLY_FIRE;
+                               Type_desc = _("聖なる炎", "holy fire");
+                       }
+                       break;
+               case CLASS_ROGUE:
+               case CLASS_NINJA:
+                       if (one_in_(3))
+                       {
+                               Type = GF_DARK;
+                               Type_desc = _("暗黒", "darkness");
+                       }
+                       else
+                       {
+                               Type = GF_POIS;
+                               Type_desc = _("毒", "poison");
+                       }
+                       break;
+               case CLASS_BARD:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_SOUND;
+                               Type_desc = _("轟音", "sound");
+                       }
+                       else
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       break;
+               }
+       }
+
+       stop_mouth();
+       msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
+
+       fire_breath(Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
+       return TRUE;
+}
+
+bool android_inside_weapon(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       if (!get_aim_dir(&dir)) return FALSE;
+       if (creature_ptr->lev < 10)
+       {
+               msg_print(_("レイガンを発射した。", "You fire your ray gun."));
+               fire_bolt(GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
+       }
+       else if (creature_ptr->lev < 25)
+       {
+               msg_print(_("ブラスターを発射した。", "You fire your blaster."));
+               fire_bolt(GF_MISSILE, dir, creature_ptr->lev);
+       }
+       else if (creature_ptr->lev < 35)
+       {
+               msg_print(_("バズーカを発射した。", "You fire your bazooka."));
+               fire_ball(GF_MISSILE, dir, creature_ptr->lev * 2, 2);
+       }
+       else if (creature_ptr->lev < 45)
+       {
+               msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
+               fire_beam(GF_MISSILE, dir, creature_ptr->lev * 2);
+       }
+       else
+       {
+               msg_print(_("ロケットを発射した。", "You fire a rocket."));
+               fire_rocket(GF_ROCKET, dir, creature_ptr->lev * 5, 2);
+       }
+       return TRUE;
+}
+
+bool create_ration(player_type *crature_ptr)
+{
+       object_type *q_ptr;
+       object_type forge;
+       q_ptr = &forge;
+
+       /* Create the food ration */
+       object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
+
+       /* Drop the object from heaven */
+       (void)drop_near(q_ptr, -1, crature_ptr->y, crature_ptr->x);
+       msg_print(_("食事を料理して作った。", "You cook some food."));
+       return TRUE;
+}
+
+void hayagake(player_type *creature_ptr)
+{
+       if (creature_ptr->action == ACTION_HAYAGAKE)
+       {
+               set_action(ACTION_NONE);
+       }
+       else
+       {
+               cave_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
+               feature_type *f_ptr = &f_info[c_ptr->feat];
+
+               if (!have_flag(f_ptr->flags, FF_PROJECT) ||
+                       (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
+               {
+                       msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
+               }
+               else
+               {
+                       set_action(ACTION_HAYAGAKE);
+               }
+       }
+       creature_ptr->energy_use = 0;
+}
+
+bool double_attack(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       POSITION x, y;
+
+       if (!get_rep_dir(&dir, FALSE)) return FALSE;
+       y = creature_ptr->y + ddy[dir];
+       x = creature_ptr->x + ddx[dir];
+       if (cave[y][x].m_idx)
+       {
+               if (one_in_(3))
+                       msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
+                               "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
+               else if(one_in_(2))
+                       msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
+                               "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
+               else
+                       msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
+                               "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
+
+               py_attack(y, x, 0);
+               if (cave[y][x].m_idx)
+               {
+                       handle_stuff();
+                       py_attack(y, x, 0);
+               }
+               creature_ptr->energy_need += ENERGY_NEED();
+       }
+       else
+       {
+               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+               msg_print(NULL);
+       }
+       return TRUE;
+}
+
+bool comvert_hp_to_mp(player_type *creature_ptr)
+{
+       int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
+       if (gain_sp)
+       {
+               creature_ptr->csp += gain_sp;
+               if (creature_ptr->csp > creature_ptr->msp)
+               {
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
+               }
+       }
+       else
+       {
+               msg_print(_("変換に失敗した。", "You failed to convert."));
+       }
+       creature_ptr->redraw |= (PR_HP | PR_MANA);
+       return TRUE;
+}
+
+bool comvert_mp_to_hp(player_type *creature_ptr)
+{
+       if (creature_ptr->csp >= creature_ptr->lev / 5)
+       {
+               creature_ptr->csp -= creature_ptr->lev / 5;
+               hp_player(creature_ptr->lev);
+       }
+       else
+       {
+               msg_print(_("変換に失敗した。", "You failed to convert."));
+       }
+       /* Redraw mana and hp */
+       creature_ptr->redraw |= (PR_HP | PR_MANA);
+       return TRUE;
+}
+
+bool demonic_breath(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
+       if (!get_aim_dir(&dir)) return FALSE;
+       stop_mouth();
+       msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
+       fire_breath(type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
+       return TRUE;
+}
+
+bool mirror_concentration(player_type *creature_ptr)
+{
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       if (is_mirror_grid(&cave[creature_ptr->y][creature_ptr->x]))
+       {
+               msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+               creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100);
+               if (creature_ptr->csp >= creature_ptr->msp)
+               {
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
+               }
+               creature_ptr->redraw |= (PR_MANA);
+       }
+       else
+       {
+               msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
+       }
+       return TRUE;
+}
\ No newline at end of file