OSDN Git Service

[Refactor] #38997 gain_random_mutation() を gain_mutation() に改名しつつ引数追加。 / Rename gain_...
[hengband/hengband.git] / src / spells2.c
index 671cc6c..90eccf0 100644 (file)
  */
 
 #include "angband.h"
+#include "cmd-pet.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"
+#include "spells-floor.h"
+#include "realm-hex.h"
+#include "object-hook.h"
 
 /*!
  * @brief プレイヤー周辺の地形を感知する
@@ -30,18 +40,18 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
 {
        POSITION x, y;
        bool detect = FALSE;
-       cave_type *c_ptr;
+       grid_type *g_ptr;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        /* Scan the current panel */
-       for (y = 1; y < cur_hgt - 1; y++)
+       for (y = 1; y < current_floor_ptr->height - 1; y++)
        {
-               for (x = 1; x <= cur_wid - 1; x++)
+               for (x = 1; x <= current_floor_ptr->width - 1; x++)
                {
                        int dist = distance(p_ptr->y, p_ptr->x, y, x);
                        if (dist > range) continue;
-                       c_ptr = &cave[y][x];
+                       g_ptr = &current_floor_ptr->grid_array[y][x];
 
                        /* Hack -- Safe */
                        if (flag == FF_TRAP)
@@ -49,22 +59,22 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
                                /* Mark as detected */
                                if (dist <= range && known)
                                {
-                                       if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT);
+                                       if (dist <= range - 1) g_ptr->info |= (CAVE_IN_DETECT);
 
-                                       c_ptr->info &= ~(CAVE_UNSAFE);
+                                       g_ptr->info &= ~(CAVE_UNSAFE);
 
                                        lite_spot(y, x);
                                }
                        }
 
                        /* Detect flags */
-                       if (cave_have_flag_grid(c_ptr, flag))
+                       if (cave_have_flag_grid(g_ptr, flag))
                        {
                                /* Detect secrets */
                                disclose_grid(y, x);
 
                                /* Hack -- Memorize */
-                               c_ptr->info |= (CAVE_MARK);
+                               g_ptr->info |= (CAVE_MARK);
 
                                lite_spot(y, x);
 
@@ -164,12 +174,12 @@ bool detect_objects_gold(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
 
        /* Scan objects */
        for (i = 1; i < o_max; i++)
        {
-               object_type *o_ptr = &o_list[i];
+               object_type *o_ptr = &current_floor_ptr->o_list[i];
 
                /* Skip dead objects */
                if (!o_ptr->k_idx) continue;
@@ -219,12 +229,12 @@ bool detect_objects_normal(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
 
        /* Scan objects */
        for (i = 1; i < o_max; i++)
        {
-               object_type *o_ptr = &o_list[i];
+               object_type *o_ptr = &current_floor_ptr->o_list[i];
 
                /* Skip dead objects */
                if (!o_ptr->k_idx) continue;
@@ -282,12 +292,12 @@ bool detect_objects_magic(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        /* Scan all objects */
        for (i = 1; i < o_max; i++)
        {
-               object_type *o_ptr = &o_list[i];
+               object_type *o_ptr = &current_floor_ptr->o_list[i];
 
                /* Skip dead objects */
                if (!o_ptr->k_idx) continue;
@@ -357,11 +367,11 @@ bool detect_monsters_normal(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -405,11 +415,11 @@ bool detect_monsters_invis(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -458,11 +468,11 @@ bool detect_monsters_evil(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -515,11 +525,11 @@ bool detect_monsters_nonliving(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -565,11 +575,11 @@ bool detect_monsters_mind(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -612,17 +622,17 @@ 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;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -671,13 +681,13 @@ 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;
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
@@ -780,7 +790,7 @@ bool project_all_los(EFFECT_ID typ, HIT_POINT dam)
        /* Mark all (nearby) monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -798,7 +808,7 @@ bool project_all_los(EFFECT_ID typ, HIT_POINT dam)
        /* Affect all marked monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Skip unmarked monsters */
                if (!(m_ptr->mflag & (MFLAG_TEMP))) continue;
@@ -903,6 +913,32 @@ bool dispel_monsters(HIT_POINT 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), creature_ptr->y, creature_ptr->x,
+       (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
+       if ((creature_ptr->pclass != CLASS_MAGE) && (creature_ptr->pclass != CLASS_HIGH_MAGE) && (creature_ptr->pclass != CLASS_SORCERER) && (creature_ptr->pclass != CLASS_MAGIC_EATER) && (creature_ptr->pclass != CLASS_BLUE_MAGE))
+       {
+               (void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
+       }
+       return TRUE;
+}
+
 /*!
  * @brief 視界内の生命のあるモンスターにダメージを与える処理 / Dispel 'living' monsters
  * @return 効力があった場合TRUEを返す
@@ -938,13 +974,13 @@ bool crusade(void)
 void aggravate_monsters(MONSTER_IDX who)
 {
        MONSTER_IDX i;
-       bool    sleep = FALSE;
-       bool    speed = FALSE;
+       bool sleep = FALSE;
+       bool speed = FALSE;
 
        /* Aggravate everyone nearby */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -990,10 +1026,10 @@ 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];
+       monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
        bool         resist = FALSE;
 
@@ -1003,11 +1039,10 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
        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 ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->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;
 
-
        else
        {
                if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
@@ -1083,8 +1118,9 @@ bool symbol_genocide(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
+               msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
                return (FALSE);
        }
 
@@ -1094,7 +1130,7 @@ bool symbol_genocide(int power, bool player_cast)
        /* Delete the monsters of that "type" */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Paranoia -- Skip dead monsters */
@@ -1128,7 +1164,7 @@ bool mass_genocide(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent mass genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
                return (FALSE);
        }
@@ -1136,7 +1172,7 @@ bool mass_genocide(int power, bool player_cast)
        /* Delete the (nearby) monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -1170,7 +1206,7 @@ bool mass_genocide_undead(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent mass genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
        {
                return (FALSE);
        }
@@ -1178,7 +1214,7 @@ bool mass_genocide_undead(int power, bool player_cast)
        /* Delete the (nearby) monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Paranoia -- Skip dead monsters */
@@ -1214,7 +1250,7 @@ bool probing(void)
        bool_hack cu, cv;
        bool probe = FALSE;
        char buf[256];
-       cptr align;
+       concptr align;
 
        cu = Term->scr->cu;
        cv = Term->scr->cv;
@@ -1224,7 +1260,7 @@ bool probing(void)
        /* Probe all (nearby) monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Paranoia -- Skip dead monsters */
@@ -1271,7 +1307,6 @@ bool probing(void)
                        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);
 
@@ -1361,11 +1396,11 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 {
        POSITION y, x;
        int k, t;
-       cave_type *c_ptr;
+       grid_type *g_ptr;
        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)
+       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
        {
                return (FALSE);
        }
@@ -1386,18 +1421,18 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                        /* Stay in the circle of death */
                        if (k > r) continue;
-                       c_ptr = &cave[y][x];
+                       g_ptr = &current_floor_ptr->grid_array[y][x];
 
                        /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
+                       g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
 
                        /* Lose light and knowledge */
-                       c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
+                       g_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
 
                        if (!in_generate) /* Normal */
                        {
                                /* Lose unsafety */
-                               c_ptr->info &= ~(CAVE_UNSAFE);
+                               g_ptr->info &= ~(CAVE_UNSAFE);
 
                                /* Hack -- Notice player affect */
                                if (player_bold(y, x))
@@ -1413,9 +1448,9 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                        /* Hack -- Skip the epicenter */
                        if ((y == y1) && (x == x1)) continue;
 
-                       if (c_ptr->m_idx)
+                       if (g_ptr->m_idx)
                        {
-                               monster_type *m_ptr = &m_list[c_ptr->m_idx];
+                               monster_type *m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                                if (in_generate) /* In generation */
@@ -1429,7 +1464,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                        m_ptr->hp = m_ptr->maxhp;
 
                                        /* Try to teleport away quest monsters */
-                                       if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
+                                       if (!teleport_away(g_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
                                }
                                else
                                {
@@ -1452,10 +1487,10 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                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)
+                               for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                                {
                                        object_type *o_ptr;
-                                       o_ptr = &o_list[this_o_idx];
+                                       o_ptr = &current_floor_ptr->o_list[this_o_idx];
 
                                        /* Acquire next object */
                                        next_o_idx = o_ptr->next_o_idx;
@@ -1481,11 +1516,10 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                }
                        }
 
-                       /* Delete objects */
                        delete_object(y, x);
 
                        /* Destroy "non-permanent" grids */
-                       if (!cave_perma_grid(c_ptr))
+                       if (!cave_perma_grid(g_ptr))
                        {
                                /* Wall (or floor) type */
                                t = randint0(200);
@@ -1510,7 +1544,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                        else
                                        {
                                                /* Create floor */
-                                               cave_set_feat(y, x, floor_type[randint0(100)]);
+                                               cave_set_feat(y, x, feat_ground_type[randint0(100)]);
                                        }
                                }
                                else /* In generation */
@@ -1518,26 +1552,26 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                        if (t < 20)
                                        {
                                                /* Create granite wall */
-                                               place_extra_grid(c_ptr);
+                                               place_extra_grid(g_ptr);
                                        }
                                        else if (t < 70)
                                        {
                                                /* Create quartz vein */
-                                               c_ptr->feat = feat_quartz_vein;
+                                               g_ptr->feat = feat_quartz_vein;
                                        }
                                        else if (t < 100)
                                        {
                                                /* Create magma vein */
-                                               c_ptr->feat = feat_magma_vein;
+                                               g_ptr->feat = feat_magma_vein;
                                        }
                                        else
                                        {
                                                /* Create floor */
-                                               place_floor_grid(c_ptr);
+                                               place_floor_grid(g_ptr);
                                        }
 
                                        /* Clear garbage of hidden trap or door */
-                                       c_ptr->mimic = 0;
+                                       g_ptr->mimic = 0;
                                }
                        }
                }
@@ -1558,23 +1592,24 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                                /* Stay in the circle of death */
                                if (k > r) continue;
-                               c_ptr = &cave[y][x];
+                               g_ptr = &current_floor_ptr->grid_array[y][x];
 
-                               if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
-                               else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                               if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
+                               else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
                                {
-                                       int i, yy, xx;
-                                       cave_type *cc_ptr;
+                                       DIRECTION i;
+                                       POSITION yy, xx;
+                                       grid_type *cc_ptr;
 
                                        for (i = 0; i < 9; i++)
                                        {
                                                yy = y + ddy_ddd[i];
                                                xx = x + ddx_ddd[i];
                                                if (!in_bounds2(yy, xx)) continue;
-                                               cc_ptr = &cave[yy][xx];
+                                               cc_ptr = &current_floor_ptr->grid_array[yy][xx];
                                                if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                                {
-                                                       c_ptr->info |= CAVE_GLOW;
+                                                       g_ptr->info |= CAVE_GLOW;
                                                        break;
                                                }
                                        }
@@ -1598,17 +1633,13 @@ 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);
-
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
-
+               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);
-
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                if (p_ptr->special_defense & NINJA_S_STEALTH)
                {
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+                       if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
                }
        }
 
@@ -1628,7 +1659,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
  * @details
  * <pre>
  *
- * This will turn some walls into floors and some floors into walls.
+ * This will current_world_ptr->game_turn some walls into floors and some floors into walls.
  *
  * The player will take damage and "jump" into a safe grid if possible,
  * otherwise, he will "tunnel" through the rubble instantaneously.
@@ -1640,7 +1671,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
  * Note that thus the player and monsters (except eaters of walls and
  * passers through walls) will never occupy the same grid as a wall.
  * Note that as of now (2.7.8) no monster may occupy a "wall" grid, even
- * for a single turn, unless that monster can pass_walls or kill_walls.
+ * for a single current_world_ptr->game_turn, unless that monster can pass_walls or kill_walls.
  * This has allowed massive simplification of the "monster" code.
  * </pre>
  */
@@ -1649,16 +1680,15 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        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;
+       grid_type *g_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)
+       if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
        {
                return (FALSE);
        }
@@ -1689,13 +1719,11 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       c_ptr = &cave[yy][xx];
+                       g_ptr = &current_floor_ptr->grid_array[yy][xx];
 
-                       /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
-
-                       /* Lose light and knowledge */
-                       c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
+                       /* Lose room and vault / Lose light and knowledge */
+                       g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
+                       g_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
 
                        /* Skip the epicenter */
                        if (!dx && !dy) continue;
@@ -1727,7 +1755,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        /* Important -- Skip "quake" grids */
                        if (map[16+y-cy][16+x-cx]) continue;
 
-                       if (cave[y][x].m_idx) continue;
+                       if (current_floor_ptr->grid_array[y][x].m_idx) continue;
 
                        /* Count "safe" grids */
                        sn++;
@@ -1744,17 +1772,17 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                {
                        case 1:
                        {
-                               msg_print(_("ダンジョンの壁が崩れた!", "The cave ceiling collapses!"));
+                               msg_print(_("ダンジョンの壁が崩れた!", "The current_floor_ptr->grid_array ceiling collapses!"));
                                break;
                        }
                        case 2:
                        {
-                               msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The cave floor twists in an unnatural way!"));
+                               msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The current_floor_ptr->grid_array floor twists in an unnatural way!"));
                                break;
                        }
                        default:
                        {
-                               msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The cave quakes!  You are pummeled with debris!"));
+                               msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The current_floor_ptr->grid_array quakes!  You are pummeled with debris!"));
                                break;
                        }
                }
@@ -1804,12 +1832,12 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                if (damage)
                {
-                       cptr killer;
+                       concptr killer;
 
                        if (m_idx)
                        {
                                GAME_TEXT m_name[MAX_NLEN];
-                               monster_type *m_ptr = &m_list[m_idx];
+                               monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
 
                                /* Get the monster's real name */
                                monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
@@ -1836,14 +1864,14 @@ 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;
-                       c_ptr = &cave[yy][xx];
+                       g_ptr = &current_floor_ptr->grid_array[yy][xx];
 
-                       if (c_ptr->m_idx == p_ptr->riding) continue;
+                       if (g_ptr->m_idx == p_ptr->riding) continue;
 
                        /* Process monsters */
-                       if (c_ptr->m_idx)
+                       if (g_ptr->m_idx)
                        {
-                               monster_type *m_ptr = &m_list[c_ptr->m_idx];
+                               monster_type *m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                                /* Quest monsters */
@@ -1877,8 +1905,8 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        if (!cave_empty_bold(y, x)) continue;
 
                                                        /* Hack -- no safety on glyph of warding */
-                                                       if (is_glyph_grid(&cave[y][x])) continue;
-                                                       if (is_explosive_rune_grid(&cave[y][x])) continue;
+                                                       if (is_glyph_grid(&current_floor_ptr->grid_array[y][x])) continue;
+                                                       if (is_explosive_rune_grid(&current_floor_ptr->grid_array[y][x])) continue;
 
                                                        /* ... nor on the Pattern */
                                                        if (pattern_tile(y, x)) continue;
@@ -1886,7 +1914,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                        /* Important -- Skip "quake" grids */
                                                        if (map[16+y-cy][16+x-cx]) continue;
 
-                                                       if (cave[y][x].m_idx) continue;
+                                                       if (current_floor_ptr->grid_array[y][x].m_idx) continue;
                                                        if (player_bold(y, x)) continue;
 
                                                        /* Count "safe" grids */
@@ -1900,7 +1928,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 */
@@ -1910,7 +1937,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                        damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1));
 
                                        /* Monster is certainly awake */
-                                       (void)set_monster_csleep(c_ptr->m_idx, 0);
+                                       (void)set_monster_csleep(g_ptr->m_idx, 0);
 
                                        /* Apply damage directly */
                                        m_ptr->hp -= damage;
@@ -1921,9 +1948,9 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                if (!ignore_unview || is_seen(m_ptr)) 
                                                        msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
 
-                                               if (c_ptr->m_idx)
+                                               if (g_ptr->m_idx)
                                                {
-                                                       if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname)
+                                                       if (record_named_pet && is_pet(&current_floor_ptr->m_list[g_ptr->m_idx]) && current_floor_ptr->m_list[g_ptr->m_idx].nickname)
                                                        {
                                                                char m2_name[MAX_NLEN];
 
@@ -1941,13 +1968,13 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                        /* Hack -- Escape from the rock */
                                        if (sn)
                                        {
-                                               IDX m_idx_aux = cave[yy][xx].m_idx;
+                                               IDX m_idx_aux = current_floor_ptr->grid_array[yy][xx].m_idx;
 
                                                /* Update the old location */
-                                               cave[yy][xx].m_idx = 0;
+                                               current_floor_ptr->grid_array[yy][xx].m_idx = 0;
 
                                                /* Update the new location */
-                                               cave[sy][sx].m_idx = m_idx_aux;
+                                               current_floor_ptr->grid_array[sy][sx].m_idx = m_idx_aux;
 
                                                /* Move the monster */
                                                m_ptr->fy = sy;
@@ -1977,8 +2004,7 @@ 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];
+                       g_ptr = &current_floor_ptr->grid_array[yy][xx];
 
                        /* Paranoia -- never affect player */
 /*                     if (player_bold(yy, xx)) continue; */
@@ -1986,7 +2012,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 */
@@ -2017,13 +2042,12 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                else
                                {
                                        /* Create floor */
-                                       cave_set_feat(yy, xx, floor_type[randint0(100)]);
+                                       cave_set_feat(yy, xx, feat_ground_type[randint0(100)]);
                                }
                        }
                }
        }
 
-
        /* Process "re-glowing" */
        for (dy = -r; dy <= r; dy++)
        {
@@ -2038,23 +2062,24 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
-                       c_ptr = &cave[yy][xx];
+                       g_ptr = &current_floor_ptr->grid_array[yy][xx];
 
-                       if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
-                       else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                       if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
+                       else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
                        {
-                               int ii, yyy, xxx;
-                               cave_type *cc_ptr;
+                               DIRECTION ii;
+                               POSITION yyy, xxx;
+                               grid_type *cc_ptr;
 
                                for (ii = 0; ii < 9; ii++)
                                {
                                        yyy = yy + ddy_ddd[ii];
                                        xxx = xx + ddx_ddd[ii];
                                        if (!in_bounds2(yyy, xxx)) continue;
-                                       cc_ptr = &cave[yyy][xxx];
+                                       cc_ptr = &current_floor_ptr->grid_array[yyy][xxx];
                                        if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                        {
-                                               c_ptr->info |= CAVE_GLOW;
+                                               g_ptr->info |= CAVE_GLOW;
                                                break;
                                        }
                                }
@@ -2062,22 +2087,14 @@ 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);
-
-       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);
-
-       p_ptr->redraw |= (PR_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_HEALTH | PR_UHEALTH | PR_MAP);
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 
        /* Success */
@@ -2108,7 +2125,7 @@ void discharge_minion(void)
 
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
                if (m_ptr->nickname) okay = FALSE;
        }
@@ -2120,7 +2137,7 @@ void discharge_minion(void)
        for (i = 1; i < m_max; i++)
        {
                HIT_POINT dam;
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
                monster_race *r_ptr;
 
                if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
@@ -2136,11 +2153,10 @@ void discharge_minion(void)
                        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)
@@ -2182,24 +2198,24 @@ static void cave_temp_room_lite(void)
                POSITION y = temp_y[i];
                POSITION x = temp_x[i];
 
-               cave_type *c_ptr = &cave[y][x];
+               grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
 
                /* No longer in the array */
-               c_ptr->info &= ~(CAVE_TEMP);
+               g_ptr->info &= ~(CAVE_TEMP);
 
                /* Update only non-CAVE_GLOW grids */
-               /* if (c_ptr->info & (CAVE_GLOW)) continue; */
+               /* if (g_ptr->info & (CAVE_GLOW)) continue; */
 
                /* Perma-Lite */
-               c_ptr->info |= (CAVE_GLOW);
+               g_ptr->info |= (CAVE_GLOW);
 
                /* Process affected monsters */
-               if (c_ptr->m_idx)
+               if (g_ptr->m_idx)
                {
                        int chance = 25;
-                       monster_type    *m_ptr = &m_list[c_ptr->m_idx];
+                       monster_type    *m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-                       update_monster(c_ptr->m_idx, FALSE);
+                       update_monster(g_ptr->m_idx, FALSE);
 
                        /* Stupid monsters rarely wake up */
                        if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
@@ -2211,7 +2227,7 @@ static void cave_temp_room_lite(void)
                        if (MON_CSLEEP(m_ptr) && (randint0(100) < chance))
                        {
                                /* Wake up! */
-                               (void)set_monster_csleep(c_ptr->m_idx, 0);
+                               (void)set_monster_csleep(g_ptr->m_idx, 0);
 
                                /* Notice the "waking up" */
                                if (m_ptr->ml)
@@ -2223,11 +2239,8 @@ static void cave_temp_room_lite(void)
                        }
                }
 
-               /* Note */
                note_spot(y, x);
-
                lite_spot(y, x);
-
                update_local_illumination(y, x);
        }
 
@@ -2260,25 +2273,25 @@ static void cave_temp_room_unlite(void)
                POSITION x = temp_x[i];
                int j;
 
-               cave_type *c_ptr = &cave[y][x];
-               bool do_dark = !is_mirror_grid(c_ptr);
+               grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
+               bool do_dark = !is_mirror_grid(g_ptr);
 
                /* No longer in the array */
-               c_ptr->info &= ~(CAVE_TEMP);
+               g_ptr->info &= ~(CAVE_TEMP);
 
                /* Darken the grid */
                if (do_dark)
                {
-                       if (dun_level || !is_daytime())
+                       if (current_floor_ptr->dun_level || !is_daytime())
                        {
                                for (j = 0; j < 9; j++)
                                {
-                                       int by = y + ddy_ddd[j];
-                                       int bx = x + ddx_ddd[j];
+                                       POSITION by = y + ddy_ddd[j];
+                                       POSITION bx = x + ddx_ddd[j];
 
                                        if (in_bounds2(by, bx))
                                        {
-                                               cave_type *cc_ptr = &cave[by][bx];
+                                               grid_type *cc_ptr = &current_floor_ptr->grid_array[by][bx];
 
                                                if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
                                                {
@@ -2291,25 +2304,23 @@ static void cave_temp_room_unlite(void)
                                if (!do_dark) continue;
                        }
 
-                       c_ptr->info &= ~(CAVE_GLOW);
+                       g_ptr->info &= ~(CAVE_GLOW);
 
                        /* Hack -- Forget "boring" grids */
-                       if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER))
+                       if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_REMEMBER))
                        {
                                /* Forget the grid */
-                               if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
-
+                               if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
                                note_spot(y, x);
                        }
 
                        /* Process affected monsters */
-                       if (c_ptr->m_idx)
+                       if (g_ptr->m_idx)
                        {
-                               update_monster(c_ptr->m_idx, FALSE);
+                               update_monster(g_ptr->m_idx, FALSE);
                        }
 
                        lite_spot(y, x);
-
                        update_local_illumination(y, x);
                }
        }
@@ -2393,16 +2404,14 @@ static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITIO
  */
 static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
 {
-       cave_type *c_ptr;
-
-       /* Get the grid */
-       c_ptr = &cave[y][x];
+       grid_type *g_ptr;
+       g_ptr = &current_floor_ptr->grid_array[y][x];
 
        /* Avoid infinite recursion */
-       if (c_ptr->info & (CAVE_TEMP)) return;
+       if (g_ptr->info & (CAVE_TEMP)) return;
 
        /* Do not "leave" the current room */
-       if (!(c_ptr->info & (CAVE_ROOM)))
+       if (!(g_ptr->info & (CAVE_ROOM)))
        {
                if (only_room) return;
 
@@ -2429,7 +2438,7 @@ static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pa
        if (temp_n == TEMP_MAX) return;
 
        /* Mark the grid as "seen" */
-       c_ptr->info |= (CAVE_TEMP);
+       g_ptr->info |= (CAVE_TEMP);
 
        /* Add it to the "seen" set */
        temp_y[temp_n] = y;
@@ -2523,7 +2532,7 @@ void lite_room(POSITION y1, POSITION x1)
 
        if (p_ptr->special_defense & NINJA_S_STEALTH)
        {
-               if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
+               if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
        }
 }
 
@@ -2567,6 +2576,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, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+                       (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
+       }
+       return TRUE;
+}
+
 
 
 /*!
@@ -2579,13 +2616,12 @@ bool lite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
        {
                msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
                return FALSE;
        }
 
-       /* Hack -- Message */
        if (!p_ptr->blind)
        {
                msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
@@ -2594,7 +2630,6 @@ bool lite_area(HIT_POINT dam, POSITION rad)
        /* Hook into the "project()" function */
        (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
 
-       /* Lite up the room */
        lite_room(p_ptr->y, p_ptr->x);
 
        /* Assume seen */
@@ -2621,7 +2656,6 @@ bool unlite_area(HIT_POINT dam, POSITION rad)
        /* Hook into the "project()" function */
        (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
 
-       /* Lite up the room */
        unlite_room(p_ptr->y, p_ptr->x);
 
        /* Assume seen */
@@ -2795,7 +2829,7 @@ 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)
 {
        POSITION ly, lx;
        int ld;
@@ -2857,7 +2891,7 @@ bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
 bool teleport_swap(DIRECTION dir)
 {
        POSITION tx, ty;
-       cave_type* c_ptr;
+       grid_type* g_ptr;
        monster_type* m_ptr;
        monster_race* r_ptr;
 
@@ -2871,7 +2905,7 @@ bool teleport_swap(DIRECTION dir)
                tx = p_ptr->x + ddx[dir];
                ty = p_ptr->y + ddy[dir];
        }
-       c_ptr = &cave[ty][tx];
+       g_ptr = &current_floor_ptr->grid_array[ty][tx];
 
        if (p_ptr->anti_tele)
        {
@@ -2879,34 +2913,27 @@ bool teleport_swap(DIRECTION dir)
                return FALSE;
        }
 
-       if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding))
+       if (!g_ptr->m_idx || (g_ptr->m_idx == p_ptr->riding))
        {
                msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
-
-               /* Failure */
                return FALSE;
        }
 
-       if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
+       if ((g_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
        {
                msg_print(_("失敗した。", "Failed to swap."));
-
-               /* Failure */
                return FALSE;
        }
 
-       m_ptr = &m_list[c_ptr->m_idx];
+       m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
        r_ptr = &r_info[m_ptr->r_idx];
 
-       (void)set_monster_csleep(c_ptr->m_idx, 0);
+       (void)set_monster_csleep(g_ptr->m_idx, 0);
 
        if (r_ptr->flagsr & RFR_RES_TELE)
        {
                msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
-
                if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
-
-               /* Failure */
                return FALSE;
        }
 
@@ -2921,7 +2948,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 威力
@@ -2930,7 +2957,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);
@@ -3084,137 +3111,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 死の光線処理
@@ -3289,13 +3185,9 @@ bool glyph_creation(void)
 bool wall_stone(void)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
-
        bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
-
        p_ptr->update |= (PU_FLOW);
-
        p_ptr->redraw |= (PR_MAP);
-
        return dummy;
 }
 
@@ -3408,8 +3300,7 @@ void call_chaos(void)
  */
 bool activate_ty_curse(bool stop_ty, int *count)
 {
-       int     i = 0;
-
+       int i = 0;
        BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
 
        do
@@ -3456,7 +3347,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), '\0');
+                       (*count) += summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->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..."));
@@ -3488,7 +3379,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        /*
                         * Only summon Cyberdemons deep in the dungeon.
                         */
-                       if ((dun_level > 65) && !stop_ty)
+                       if ((current_floor_ptr->dun_level > 65) && !stop_ty)
                        {
                                (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
                                stop_ty = TRUE;
@@ -3496,7 +3387,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        }
                        if (!one_in_(6)) break;
                default:
-                       while (i < 6)
+                       while (i < A_MAX)
                        {
                                do
                                {
@@ -3543,11 +3434,11 @@ int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
 
        if (!pet) mode |= PM_NO_PET;
 
-       summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level);
+       summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level);
 
-       for (i = 0; i < (randint1(7) + (dun_level / 40)); i++)
+       for (i = 0; i < (randint1(7) + (current_floor_ptr->dun_level / 40)); i++)
        {
-               switch (randint1(25) + (dun_level / 20))
+               switch (randint1(25) + (current_floor_ptr->dun_level / 20))
                {
                        case 1: case 2:
                                count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode, '\0');
@@ -3601,38 +3492,6 @@ int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
        return count;
 }
 
-
-/*!
- * @brief サイバーデーモンの召喚
- * @param who 召喚主のモンスターID(0ならばプレイヤー)
- * @param y 召喚位置Y座標
- * @param x 召喚位置X座標
- * @return 作用が実際にあった場合TRUEを返す
- */
-int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
-{
-       int i;
-       int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
-       int count = 0;
-       BIT_FLAGS mode = PM_ALLOW_GROUP;
-
-       /* Summoned by a monster */
-       if (who > 0)
-       {
-               monster_type *m_ptr = &m_list[who];
-               if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
-       }
-
-       if (max_cyber > 4) max_cyber = 4;
-
-       for (i = 0; i < max_cyber; i++)
-       {
-               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
-       }
-
-       return count;
-}
-
 /*!
  * @brief 周辺破壊効果(プレイヤー中心)
  * @return 作用が実際にあった場合TRUEを返す
@@ -3865,23 +3724,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);
@@ -3922,7 +3772,7 @@ bool rush_attack(bool *mdeath)
                ty = target_row;
        }
 
-       if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx;
+       if (in_bounds(ty, tx)) tm_idx = current_floor_ptr->grid_array[ty][tx].m_idx;
 
        path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
        project_length = 0;
@@ -3942,7 +3792,7 @@ bool rush_attack(bool *mdeath)
                int ny = GRID_Y(path_g[i]);
                int nx = GRID_X(path_g[i]);
 
-               if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0))
+               if (cave_empty_bold(ny, nx) && player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0))
                {
                        ty = ny;
                        tx = nx;
@@ -3951,7 +3801,7 @@ bool rush_attack(bool *mdeath)
                        continue;
                }
 
-               if (!cave[ny][nx].m_idx)
+               if (!current_floor_ptr->grid_array[ny][nx].m_idx)
                {
                        if (tm_idx)
                        {
@@ -3968,16 +3818,15 @@ bool rush_attack(bool *mdeath)
 
                /* Move player before updating the monster */
                if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
-               update_monster(cave[ny][nx].m_idx, TRUE);
+               update_monster(current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
 
                /* Found a monster */
-               m_ptr = &m_list[cave[ny][nx].m_idx];
+               m_ptr = &current_floor_ptr->m_list[current_floor_ptr->grid_array[ny][nx].m_idx];
 
-               if (tm_idx != cave[ny][nx].m_idx)
+               if (tm_idx != current_floor_ptr->grid_array[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
@@ -4015,11 +3864,11 @@ void remove_all_mirrors(bool explode)
 {
        POSITION x, y;
 
-       for (x = 0; x < cur_wid; x++)
+       for (x = 0; x < current_floor_ptr->width; x++)
        {
-               for (y = 0; y < cur_hgt; y++)
+               for (y = 0; y < current_floor_ptr->height; y++)
                {
-                       if (is_mirror_grid(&cave[y][x]))
+                       if (is_mirror_grid(&current_floor_ptr->grid_array[y][x]))
                        {
                                remove_mirror(y, x);
                                if (explode)
@@ -4066,10 +3915,7 @@ void ring_of_power(DIRECTION dir)
        case 3:
        {
                msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
-
-               /* Dispel monsters */
                dispel_monsters(1000);
-
                break;
        }
 
@@ -4077,9 +3923,7 @@ void ring_of_power(DIRECTION dir)
        case 5:
        case 6:
        {
-               /* Mana Ball */
                fire_ball(GF_MANA, dir, 600, 3);
-
                break;
        }
 
@@ -4088,9 +3932,7 @@ void ring_of_power(DIRECTION dir)
        case 9:
        case 10:
        {
-               /* Mana Bolt */
                fire_bolt(GF_MANA, dir, 500);
-
                break;
        }
        }
@@ -4161,7 +4003,7 @@ void wild_magic(int spell)
                break;
        case 27:
        case 28:
-               (void)gain_random_mutation(0);
+               (void)gain_mutation(p_ptr, 0);
                break;
        case 29:
        case 30:
@@ -4180,7 +4022,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), '\0');
+                       (void)summon_specific(0, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
                }
                break;
        case 36:
@@ -4293,7 +4135,7 @@ bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
                if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
 
                /* Stopped by monsters */
-               if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
+               if ((dir != 5) && current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
 
                /* Save the new location */
                x = nx;
@@ -4461,7 +4303,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), '\0');
+               (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
                chg_virtue(V_UNLIFE, 1);
        }
        else if (die < 14)
@@ -4621,7 +4463,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), '\0');
+               summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
        }
        else if (die < 18)
        {
@@ -4643,7 +4485,7 @@ void cast_shuffle(void)
        else if (die < 30)
        {
                msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
-               trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+               trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
        }
        else if (die < 33)
        {
@@ -4694,22 +4536,22 @@ void cast_shuffle(void)
        else if (die < 82)
        {
                msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
-               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_MOLD, 0L);
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
        }
        else if (die < 84)
        {
                msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
-               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_BAT, 0L);
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
        }
        else if (die < 86)
        {
                msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
-               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_VORTEX, 0L);
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
        }
        else if (die < 88)
        {
                msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
-               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
        }
        else if (die < 96)
        {
@@ -4726,7 +4568,7 @@ void cast_shuffle(void)
        else if (die < 111)
        {
                msg_print(_("《審判》だ。", "It's the Judgement."));
-               do_cmd_rerate(FALSE);
+               roll_hitdice(p_ptr, 0L);
                lose_all_mutations();
        }
        else if (die < 120)
@@ -4749,152 +4591,13 @@ 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 (music_singing_any()) stop_singing(p_ptr);
        if (hex_spelling_any()) stop_hex_spell_all();
 }
 
@@ -4904,9 +4607,9 @@ bool_hack vampirism(void)
        DIRECTION dir;
        POSITION x, y;
        int dummy;
-       cave_type *c_ptr;
+       grid_type *g_ptr;
 
-       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
        {
                msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
                return FALSE;
@@ -4916,11 +4619,11 @@ bool_hack vampirism(void)
        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];
+       g_ptr = &current_floor_ptr->grid_array[y][x];
 
        stop_mouth();
 
-       if (!(c_ptr->m_idx))
+       if (!(g_ptr->m_idx))
        {
                msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
                return FALSE;
@@ -4959,7 +4662,7 @@ bool panic_hit(void)
        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)
+       if (current_floor_ptr->grid_array[y][x].m_idx)
        {
                py_attack(y, x, 0);
                if (randint0(p_ptr->skill_dis) < 7)
@@ -4992,28 +4695,17 @@ bool panic_hit(void)
 bool psychometry(void)
 {
        OBJECT_IDX      item;
-       object_type     *o_ptr;
+       object_type *o_ptr;
        GAME_TEXT o_name[MAX_NLEN];
        byte            feel;
-       cptr            q, s;
+       concptr            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];
-       }
+       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))
@@ -5036,27 +4728,18 @@ 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
 
 
-       /* 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 */
@@ -5094,3 +4777,444 @@ 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
+       {
+               grid_type *g_ptr = &current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+               feature_type *f_ptr = &f_info[g_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 (current_floor_ptr->grid_array[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 (current_floor_ptr->grid_array[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."));
+       }
+       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(&current_floor_ptr->grid_array[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;
+}
+
+bool sword_dancing(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       POSITION y = 0, x = 0;
+       int i;
+       grid_type *g_ptr;
+
+       for (i = 0; i < 6; i++)
+       {
+               dir = randint0(8);
+               y = creature_ptr->y + ddy_ddd[dir];
+               x = creature_ptr->x + ddx_ddd[dir];
+               g_ptr = &current_floor_ptr->grid_array[y][x];
+
+               /* Hack -- attack monsters */
+               if (g_ptr->m_idx)
+                       py_attack(y, x, 0);
+               else
+               {
+                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
+               }
+       }
+       return TRUE;
+}
+
+bool confusing_light(player_type *creature_ptr)
+{
+       msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
+       slow_monsters(creature_ptr->lev);
+       stun_monsters(creature_ptr->lev * 4);
+       confuse_monsters(creature_ptr->lev * 4);
+       turn_monsters(creature_ptr->lev * 4);
+       stasis_monsters(creature_ptr->lev * 4);
+       return TRUE;
+}
+
+bool rodeo(player_type *creature_ptr)
+{
+       GAME_TEXT m_name[MAX_NLEN];
+       monster_type *m_ptr;
+       monster_race *r_ptr;
+       int rlev;
+
+       if (creature_ptr->riding)
+       {
+               msg_print(_("今は乗馬中だ。", "You ARE riding."));
+               return FALSE;
+       }
+       if (!do_riding(TRUE)) return TRUE;
+
+       m_ptr = &current_floor_ptr->m_list[creature_ptr->riding];
+       r_ptr = &r_info[m_ptr->r_idx];
+       monster_desc(m_name, m_ptr, 0);
+       msg_format(_("%sに乗った。", "You ride on %s."), m_name);
+
+       if (is_pet(m_ptr)) return TRUE;
+
+       rlev = r_ptr->level;
+
+       if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
+       if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
+       if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
+               && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle
+               && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
+               && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
+       {
+               msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
+               set_pet(m_ptr);
+       }
+       else
+       {
+               msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
+               rakuba(1, TRUE);
+
+               /* Paranoia */
+               /* 落馬処理に失敗してもとにかく乗馬解除 */
+               creature_ptr->riding = 0;
+       }
+       return TRUE;
+}
+
+bool clear_mind(player_type *creature_ptr)
+{
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+       creature_ptr->csp += (3 + creature_ptr->lev / 20);
+       if (creature_ptr->csp >= creature_ptr->msp)
+       {
+               creature_ptr->csp = creature_ptr->msp;
+               creature_ptr->csp_frac = 0;
+       }
+       creature_ptr->redraw |= (PR_MANA);
+       return TRUE;
+}
+
+bool concentration(player_type *creature_ptr)
+{
+       int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
+
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       if (creature_ptr->special_defense & KATA_MASK)
+       {
+               msg_print(_("今は構えに集中している。", "You need concentration on your form."));
+               return FALSE;
+       }
+       msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
+
+       creature_ptr->csp += creature_ptr->msp / 2;
+       if (creature_ptr->csp >= max_csp)
+       {
+               creature_ptr->csp = max_csp;
+               creature_ptr->csp_frac = 0;
+       }
+       creature_ptr->redraw |= (PR_MANA);
+       return TRUE;
+}