OSDN Git Service

[Refactor] #38997 los()、projectable()、vault_monsters()、project_path()、scatter() の引数をp...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 03:37:58 +0000 (12:37 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 03:37:58 +0000 (12:37 +0900)
51 files changed:
src/cmd/cmd-activate.c
src/cmd/cmd-basic.c
src/cmd/cmd-magiceat.c
src/cmd/cmd-mane.c
src/cmd/cmd-zaprod.c
src/cmd/cmd-zapwand.c
src/combat/shoot.c
src/floor-events.c
src/floor-save.c
src/floor.c
src/floor.h
src/geometry.h
src/mind.c
src/monster-process.c
src/monster-spell.h
src/monster-status.c
src/monster1.c
src/monster2.c
src/mspells1.c
src/mspells2.c
src/mspells3.c
src/mspells4.c
src/mutation.c
src/object2.c
src/player-status.c
src/quest.c
src/racial.c
src/realm-arcane.c
src/realm-chaos.c
src/realm-crusade.c
src/realm-daemon.c
src/realm-death.c
src/realm-hex.c
src/realm-hissatsu.c
src/realm-life.c
src/realm-nature.c
src/realm-song.c
src/realm-sorcery.c
src/realm-trump.c
src/rooms-normal.c
src/spells-summon.c
src/spells.h
src/spells1.c
src/spells2.c
src/spells3.c
src/targeting.c
src/targeting.h
src/trap.c
src/view-mainwindow.c
src/warning.c
src/wizard2.c

index ecade71..e4ec407 100644 (file)
@@ -481,7 +481,7 @@ void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
                {
                        bool old_target_pet = target_pet;
                        target_pet = TRUE;
-                       if (!get_aim_dir(&dir))
+                       if (!get_aim_dir(user_ptr, &dir))
                        {
                                target_pet = old_target_pet;
                                return;
@@ -661,7 +661,7 @@ static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
        int i, t, n = 0;
        DIRECTION dir;
 
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(user_ptr, &dir)) return FALSE;
 
        object_flags(o_ptr, flgs);
 
@@ -712,7 +712,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        {
        case ACT_SUNLIGHT:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
                (void)lite_line(user_ptr, dir, damroll(6, 8));
                break;
@@ -721,7 +721,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_MISS_1:
        {
                msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
                break;
        }
@@ -729,7 +729,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_POIS_1:
        {
                msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_POIS, dir, 12, 3);
                break;
        }
@@ -737,7 +737,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_ELEC_1:
        {
                msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
                break;
        }
@@ -745,7 +745,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_ACID_1:
        {
                msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
                break;
        }
@@ -753,7 +753,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_COLD_1:
        {
                msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
                break;
        }
@@ -761,7 +761,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_FIRE_1:
        {
                msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
                break;
        }
@@ -769,7 +769,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_COLD_1:
        {
                msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_COLD, dir, 48, 2);
                break;
        }
@@ -777,7 +777,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_COLD_2:
        {
                msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_COLD, dir, 100, 2);
                break;
        }
@@ -785,7 +785,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_COLD_3:
        {
                msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_COLD, dir, 400, 3);
                break;
        }
@@ -793,7 +793,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_FIRE_1:
        {
                msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
                break;
        }
@@ -801,7 +801,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_FIRE_2:
        {
                msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
                break;
        }
@@ -809,7 +809,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_FIRE_3:
        {
                msg_print(_("深赤色に輝いている...", "It glows deep red..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
                break;
        }
@@ -817,7 +817,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_FIRE_4:
        {
                msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
                break;
        }
@@ -825,7 +825,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_ELEC_2:
        {
                msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
                break;
        }
@@ -833,7 +833,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_ELEC_3:
        {
                msg_print(_("深青色に輝いている...", "It glows deep blue..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
                break;
        }
@@ -841,7 +841,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_ACID_1:
        {
                msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_ACID, dir, 100, 2);
                break;
        }
@@ -849,7 +849,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_NUKE_1:
        {
                msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
                break;
        }
@@ -857,7 +857,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_HYPODYNAMIA_1:
        {
                msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                if (hypodynamic_bolt(user_ptr, dir, 100))
                        break;
        }
@@ -865,14 +865,14 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_HYPODYNAMIA_2:
        {
                msg_print(_("黒く輝いている...", "It glows black..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                hypodynamic_bolt(user_ptr, dir, 120);
                break;
        }
 
        case ACT_DRAIN_1:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                for (dummy = 0; dummy < 3; dummy++)
                {
                        if (hypodynamic_bolt(user_ptr, dir, 50))
@@ -884,7 +884,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_MISS_2:
        {
                msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_ARROW, dir, 150);
                break;
        }
@@ -897,7 +897,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_DRAIN_2:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                for (dummy = 0; dummy < 3; dummy++)
                {
                        if (hypodynamic_bolt(user_ptr, dir, 100))
@@ -916,7 +916,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_ROCKET:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                msg_print(_("ロケットを発射した!", "You launch a rocket!"));
                fire_ball(user_ptr, GF_ROCKET, dir, 250 + plev * 3, 2);
                break;
@@ -931,7 +931,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_BA_MISS_3:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
                fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
                break;
@@ -947,7 +947,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BO_MANA:
        {
                msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_bolt(user_ptr, GF_ARROW, dir, 150);
                break;
        }
@@ -955,7 +955,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_WATER:
        {
                msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_WATER, dir, 200, 3);
                break;
        }
@@ -963,7 +963,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_DARK:
        {
                msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_DARK, dir, 250, 4);
                break;
        }
@@ -971,7 +971,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BA_MANA:
        {
                msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_ball(user_ptr, GF_MANA, dir, 250, 4);
                break;
        }
@@ -994,7 +994,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BIZARRE:
        {
                msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                ring_of_power(user_ptr, dir);
                break;
        }
@@ -1011,7 +1011,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
                        while (attempts--)
                        {
-                               scatter(user_ptr->current_floor_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
+                               scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
                                if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
                                if (!player_bold(user_ptr, y, x)) break;
                        }
@@ -1025,7 +1025,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_BLADETURNER:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
                fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
                msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
@@ -1043,7 +1043,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_BR_FIRE:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
                {
@@ -1054,7 +1054,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_BR_COLD:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                fire_breath(user_ptr, GF_COLD, dir, 200, 2);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
                {
@@ -1073,7 +1073,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_CONFUSE:
        {
                msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                confuse_monster(user_ptr, dir, 20);
                break;
        }
@@ -1099,7 +1099,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_TELE_AWAY:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
                break;
        }
@@ -1155,21 +1155,21 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_CHARM_ANIMAL:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                (void)charm_animal(user_ptr, dir, plev);
                break;
        }
 
        case ACT_CHARM_UNDEAD:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                (void)control_one_undead(user_ptr, dir, plev);
                break;
        }
 
        case ACT_CHARM_OTHER:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                (void)charm_monster(user_ptr, dir, plev * 2);
                break;
        }
@@ -1382,7 +1382,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                        fire_ball(user_ptr, GF_ACID, dir, 100, 2);
                }
                (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
@@ -1394,7 +1394,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                        fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
                }
                (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
@@ -1406,7 +1406,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                        fire_ball(user_ptr, GF_COLD, dir, 100, 2);
                }
                (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
@@ -1418,7 +1418,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
                if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                        fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
                }
                (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
@@ -1509,7 +1509,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_STONE_MUD:
        {
                msg_print(_("鼓動している...", "It pulsates..."));
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                wall_to_mud(user_ptr, dir, 20 + randint1(30));
                break;
        }
@@ -1573,7 +1573,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_TELEKINESIS:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(user_ptr, &dir)) return FALSE;
                msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
                fetch(user_ptr, dir, 500, TRUE);
                break;
index 080b0d5..884be89 100644 (file)
@@ -2441,14 +2441,14 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                project_length = tdis + 1;
 
                /* Get a direction (or cancel) */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
 
                /* Predict the "target" location */
                tx = creature_ptr->x + 99 * ddx[dir];
                ty = creature_ptr->y + 99 * ddy[dir];
 
                /* Check for "target request" */
-               if ((dir == 5) && target_okay())
+               if ((dir == 5) && target_okay(creature_ptr))
                {
                        tx = target_col;
                        ty = target_row;
index 13c2a85..d7f8a51 100644 (file)
@@ -569,13 +569,13 @@ bool do_cmd_magic_eater(player_type *creature_ptr, bool only_browse, bool powerf
                if (tval == TV_ROD)
                {
                        if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
-                               if (!get_aim_dir(&dir)) return FALSE;
+                               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        rod_effect(creature_ptr, sval, dir, &use_charge, powerful, TRUE);
                        if (!use_charge) return FALSE;
                }
                else if (tval == TV_WAND)
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        wand_effect(creature_ptr, sval, dir, powerful, TRUE);
                }
                else
index ff7181b..786de57 100644 (file)
@@ -295,19 +295,19 @@ static bool use_mane(player_type *caster_ptr, int spell)
                m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                dispel_monster_status(m_idx);
                break;
        }
 
        case MS_ROCKET:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("ロケットを発射した。", "You fire a rocket."));
                        fire_rocket(caster_ptr, GF_ROCKET, dir, damage, 2);
                break;
 
        case MS_SHOOT:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("矢を放った。", "You fire an arrow."));
                        fire_bolt(caster_ptr, GF_ARROW, dir, damage);
                break;
@@ -322,324 +322,324 @@ static bool use_mane(player_type *caster_ptr, int spell)
                break;
 
        case MS_BR_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
                fire_breath(caster_ptr, GF_ACID, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_ELEC:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
                fire_breath(caster_ptr, GF_ELEC, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
                fire_breath(caster_ptr, GF_FIRE, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_COLD:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
                fire_breath(caster_ptr, GF_COLD, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_POIS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
                fire_breath(caster_ptr, GF_POIS, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_NETHER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
                fire_breath(caster_ptr, GF_NETHER, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_LITE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
                fire_breath(caster_ptr, GF_LITE, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_DARK:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
                fire_breath(caster_ptr, GF_DARK, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_CONF:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
                fire_breath(caster_ptr, GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_SOUND:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
                fire_breath(caster_ptr, GF_SOUND, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_CHAOS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
                fire_breath(caster_ptr, GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_DISEN:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
                fire_breath(caster_ptr, GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_NEXUS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
                        fire_breath(caster_ptr, GF_NEXUS, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_TIME:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
                fire_breath(caster_ptr, GF_TIME, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_INERTIA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
                        fire_breath(caster_ptr, GF_INERTIAL, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_GRAVITY:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));         
                fire_breath(caster_ptr, GF_GRAVITY, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_SHARDS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
                fire_breath(caster_ptr, GF_SHARDS, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_PLASMA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
                
                fire_breath(caster_ptr, GF_PLASMA, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_FORCE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
                
                fire_breath(caster_ptr, GF_FORCE, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BR_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
                
                fire_breath(caster_ptr, GF_MANA, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BALL_NUKE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
                
                        fire_ball(caster_ptr, GF_NUKE, dir, damage, 2);
                break;
 
        case MS_BR_NUKE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
                
                fire_breath(caster_ptr, GF_NUKE, dir, damage, (plev > 35 ? 3 : 2));
                break;
 
        case MS_BALL_CHAOS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
                
                        fire_ball(caster_ptr, GF_CHAOS, dir, damage, 4);
                break;
        case MS_BR_DISI:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
                
                fire_breath(caster_ptr, GF_DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2));
                break;
        case MS_BALL_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
                
                        fire_ball(caster_ptr, GF_ACID, dir, damage, 2);
                break;
        case MS_BALL_ELEC:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
                
                        fire_ball(caster_ptr, GF_ELEC, dir, damage, 2);
                break;
        case MS_BALL_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
                
                        fire_ball(caster_ptr, GF_FIRE, dir, damage, 2);
                break;
        case MS_BALL_COLD:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
                
                        fire_ball(caster_ptr, GF_COLD, dir, damage, 2);
                break;
        case MS_BALL_POIS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
                
                        fire_ball(caster_ptr, GF_POIS, dir, damage, 2);
                break;
        case MS_BALL_NETHER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
                
                        fire_ball(caster_ptr, GF_NETHER, dir, damage, 2);
                break;
        case MS_BALL_WATER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
                
                        fire_ball(caster_ptr, GF_WATER, dir, damage, 4);
                break;
        case MS_BALL_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
                
                        fire_ball(caster_ptr, GF_MANA, dir, damage, 4);
                break;
        case MS_BALL_DARK:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
                
                        fire_ball(caster_ptr, GF_DARK, dir, damage, 4);
                break;
        case MS_DRAIN_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0);
                break;
        case MS_MIND_BLAST:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_MIND_BLAST, dir, damage, 0);
                break;
        case MS_BRAIN_SMASH:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_BRAIN_SMASH, dir, damage, 0);
                break;
        case MS_CAUSE_1:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_CAUSE_1, dir, damage, 0);
                break;
        case MS_CAUSE_2:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_CAUSE_2, dir, damage, 0);
                break;
        case MS_CAUSE_3:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_CAUSE_3, dir, damage, 0);
                break;
        case MS_CAUSE_4:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball_hide(caster_ptr, GF_CAUSE_4, dir, damage, 0);
                break;
        case MS_BOLT_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
                
                        fire_bolt(caster_ptr, GF_ACID, dir, damage);
                break;
        case MS_BOLT_ELEC:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
                
                        fire_bolt(caster_ptr, GF_ELEC, dir, damage);
                break;
        case MS_BOLT_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
                
                        fire_bolt(caster_ptr, GF_FIRE, dir, damage);
                break;
        case MS_BOLT_COLD:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
                
                        fire_bolt(caster_ptr, GF_COLD, dir, damage);
                break;
        case MS_STARBURST:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
                
                        fire_ball(caster_ptr, GF_LITE, dir, damage, 4);
                break;
        case MS_BOLT_NETHER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
                
                        fire_bolt(caster_ptr, GF_NETHER, dir, damage);
                break;
        case MS_BOLT_WATER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
                
                        fire_bolt(caster_ptr, GF_WATER, dir, damage);
                break;
        case MS_BOLT_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
                
                        fire_bolt(caster_ptr, GF_MANA, dir, damage);
                break;
        case MS_BOLT_PLASMA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
                
                        fire_bolt(caster_ptr, GF_PLASMA, dir, damage);
                break;
        case MS_BOLT_ICE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
                
                        fire_bolt(caster_ptr, GF_ICE, dir, damage);
                break;
        case MS_MAGIC_MISSILE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
                
                        fire_bolt(caster_ptr, GF_MISSILE, dir, damage);
                break;
        case MS_SCARE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
                
                        fear_monster(caster_ptr, dir, plev+10);
                break;
        case MS_BLIND:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                confuse_monster(caster_ptr, dir, plev * 2);
                break;
        case MS_CONF:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
                
                        confuse_monster(caster_ptr, dir, plev * 2);
                break;
        case MS_SLOW:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                slow_monster(caster_ptr, dir, plev);
                break;
        case MS_SLEEP:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                sleep_monster(caster_ptr, dir, plev);
                break;
        case MS_SPEED:
@@ -647,7 +647,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                break;
        case MS_HAND_DOOM:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
 
                fire_ball_hide(caster_ptr, GF_HAND_DOOM, dir, 200, 0);
@@ -683,7 +683,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                if (!caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                m_ptr = &caster_ptr->current_floor_ptr->m_list[caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
                r_ptr = &r_info[m_ptr->r_idx];
                monster_desc(m_name, m_ptr, 0);
@@ -710,7 +710,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                break;
        }
        case MS_TELE_AWAY:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                (void)fire_beam(caster_ptr, GF_AWAY_ALL, dir, plev);
                break;
@@ -720,7 +720,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                break;
 
        case MS_PSY_SPEAR:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                else msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
                (void)fire_beam(caster_ptr, GF_PSY_SPEAR, dir, damage);
                break;
index fe238b9..703c8eb 100644 (file)
@@ -299,7 +299,7 @@ void exe_zap_rod(player_type *creature_ptr, INVENTORY_IDX item)
                !object_is_aware(o_ptr))
        {
                /* Get a direction, allow cancel */
-               if (!get_aim_dir(&dir)) return;
+               if (!get_aim_dir(creature_ptr, &dir)) return;
        }
 
 
index af72550..34d7e5f 100644 (file)
@@ -350,7 +350,7 @@ void exe_aim_wand(player_type *creature_ptr, INVENTORY_IDX item)
        if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
                || o_ptr->sval == SV_WAND_HASTE_MONSTER))
                target_pet = TRUE;
-       if (!get_aim_dir(&dir))
+       if (!get_aim_dir(creature_ptr, &dir))
        {
                target_pet = old_target_pet;
                return;
index 254af44..eff819c 100644 (file)
@@ -438,7 +438,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
        project_length = tdis + 1;
 
        /* Get a direction (or cancel) */
-       if (!get_aim_dir(&dir))
+       if (!get_aim_dir(shooter_ptr, &dir))
        {
                free_turn(shooter_ptr);
 
@@ -454,14 +454,14 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
        ty = shooter_ptr->y + 99 * ddy[dir];
 
        /* Check for "target request" */
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(shooter_ptr))
        {
                tx = target_col;
                ty = target_row;
        }
 
        /* Get projection path length */
-       tdis = project_path(shooter_ptr->current_floor_ptr, path_g, project_length, shooter_ptr->y, shooter_ptr->x, ty, tx, PROJECT_PATH | PROJECT_THRU) - 1;
+       tdis = project_path(shooter_ptr, path_g, project_length, shooter_ptr->y, shooter_ptr->x, ty, tx, PROJECT_PATH | PROJECT_THRU) - 1;
 
        project_length = 0; /* reset to default */
 
index 3d9fe50..a0359e7 100644 (file)
@@ -718,7 +718,7 @@ static bool update_view_aux(player_type *subject_ptr, POSITION y, POSITION x, PO
        }
 
        /* Hack -- check line of sight */
-       if (los(floor_ptr, subject_ptr->y, subject_ptr->x, y, x))
+       if (los(subject_ptr, subject_ptr->y, subject_ptr->x, y, x))
        {
                cave_view_hack(floor_ptr, g_ptr, y, x);
                return wall;
index 1ffc736..4cf6a7a 100644 (file)
@@ -457,8 +457,8 @@ static void preserve_pet(player_type *master_ptr)
                                 * when you or the pet can see the other.
                                 */
                                if (m_ptr->nickname && 
-                                   ((player_has_los_bold(master_ptr, m_ptr->fy, m_ptr->fx) && projectable(master_ptr->current_floor_ptr, master_ptr->y, master_ptr->x, m_ptr->fy, m_ptr->fx)) ||
-                                    (los(master_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x) && projectable(master_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x))))
+                                   ((player_has_los_bold(master_ptr, m_ptr->fy, m_ptr->fx) && projectable(master_ptr, master_ptr->y, master_ptr->x, m_ptr->fy, m_ptr->fx)) ||
+                                    (los(master_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x) && projectable(master_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x))))
                                {
                                        if (dis > 3) continue;
                                }
@@ -579,7 +579,7 @@ static void place_pet(player_type *master_ptr)
                        {
                                for (j = 1000; j > 0; j--)
                                {
-                                       scatter(master_ptr->current_floor_ptr, &cy, &cx, master_ptr->y, master_ptr->x, d, 0);
+                                       scatter(master_ptr, &cy, &cx, master_ptr->y, master_ptr->x, d, 0);
                                        if (monster_can_enter(cy, cx, &r_info[party_mon[i].r_idx], 0)) break;
                                }
                                if (j) break;
index e09a123..9c64fc0 100644 (file)
@@ -292,6 +292,7 @@ void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x)
 
 /*!
  * @brief LOS(Line Of Sight / 視線が通っているか)の判定を行う。
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y1 始点のy座標
  * @param x1 始点のx座標
  * @param y2 終点のy座標
@@ -332,7 +333,7 @@ void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x)
  *\n
  * Use the "update_view()" function to determine player line-of-sight.\n
  */
-bool los(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
        /* Delta */
        POSITION dx, dy;
@@ -373,7 +374,7 @@ bool los(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION
        /* if (!in_bounds(floor_ptr, y1, x1)) return FALSE; */
        /* if (!in_bounds(floor_ptr, y2, x2)) return FALSE; */
 
-
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        /* Directly South/North */
        if (!dx)
        {
@@ -562,7 +563,7 @@ bool los(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION
  *
  * This is slightly (but significantly) different from "los(y1,x1,y2,x2)".
  */
-bool projectable(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
        POSITION y, x;
 
@@ -570,7 +571,7 @@ bool projectable(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, P
        u16b grid_g[512];
 
        /* Check the projection path */
-       grid_n = project_path(floor_ptr, grid_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, 0);
+       grid_n = project_path(player_ptr, grid_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, 0);
 
        /* Identical grid */
        if (!grid_n) return TRUE;
@@ -589,6 +590,7 @@ bool projectable(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, P
 
 /*!
  * @brief 特殊な部屋地形向けにモンスターを配置する / Hack -- Place some sleeping monsters near the given location
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y1 モンスターを配置したいマスの中心Y座標
  * @param x1 モンスターを配置したいマスの中心X座標
  * @param num 配置したいモンスターの数
@@ -596,13 +598,14 @@ bool projectable(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, P
  * @details
  * Only really called by some of the "vault" routines.
  */
-void vault_monsters(floor_type *floor_ptr, POSITION y1, POSITION x1, int num)
+void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num)
 {
        int k, i;
        POSITION y, x;
        grid_type *g_ptr;
 
        /* Try to summon "num" monsters "near" the given location */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (k = 0; k < num; k++)
        {
                /* Try nine locations */
@@ -611,10 +614,10 @@ void vault_monsters(floor_type *floor_ptr, POSITION y1, POSITION x1, int num)
                        int d = 1;
 
                        /* Pick a nearby location */
-                       scatter(floor_ptr, &y, &x, y1, x1, d, 0);
+                       scatter(player_ptr, &y, &x, y1, x1, d, 0);
 
                        /* Require "empty" floor grids */
-                       g_ptr = &floor_ptr->grid_array[y][x];
+                       g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
                        if (!cave_empty_grid(g_ptr)) continue;
 
                        /* Place the monster (allow groups) */
@@ -1293,7 +1296,7 @@ void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num)
  * by "update_view_los()", and very different from the one used by "los()".
  * </pre>
  */
-sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
+sint project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
 {
        POSITION y, x;
 
@@ -1351,6 +1354,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
        full = half << 1;
 
        /* Vertical */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (ay > ax)
        {
                /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
@@ -1407,7 +1411,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(p_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
+                                       (player_bold(player_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
@@ -1496,7 +1500,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(p_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
+                                       (player_bold(player_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
@@ -1567,7 +1571,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
                        if (flg & (PROJECT_STOP))
                        {
                                if ((n > 0) &&
-                                       (player_bold(p_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
+                                       (player_bold(player_ptr, y, x) || floor_ptr->grid_array[y][x].m_idx != 0))
                                        break;
                        }
 
@@ -1978,11 +1982,12 @@ void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, P
  *
  * Currently the "m" parameter is unused.
  */
-void scatter(floor_type *floor_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
+void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
 {
        POSITION nx, ny;
 
        /* Pick a location */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        while (TRUE)
        {
                /* Pick a new location */
@@ -1997,11 +2002,11 @@ void scatter(floor_type *floor_ptr, POSITION *yp, POSITION *xp, POSITION y, POSI
 
                if (mode & PROJECT_LOS)
                {
-                       if (los(floor_ptr, y, x, ny, nx)) break;
+                       if (los(player_ptr, y, x, ny, nx)) break;
                }
                else
                {
-                       if (projectable(floor_ptr, y, x, ny, nx)) break;
+                       if (projectable(player_ptr, y, x, ny, nx)) break;
                }
 
        }
index 8bf3f33..e7ee4e4 100644 (file)
@@ -381,11 +381,11 @@ extern void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
 extern void forget_flow(floor_type *floor_ptr);
 extern void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
 
-extern bool los(floor_type* floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern bool projectable(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+extern bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+extern bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern int project_length;
 
-extern void vault_monsters(floor_type *floor_ptr, POSITION y1, POSITION x1, int num);
+extern void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num);
 extern bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
 extern void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
 extern void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room);
@@ -419,7 +419,7 @@ extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int n
 #define PROJECT_PATH        0x2000 /*!< 遠隔攻撃特性: / Only used for printing project path */
 #define PROJECT_FAST        0x4000 /*!< 遠隔攻撃特性: / Hide "visual" of flying bolts until blast */
 #define PROJECT_LOS         0x8000 /*!< 遠隔攻撃特性: /  */
-extern sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
+extern sint project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
 
 extern void set_floor(floor_type *floor_ptr, POSITION x, POSITION y);
 extern void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
@@ -427,4 +427,4 @@ extern void place_gold(floor_type *floor_ptr, POSITION y, POSITION x);
 extern void delete_monster(floor_type *floor_ptr, POSITION y, POSITION x);
 extern void compact_objects(floor_type *floor_ptr, int size);
 extern void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
-extern void scatter(floor_type *floor_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
+extern void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
index e301b83..57dfca5 100644 (file)
@@ -61,5 +61,5 @@ struct coord
  */
 #define is_seen(A) \
        ((bool)((A)->ml && (!ignore_unview || p_ptr->phase_out || \
-        (player_can_see_bold(p_ptr, (A)->fy, (A)->fx) && projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
+        (player_can_see_bold(p_ptr, (A)->fy, (A)->fx) && projectable(p_ptr, p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
 
index 2feec38..620c3e7 100644 (file)
@@ -1066,7 +1066,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                break;
        case 1:
                /* Mindblast */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                if (randint1(100) < plev * 2)
                        fire_beam(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
@@ -1085,7 +1085,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                /* Domination */
                if (plev < 30)
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                        fire_ball(caster_ptr, GF_DOMINATION, dir, plev, 0);
                }
@@ -1096,7 +1096,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                break;
        case 5:
                /* Fist of Force  ---  not 'true' TK  */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                fire_ball(caster_ptr, GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8),
                        (plev > 20 ? (plev - 20) / 8 + 1 : 0));
@@ -1147,14 +1147,14 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                break;
        case 10:
                /* Telekinesis */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                fetch(caster_ptr, dir, plev * 15, FALSE);
 
                break;
        case 11:
                /* Psychic Drain */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                b = damroll(plev / 2, 6);
 
@@ -1164,7 +1164,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                break;
        case 12:
                /* psycho-spear */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                fire_beam(caster_ptr, GF_PSY_SPEAR, dir, randint1(plev*3)+plev*3);
                break;
@@ -1198,7 +1198,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
        switch (spell)
        {
        case 0:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball(caster_ptr, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0);
                break;
        case 1:
@@ -1209,7 +1209,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
                break;
        case 3:
                project_length = plev / 8 + 3;
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                fire_beam(caster_ptr, GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
                break;
@@ -1235,7 +1235,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
                return shock_power(caster_ptr);
                break;
        case 8:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball(caster_ptr, GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
                break;
        case 9:
@@ -1246,7 +1246,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
                m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                dispel_monster_status(m_idx);
                break;
        }
@@ -1272,7 +1272,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
                fire_ball(caster_ptr, GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10);
                break;
        case 12:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                fire_beam(caster_ptr, GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15));
                break;
@@ -1345,7 +1345,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                }
                break;
        case 2:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                if (plev > 9 && is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x])) {
                        fire_beam(caster_ptr, GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4));
                }
@@ -1371,12 +1371,12 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                break;
                /* banishing mirror */
        case 7:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                (void)fire_beam(caster_ptr, GF_AWAY_ALL, dir, plev);
                break;
                /* mirror clashing */
        case 8:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball(caster_ptr, GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8),
                        (plev > 20 ? (plev - 20) / 8 + 1 : 0));
                break;
@@ -1392,7 +1392,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                break;
                /* seeker ray */
        case 10:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_beam(caster_ptr, GF_SEEKER, dir, damroll(11 + (plev - 5) / 4, 8));
                break;
                /* seal of mirror */
@@ -1408,7 +1408,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                break;
                /* super ray */
        case 13:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_beam(caster_ptr, GF_SUPER_RAY, dir, 150 + randint1(2 * plev));
                break;
                /* illusion light */
@@ -1594,7 +1594,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
        }
        case 6:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                (void)stasis_monster(caster_ptr, dir);
                break;
        }
@@ -1650,11 +1650,11 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                if (!m_idx) break;
                if (m_idx == caster_ptr->riding) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
                monster_desc(m_name, m_ptr, 0);
                msg_format(_("%sを引き戻した。", "You pull back %s."), m_name);
-               path_n = project_path(caster_ptr->current_floor_ptr, path_g, MAX_RANGE, target_row, target_col, caster_ptr->y, caster_ptr->x, 0);
+               path_n = project_path(caster_ptr, path_g, MAX_RANGE, target_row, target_col, caster_ptr->y, caster_ptr->x, 0);
                ty = target_row, tx = target_col;
                for (i = 1; i < path_n; i++)
                {
@@ -1700,12 +1700,12 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                break;
        }
        case 13:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                fire_ball(caster_ptr, GF_OLD_CONF, dir, plev*3, 3);
                break;
        case 14:
                project_length = -1;
-               if (!get_aim_dir(&dir))
+               if (!get_aim_dir(caster_ptr, &dir))
                {
                        project_length = 0;
                        return FALSE;
@@ -1739,7 +1739,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
 
                        while (attempts--)
                        {
-                               scatter(caster_ptr->current_floor_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
+                               scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
 
                                if (!player_bold(caster_ptr, y, x)) break;
                        }
index fe268da..ca95757 100644 (file)
 /*!
  * @brief モンスターが敵に接近するための方向を決める /
  * Calculate the direction to the next enemy
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param m_idx モンスターの参照ID
  * @param mm 移動するべき方角IDを返す参照ポインタ
  * @return 方向が確定した場合TRUE、接近する敵がそもそもいない場合FALSEを返す
  */
-static bool get_enemy_dir(MONSTER_IDX m_idx, int *mm)
+static bool get_enemy_dir(player_type *target_ptr, MONSTER_IDX m_idx, int *mm)
 {
        int i;
        POSITION x = 0, y = 0;
@@ -56,38 +57,39 @@ static bool get_enemy_dir(MONSTER_IDX m_idx, int *mm)
        int start;
        int plus = 1;
 
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
+       monster_type *m_ptr = &floor_ptr->m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
        monster_type *t_ptr;
 
-       if (p_ptr->riding_t_m_idx && player_bold(p_ptr, m_ptr->fy, m_ptr->fx))
+       if (target_ptr->riding_t_m_idx && player_bold(target_ptr, m_ptr->fy, m_ptr->fx))
        {
-               y = p_ptr->current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fy;
-               x = p_ptr->current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fx;
+               y = floor_ptr->m_list[target_ptr->riding_t_m_idx].fy;
+               x = floor_ptr->m_list[target_ptr->riding_t_m_idx].fx;
        }
-       else if (is_pet(m_ptr) && p_ptr->pet_t_m_idx)
+       else if (is_pet(m_ptr) && target_ptr->pet_t_m_idx)
        {
-               y = p_ptr->current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fy;
-               x = p_ptr->current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fx;
+               y = floor_ptr->m_list[target_ptr->pet_t_m_idx].fy;
+               x = floor_ptr->m_list[target_ptr->pet_t_m_idx].fx;
        }
        else
        {
-               if (p_ptr->phase_out)
+               if (target_ptr->phase_out)
                {
-                       start = randint1(p_ptr->current_floor_ptr->m_max-1)+p_ptr->current_floor_ptr->m_max;
+                       start = randint1(floor_ptr->m_max-1)+floor_ptr->m_max;
                        if(randint0(2)) plus = -1;
                }
-               else start = p_ptr->current_floor_ptr->m_max + 1;
+               else start = floor_ptr->m_max + 1;
 
                /* Scan thru all monsters */
-               for (i = start; ((i < start + p_ptr->current_floor_ptr->m_max) && (i > start - p_ptr->current_floor_ptr->m_max)); i+=plus)
+               for (i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i+=plus)
                {
-                       MONSTER_IDX dummy = (i % p_ptr->current_floor_ptr->m_max);
+                       MONSTER_IDX dummy = (i % floor_ptr->m_max);
 
                        if (!dummy) continue;
 
                        t_idx = dummy;
-                       t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
+                       t_ptr = &floor_ptr->m_list[t_idx];
 
                        /* The monster itself isn't a target */
                        if (t_ptr == m_ptr) continue;
@@ -97,16 +99,16 @@ static bool get_enemy_dir(MONSTER_IDX m_idx, int *mm)
                        if (is_pet(m_ptr))
                        {
                                /* Hack -- only fight away from player */
-                               if (p_ptr->pet_follow_distance < 0)
+                               if (target_ptr->pet_follow_distance < 0)
                                {
                                        /* No fighting near player */
-                                       if (t_ptr->cdis <= (0 - p_ptr->pet_follow_distance))
+                                       if (t_ptr->cdis <= (0 - target_ptr->pet_follow_distance))
                                        {
                                                continue;
                                        }
                                }
                                /* Hack -- no fighting away from player */
-                               else if ((m_ptr->cdis < t_ptr->cdis) && (t_ptr->cdis > p_ptr->pet_follow_distance))
+                               else if ((m_ptr->cdis < t_ptr->cdis) && (t_ptr->cdis > target_ptr->pet_follow_distance))
                                {
                                        continue;
                                }
@@ -118,14 +120,14 @@ static bool get_enemy_dir(MONSTER_IDX m_idx, int *mm)
                        if (!are_enemies(m_ptr, t_ptr)) continue;
 
                        /* Monster must be projectable if we can't pass through walls */
-                       if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall)) ||
-                           ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != p_ptr->riding)))
+                       if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) ||
+                           ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)))
                        {
-                               if (!in_disintegration_range(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
+                               if (!in_disintegration_range(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
                        }
                        else
                        {
-                               if (!projectable(p_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
+                               if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
                        }
 
                        /* OK -- we've got a target */
@@ -288,12 +290,13 @@ static bool mon_will_run(MONSTER_IDX m_idx)
 /*!
  * @brief モンスターがプレイヤーに向けて遠距離攻撃を行うことが可能なマスを走査する /
  * Search spell castable grid
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param m_idx モンスターの参照ID
  * @param yp 適したマスのY座標を返す参照ポインタ
  * @param xp 適したマスのX座標を返す参照ポインタ
  * @return 有効なマスがあった場合TRUEを返す
  */
-static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
+static bool get_moves_aux2(player_type *target_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
 {
        int i, best = 999;
        POSITION y, x, y1, x1;
@@ -302,7 +305,8 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        bool can_open_door = FALSE;
        int now_cost;
 
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
+       monster_type *m_ptr = &floor_ptr->m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
        /* Monster location */
@@ -310,10 +314,10 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
        x1 = m_ptr->fx;
 
        /* Monster can already cast spell to player */
-       if (projectable(p_ptr->current_floor_ptr, y1, x1, p_ptr->y, p_ptr->x)) return FALSE;
+       if (projectable(target_ptr, y1, x1, target_ptr->y, target_ptr->x)) return FALSE;
 
        /* Set current grid cost */
-       now_cost = p_ptr->current_floor_ptr->grid_array[y1][x1].cost;
+       now_cost = floor_ptr->grid_array[y1][x1].cost;
        if (now_cost == 0) now_cost = 999;
 
        /* Can monster bash or open doors? */
@@ -331,17 +335,17 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                x = x1 + ddx_ddd[i];
 
                /* Ignore locations off of edge */
-               if (!in_bounds2(p_ptr->current_floor_ptr, y, x)) continue;
+               if (!in_bounds2(floor_ptr, y, x)) continue;
 
                /* Simply move to player */
-               if (player_bold(p_ptr, y, x)) return FALSE;
+               if (player_bold(target_ptr, y, x)) return FALSE;
 
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+               g_ptr = &floor_ptr->grid_array[y][x];
 
                cost = g_ptr->cost;
 
                /* Monster cannot kill or pass walls */
-               if (!(((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall)) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != p_ptr->riding))))
+               if (!(((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding))))
                {
                        if (cost == 0) continue;
                        if (!can_open_door && is_closed_door(g_ptr->feat)) continue;
@@ -352,7 +356,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
 
                if (now_cost < cost) continue;
 
-               if (!projectable(p_ptr->current_floor_ptr, y, x, p_ptr->y, p_ptr->x)) continue;
+               if (!projectable(target_ptr, y, x, target_ptr->y, target_ptr->x)) continue;
 
                /* Accept louder sounds */
                if (best < cost) continue;
@@ -398,7 +402,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
  * being close enough to chase directly.  I have no idea what will\n
  * happen if you combine "smell" with low "aaf" values.\n
  */
-static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no_flow)
+static bool get_moves_aux(player_type *target_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no_flow)
 {
        int i, best;
        POSITION y, x, y1, x1;
@@ -406,7 +410,8 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
        grid_type *g_ptr;
        bool use_scent = FALSE;
 
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
+       monster_type *m_ptr = &floor_ptr->m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
        /* Can monster cast attack spell? */
@@ -415,25 +420,25 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
            r_ptr->a_ability_flags2 & (RF6_ATTACK_MASK))
        {
                /* Can move spell castable grid? */
-               if (get_moves_aux2(m_idx, yp, xp)) return TRUE;
+               if (get_moves_aux2(target_ptr, m_idx, yp, xp)) return TRUE;
        }
 
        /* Monster can't flow */
        if (no_flow) return FALSE;
 
        /* Monster can go through rocks */
-       if ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall)) return FALSE;
-       if ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != p_ptr->riding)) return FALSE;
+       if ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) return FALSE;
+       if ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)) return FALSE;
 
        /* Monster location */
        y1 = m_ptr->fy;
        x1 = m_ptr->fx;
 
        /* Hack -- Player can see us, run towards him */
-       if (player_has_los_bold(p_ptr, y1, x1) && projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, y1, x1)) return FALSE;
+       if (player_has_los_bold(target_ptr, y1, x1) && projectable(target_ptr, target_ptr->y, target_ptr->x, y1, x1)) return FALSE;
 
        /* Monster grid */
-       g_ptr = &p_ptr->current_floor_ptr->grid_array[y1][x1];
+       g_ptr = &floor_ptr->grid_array[y1][x1];
 
        /* If we can hear noises, advance towards them */
        if (g_ptr->cost)
@@ -445,7 +450,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
        else if (g_ptr->when)
        {
                /* Too old smell */
-               if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return FALSE;
+               if (floor_ptr->grid_array[target_ptr->y][target_ptr->x].when - g_ptr->when > 127) return FALSE;
 
                use_scent = TRUE;
                best = 0;
@@ -464,9 +469,9 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
                x = x1 + ddx_ddd[i];
 
                /* Ignore locations off of edge */
-               if (!in_bounds2(p_ptr->current_floor_ptr, y, x)) continue;
+               if (!in_bounds2(floor_ptr, y, x)) continue;
 
-               g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+               g_ptr = &floor_ptr->grid_array[y][x];
 
                /* We're following a scent trail */
                if (use_scent)
@@ -493,8 +498,8 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
                }
 
                /* Hack -- Save the "twiddled" location */
-               (*yp) = p_ptr->y + 16 * ddy_ddd[i];
-               (*xp) = p_ptr->x + 16 * ddx_ddd[i];
+               (*yp) = target_ptr->y + 16 * ddy_ddd[i];
+               (*xp) = target_ptr->x + 16 * ddx_ddd[i];
        }
 
        /* No legal move (?) */
@@ -690,6 +695,7 @@ static POSITION *dist_offsets_x[10] =
 /*!
  * @brief モンスターが逃げ込める安全な地点を返す /
  * Choose a "safe" location near a monster for it to run toward.
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param m_idx モンスターの参照ID
  * @param yp 移動先のマスのY座標を返す参照ポインタ
  * @param xp 移動先のマスのX座標を返す参照ポインタ
@@ -705,9 +711,10 @@ static POSITION *dist_offsets_x[10] =
  *\n
  * Return TRUE if a safe location is available.\n
  */
-static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
+static bool find_safety(player_type *target_ptr, MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
 {
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
+       monster_type *m_ptr = &floor_ptr->m_list[m_idx];
 
        POSITION fy = m_ptr->fy;
        POSITION fx = m_ptr->fx;
@@ -736,12 +743,12 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                        x = fx + dx;
 
                        /* Skip illegal locations */
-                       if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
+                       if (!in_bounds(floor_ptr, y, x)) continue;
 
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       g_ptr = &floor_ptr->grid_array[y][x];
 
                        /* Skip locations in a wall */
-                       if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue;
+                       if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == target_ptr->riding) ? CEM_RIDING : 0)) continue;
 
                        /* Check for "availability" (if monsters can flow) */
                        if (!(m_ptr->mflag2 & MFLAG2_NOFLOW))
@@ -750,14 +757,14 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                                if (g_ptr->dist == 0) continue;
 
                                /* Ignore too-distant grids */
-                               if (g_ptr->dist > p_ptr->current_floor_ptr->grid_array[fy][fx].dist + 2 * d) continue;
+                               if (g_ptr->dist > floor_ptr->grid_array[fy][fx].dist + 2 * d) continue;
                        }
 
                        /* Check for absence of shot (more or less) */
-                       if (!projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, y, x))
+                       if (!projectable(target_ptr, target_ptr->y, target_ptr->x, y, x))
                        {
                                /* Calculate distance from player */
-                               dis = distance(y, x, p_ptr->y, p_ptr->x);
+                               dis = distance(y, x, target_ptr->y, target_ptr->x);
 
                                /* Remember if further than previous */
                                if (dis > gdis)
@@ -836,7 +843,7 @@ static bool find_hiding(player_type *target_ptr, MONSTER_IDX m_idx, POSITION *yp
                        if (!monster_can_enter(y, x, r_ptr, 0)) continue;
 
                        /* Check for hidden, available grid */
-                       if (!projectable(floor_ptr, target_ptr->y, target_ptr->x, y, x) && clean_shot(target_ptr, fy, fx, y, x, FALSE))
+                       if (!projectable(target_ptr, target_ptr->y, target_ptr->x, y, x) && clean_shot(target_ptr, fy, fx, y, x, FALSE))
                        {
                                /* Calculate distance from player */
                                dis = distance(y, x, target_ptr->y, target_ptr->x);
@@ -899,8 +906,8 @@ static bool get_moves(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
                /* The monster must be an enemy, and in LOS */
                if (t_m_idx &&
                    are_enemies(m_ptr, &floor_ptr->m_list[t_m_idx]) &&
-                   los(floor_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) &&
-                   projectable(floor_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+                   los(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) &&
+                   projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
                {
                        /* Extract the "pseudo-direction" */
                        y = m_ptr->fy - m_ptr->target_y;
@@ -911,7 +918,7 @@ static bool get_moves(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
 
        if (!done && !will_run && is_hostile(m_ptr) &&
            (r_ptr->flags1 & RF1_FRIENDS) &&
-           ((los(floor_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x) && projectable(floor_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x)) ||
+           ((los(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x)) ||
            (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
        {
        /*
@@ -994,7 +1001,7 @@ static bool get_moves(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
        if (!done)
        {
                /* Flow towards the player */
-               (void)get_moves_aux(m_idx, &y2, &x2, no_flow);
+               (void)get_moves_aux(target_ptr, m_idx, &y2, &x2, no_flow);
 
                /* Extract the "pseudo-direction" */
                y = m_ptr->fy - y2;
@@ -1017,7 +1024,7 @@ static bool get_moves(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
                        int tmp_y = (-y);
 
                        /* Try to find safe place */
-                       if (find_safety(m_idx, &y, &x))
+                       if (find_safety(target_ptr, m_idx, &y, &x))
                        {
                                /* Attempt to avoid the player */
                                if (!no_flow)
@@ -1402,7 +1409,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                if (see_m)
                                {
                                        if ((r_ptr->flags2 & RF2_CAN_SPEAK) && (m_ptr->r_idx != MON_GRIP) && (m_ptr->r_idx != MON_WOLF) && (m_ptr->r_idx != MON_FANG) &&
-                                           player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x))
+                                           player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x))
                                        {
                                                msg_format(_("%^s「ピンチだ!退却させてもらう!」", "%^s says 'It is the pinch! I will retreat'."), m_name);
                                        }
@@ -1570,7 +1577,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                if ((ap_r_ptr->flags2 & RF2_CAN_SPEAK) && aware &&
                    one_in_(SPEAK_CHANCE) &&
                    player_has_los_bold(target_ptr, oy, ox) &&
-                   projectable(target_ptr->current_floor_ptr, oy, ox, target_ptr->y, target_ptr->x))
+                   projectable(target_ptr, oy, ox, target_ptr->y, target_ptr->x))
                {
                        GAME_TEXT m_name[MAX_NLEN];
                        char monmessage[1024];
@@ -1612,7 +1619,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
 
                        /* The monster must be an enemy, and projectable */
                        if (t_m_idx && are_enemies(m_ptr, &target_ptr->current_floor_ptr->m_list[t_m_idx]) &&
-                           projectable(target_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+                           projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
                        {
                                counterattack = TRUE;
                        }
@@ -1711,7 +1718,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                mm[0] = mm[1] = mm[2] = mm[3] = 5;
 
                /* Look for an enemy */
-               if (!get_enemy_dir(m_idx, mm))
+               if (!get_enemy_dir(target_ptr, m_idx, mm))
                {
                        /* Find the player if necessary */
                        if (avoid || lonely || distant)
@@ -1741,7 +1748,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                mm[0] = mm[1] = mm[2] = mm[3] = 5;
 
                /* Look for an enemy */
-               get_enemy_dir(m_idx, mm);
+               get_enemy_dir(target_ptr, m_idx, mm);
        }
        /* Normal movement */
        else
@@ -2211,7 +2218,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        /* Possible disturb */
                        if (m_ptr->ml &&
                            (disturb_move ||
-                            (disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(target_ptr->current_floor_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)) ||
+                            (disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(target_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)) ||
                             (disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= target_ptr->lev)))
                        {
                                if (is_hostile(m_ptr))
index c563b26..0363620 100644 (file)
@@ -307,8 +307,8 @@ extern const concptr monster_powers_short[MAX_MONSPELLS];
 
 /* mspells1.c */
 extern bool clean_shot(player_type *target_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, bool is_friend);
-extern bool summon_possible(floor_type *floor_ptr, POSITION y1, POSITION x1);
-extern bool raise_possible(floor_type *floor_ptr, monster_type *m_ptr);
+extern bool summon_possible(player_type *target_ptr, POSITION y1, POSITION x1);
+extern bool raise_possible(player_type *target_ptr, monster_type *m_ptr);
 extern bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx);
 extern bool spell_is_inate(SPELL_IDX spell);
 extern bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr);
@@ -317,7 +317,7 @@ extern void bolt(player_type *target_ptr, MONSTER_IDX m_idx, POSITION y, POSITIO
 extern void breath(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type);
 
 /* mspells2.c */
-extern void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
+extern void get_project_point(player_type *target_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg);
 extern bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx);
 
 /* mspells3.c */
index 79269a1..9fee04d 100644 (file)
@@ -840,7 +840,7 @@ bool set_monster_timewalk(player_type *target_ptr, int num, MONSTER_IDX who, boo
        target_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        current_world_ptr->timewalk_m_idx = 0;
-       if (vs_player || (player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr->current_floor_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)))
+       if (vs_player || (player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr, target_ptr->y, target_ptr->x, m_ptr->fy, m_ptr->fx)))
        {
                msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
                msg_print(NULL);
index c53dae6..123a5db 100644 (file)
@@ -2752,7 +2752,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
 
                                do
                                {
-                                       scatter(floor_ptr, &wy, &wx, y, x, 20, 0);
+                                       scatter(p_ptr, &wy, &wx, y, x, 20, 0);
                                } while (!(in_bounds(floor_ptr, wy, wx) && cave_empty_bold2(floor_ptr, wy, wx)) && --attempts);
 
                                if (attempts > 0)
index baca5a2..a6a4eb6 100644 (file)
@@ -2112,7 +2112,7 @@ void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
                        }
 
                        /* Disturb on appearance */
-                       if (disturb_near && (projectable(subject_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, subject_ptr->y, subject_ptr->x) && projectable(subject_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x, m_ptr->fy, m_ptr->fx)))
+                       if (disturb_near && (projectable(subject_ptr, m_ptr->fy, m_ptr->fx, subject_ptr->y, subject_ptr->x) && projectable(subject_ptr, subject_ptr->y, subject_ptr->x, m_ptr->fy, m_ptr->fx)))
                        {
                                if (disturb_pets || is_hostile(m_ptr))
                                        disturb(subject_ptr, TRUE, TRUE);
@@ -2892,7 +2892,7 @@ static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION
                        if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
 
                        /* Require "line of projection" */
-                       if (!projectable(p_ptr->current_floor_ptr, y, x, ny, nx)) continue;
+                       if (!projectable(p_ptr, y, x, ny, nx)) continue;
 
                        if (r_idx > 0)
                        {
@@ -3008,7 +3008,7 @@ static bool place_monster_group(MONSTER_IDX who, POSITION y, POSITION x, MONRACE
                {
                        POSITION mx, my;
 
-                       scatter(p_ptr->current_floor_ptr, &my, &mx, hy, hx, 4, 0);
+                       scatter(p_ptr, &my, &mx, hy, hx, 4, 0);
 
                        /* Walls and Monsters block flow */
                        if (!cave_empty_bold2(p_ptr->current_floor_ptr, my, mx)) continue;
@@ -3133,7 +3133,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                for(j = 0; j < n; j++)
                {
                        POSITION nx, ny, d = 7;
-                       scatter(p_ptr->current_floor_ptr, &ny, &nx, y, x, d, 0);
+                       scatter(p_ptr, &ny, &nx, y, x, d, 0);
                        (void)place_monster_one(place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
                }
        }
@@ -3158,7 +3158,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                        MONRACE_IDX z; 
 
                        /* Pick a location */
-                       scatter(p_ptr->current_floor_ptr, &ny, &nx, y, x, d, 0);
+                       scatter(p_ptr, &ny, &nx, y, x, d, 0);
 
                        /* Require empty grids */
                        if (!cave_empty_bold2(p_ptr->current_floor_ptr, ny, nx)) continue;
@@ -3260,7 +3260,7 @@ bool alloc_horde(POSITION y, POSITION x)
 
        for (attempts = randint1(10) + 5; attempts; attempts--)
        {
-               scatter(p_ptr->current_floor_ptr, &cy, &cx, y, x, 5, 0);
+               scatter(p_ptr, &cy, &cx, y, x, 5, 0);
 
                (void)summon_specific(m_idx, cy, cx, p_ptr->current_floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
 
index aecb49a..de3d44c 100644 (file)
@@ -369,16 +369,17 @@ static void remove_bad_spells(MONSTER_IDX m_idx, player_type *target_ptr, u32b *
 /*!
  * @brief モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 /
  * Determine if there is a space near the player in which a summoned creature can appear
- * @param floor_ptr 現在フロアへの参照ポインタ
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param y1 判定を行いたいマスのY座標
  * @param x1 判定を行いたいマスのX座標
  * @return 召還に相応しいならばTRUEを返す
  */
-bool summon_possible(floor_type *floor_ptr, POSITION y1, POSITION x1)
+bool summon_possible(player_type *target_ptr, POSITION y1, POSITION x1)
 {
        POSITION y, x;
 
        /* Start at the player's location, and check 2 grids in each dir */
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
        for (y = y1 - 2; y <= y1 + 2; y++)
        {
                for (x = x1 - 2; x <= x1 + 2; x++)
@@ -393,7 +394,7 @@ bool summon_possible(floor_type *floor_ptr, POSITION y1, POSITION x1)
                        if (pattern_tile(y, x)) continue;
 
                        /* Require empty floor grid in line of projection */
-                       if (cave_empty_bold(floor_ptr, y, x) && projectable(floor_ptr, y1, x1, y, x) && projectable(floor_ptr, y, x, y1, x1)) return TRUE;
+                       if (cave_empty_bold(floor_ptr, y, x) && projectable(target_ptr, y1, x1, y, x) && projectable(target_ptr, y, x, y1, x1)) return TRUE;
                }
        }
 
@@ -404,22 +405,23 @@ bool summon_possible(floor_type *floor_ptr, POSITION y1, POSITION x1)
 /*!
  * @brief モンスターにとって死者復活を行うべき状態かどうかを返す /
  * Determine if there is a space near the player in which a summoned creature can appear
- * @param floor_type 現在フロアへの参照ポインタ
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param m_ptr 判定を行いたいモンスターの構造体参照ポインタ
  * @return 死者復活が有効な状態ならばTRUEを返す。
  */
-bool raise_possible(floor_type *floor_ptr, monster_type *m_ptr)
+bool raise_possible(player_type *target_ptr, monster_type *m_ptr)
 {
        POSITION y = m_ptr->fy;
        POSITION x = m_ptr->fx;
+       floor_type *floor_ptr = target_ptr->current_floor_ptr;
        for (POSITION xx = x - 5; xx <= x + 5; xx++)
        {
                grid_type *g_ptr;
                for (POSITION yy = y - 5; yy <= y + 5; yy++)
                {
                        if (distance(y, x, yy, xx) > 5) continue;
-                       if (!los(floor_ptr, y, x, yy, xx)) continue;
-                       if (!projectable(floor_ptr, y, x, yy, xx)) continue;
+                       if (!los(target_ptr, y, x, yy, xx)) continue;
+                       if (!projectable(target_ptr, y, x, yy, xx)) continue;
 
                        g_ptr = &floor_ptr->grid_array[yy][xx];
                        /* Scan the pile of objects */
@@ -467,7 +469,7 @@ bool clean_shot(player_type *target_ptr, POSITION y1, POSITION x1, POSITION y2,
        /* Check the projection path */
        floor_type *floor_ptr = target_ptr->current_floor_ptr;
        u16b grid_g[512];
-       int grid_n = grid_n = project_path(floor_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
+       int grid_n = grid_n = project_path(target_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, 0);
 
        /* No grid is ever projectable from itself */
        if (!grid_n) return FALSE;
@@ -1237,7 +1239,7 @@ bool spell_is_inate(SPELL_IDX spell)
  * @return 有効な座標があった場合TRUEを返す
  */
 static bool adjacent_grid_check(player_type *target_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp,
-       int f_flag, bool (*path_check)(floor_type *, POSITION, POSITION, POSITION, POSITION))
+       int f_flag, bool (*path_check)(player_type *, POSITION, POSITION, POSITION, POSITION))
 {
        static int tonari_y[4][8] = {{-1, -1, -1,  0,  0,  1,  1,  1},
                                             {-1, -1, -1,  0,  0,  1,  1,  1},
@@ -1267,7 +1269,7 @@ static bool adjacent_grid_check(player_type *target_ptr, monster_type *m_ptr, PO
                /* Skip this feature */
                if (!cave_have_flag_grid(g_ptr, f_flag)) continue;
 
-               if (path_check(floor_ptr, m_ptr->fy, m_ptr->fx, next_y, next_x))
+               if (path_check(target_ptr, m_ptr->fy, m_ptr->fx, next_y, next_x))
                {
                        *yp = next_y;
                        *xp = next_x;
@@ -1385,7 +1387,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
                y_br_lite = y;
                x_br_lite = x;
 
-               if (los(floor_ptr, m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
+               if (los(target_ptr, m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
                {
                        feature_type *f_ptr = &f_info[floor_ptr->grid_array[y_br_lite][x_br_lite].feat];
 
@@ -1408,7 +1410,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
 
        /* Check path */
        bool do_spell = DO_SPELL_NONE;
-       if (projectable(floor_ptr, m_ptr->fy, m_ptr->fx, y, x))
+       if (projectable(target_ptr, m_ptr->fy, m_ptr->fx, y, x))
        {
                feature_type *f_ptr = &f_info[floor_ptr->grid_array[y][x].feat];
 
@@ -1429,13 +1431,13 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
 
                if ((f4 & RF4_BR_DISI) && (m_ptr->cdis < MAX_RANGE/2) &&
                    in_disintegration_range(floor_ptr, m_ptr->fy, m_ptr->fx, y, x) &&
-                   (one_in_(10) || (projectable(floor_ptr, y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
+                   (one_in_(10) || (projectable(target_ptr, y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
                {
                        do_spell = DO_SPELL_BR_DISI;
                        success = TRUE;
                }
                else if ((f4 & RF4_BR_LITE) && (m_ptr->cdis < MAX_RANGE/2) &&
-                   los(floor_ptr, m_ptr->fy, m_ptr->fx, y, x) && one_in_(5))
+                   los(target_ptr, m_ptr->fy, m_ptr->fx, y, x) && one_in_(5))
                {
                        do_spell = DO_SPELL_BR_LITE;
                        success = TRUE;
@@ -1443,8 +1445,8 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
                else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE))
                {
                        POSITION by = y, bx = x;
-                       get_project_point(floor_ptr, m_ptr->fy, m_ptr->fx, &by, &bx, 0L);
-                       if ((distance(by, bx, y, x) <= 3) && los(floor_ptr, by, bx, y, x) && one_in_(5))
+                       get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &by, &bx, 0L);
+                       if ((distance(by, bx, y, x) <= 3) && los(target_ptr, by, bx, y, x) && one_in_(5))
                        {
                                do_spell = DO_SPELL_BA_LITE;
                                success = TRUE;
@@ -1575,7 +1577,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
                if (((f4 & RF4_SUMMON_MASK) ||
                     (f5 & RF5_SUMMON_MASK) ||
                     (f6 & RF6_SUMMON_MASK)) &&
-                   !(summon_possible(floor_ptr, y, x)))
+                   !(summon_possible(target_ptr, y, x)))
                {
                        /* Remove summoning spells */
                        f4 &= ~(RF4_SUMMON_MASK);
@@ -1584,7 +1586,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
                }
 
                /* Check for a possible raise dead */
-               if ((f6 & RF6_RAISE_DEAD) && !raise_possible(floor_ptr, m_ptr))
+               if ((f6 & RF6_RAISE_DEAD) && !raise_possible(target_ptr, m_ptr))
                {
                        /* Remove raise dead spell */
                        f6 &= ~(RF6_RAISE_DEAD);
@@ -1593,7 +1595,7 @@ bool make_attack_spell(MONSTER_IDX m_idx, player_type *target_ptr)
                /* Special moves restriction */
                if (f6 & RF6_SPECIAL)
                {
-                       if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(floor_ptr, y, x))
+                       if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(target_ptr, y, x))
                        {
                                f6 &= ~(RF6_SPECIAL);
                        }
index 0730ef4..326c4f0 100644 (file)
@@ -45,7 +45,7 @@ static bool direct_beam(player_type *target_ptr, POSITION y1, POSITION x1, POSIT
        /* Check the projection path */
        floor_type *floor_ptr = target_ptr->current_floor_ptr;
        u16b grid_g[512];
-       int grid_n = project_path(floor_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, PROJECT_THRU);
+       int grid_n = project_path(target_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, PROJECT_THRU);
 
        /* No grid is ever projectable from itself */
        if (!grid_n) return FALSE;
@@ -107,7 +107,7 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
 
        /* Check the projection path */
        u16b grid_g[512];
-       int grid_n = project_path(master_ptr->current_floor_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
+       int grid_n = project_path(master_ptr, grid_g, MAX_RANGE, y1, x1, y2, x2, flg);
 
        /* Project along the path */
        int i;
@@ -152,13 +152,13 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
                }
                else if (flg & PROJECT_LOS)
                {
-                       if (los(master_ptr->current_floor_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
-                       if (los(master_ptr->current_floor_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
+                       if (los(master_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
+                       if (los(master_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
                }
                else
                {
-                       if (projectable(master_ptr->current_floor_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
-                       if (projectable(master_ptr->current_floor_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
+                       if (projectable(master_ptr, y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
+                       if (projectable(master_ptr, y1, x1, master_ptr->y, master_ptr->x) && (distance(y1, x1, master_ptr->y, master_ptr->x) <= rad)) hityou = TRUE;
                }
        }
        else
@@ -167,7 +167,7 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
                POSITION gx[1024], gy[1024];
                POSITION gm[32];
                POSITION gm_rad = rad;
-               breath_shape(master_ptr->current_floor_ptr, grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y, x, typ);
+               breath_shape(master_ptr, grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y, x, typ);
 
                for (i = 0; i < grids; i++)
                {
@@ -188,6 +188,7 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
 /*!
  * @brief モンスターが特殊能力の目標地点を決める処理 /
  * Get the actual center point of ball spells (rad > 1) (originally from TOband)
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param sy 始点のY座標
  * @param sx 始点のX座標
  * @param ty 目標Y座標を返す参照ポインタ
@@ -195,10 +196,10 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
  * @param flg 判定のフラグ配列
  * @return なし
  */
-void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
+void get_project_point(player_type *target_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
 {
        u16b path_g[128];
-       int path_n = project_path(floor_ptr, path_g, MAX_RANGE, sy, sx, *ty, *tx, flg);
+       int path_n = project_path(target_ptr, path_g, MAX_RANGE, sy, sx, *ty, *tx, flg);
 
        *ty = sy;
        *tx = sx;
@@ -210,7 +211,7 @@ void get_project_point(floor_type *floor_ptr, POSITION sy, POSITION sx, POSITION
                sx = GRID_X(path_g[i]);
 
                /* Hack -- Balls explode before reaching walls */
-               if (!cave_have_flag_bold(floor_ptr, sy, sx, FF_PROJECT)) break;
+               if (!cave_have_flag_bold(target_ptr->current_floor_ptr, sy, sx, FF_PROJECT)) break;
 
                *ty = sy;
                *tx = sx;
@@ -301,7 +302,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                t_ptr = &floor_ptr->m_list[target_idx];
 
                /* Cancel if not projectable (for now) */
-               if ((m_idx == target_idx) || !projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+               if ((m_idx == target_idx) || !projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
                {
                        target_idx = 0;
                }
@@ -324,7 +325,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                        }
 
                        /* Allow only summoning etc.. if not projectable */
-                       else if (!projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+                       else if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
                        {
                                f4 &= (RF4_INDIRECT_MASK);
                                f5 &= (RF5_INDIRECT_MASK);
@@ -360,7 +361,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                        if ((m_idx == target_idx) || !are_enemies(m_ptr, t_ptr)) continue;
 
                        /* Monster must be projectable */
-                       if (!projectable(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
+                       if (!projectable(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
 
                        /* Get it */
                        success = TRUE;
@@ -383,7 +384,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
 
        if (f4 & RF4_BR_LITE)
        {
-               if (!los(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+               if (!los(target_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
                        f4 &= ~(RF4_BR_LITE);
        }
 
@@ -472,9 +473,9 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                                POSITION real_y = y;
                                POSITION real_x = x;
 
-                               get_project_point(floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
+                               get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
 
-                               if (projectable(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
+                               if (projectable(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
                                {
                                        int dist = distance(real_y, real_x, target_ptr->y, target_ptr->x);
 
@@ -493,7 +494,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                                }
                                else if (f5 & RF5_BA_LITE)
                                {
-                                       if ((distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 4) && los(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
+                                       if ((distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 4) && los(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x))
                                                f5 &= ~(RF5_BA_LITE);
                                }
                        }
@@ -503,8 +504,8 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                                POSITION real_y = y;
                                POSITION real_x = x;
 
-                               get_project_point(floor_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
-                               if (projectable(floor_ptr, real_y, real_x, target_ptr->y, target_ptr->x) && (distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 2))
+                               get_project_point(target_ptr, m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
+                               if (projectable(target_ptr, real_y, real_x, target_ptr->y, target_ptr->x) && (distance(real_y, real_x, target_ptr->y, target_ptr->x) <= 2))
                                        f4 &= ~(RF4_ROCKET);
                        }
 
@@ -576,7 +577,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                if (((f4 & RF4_SUMMON_MASK) ||
                     (f5 & RF5_SUMMON_MASK) ||
                     (f6 & RF6_SUMMON_MASK)) &&
-                   !(summon_possible(floor_ptr, t_ptr->fy, t_ptr->fx)))
+                   !(summon_possible(target_ptr, t_ptr->fy, t_ptr->fx)))
                {
                        /* Remove summoning spells */
                        f4 &= ~(RF4_SUMMON_MASK);
@@ -592,7 +593,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                }
 
                /* Check for a possible raise dead */
-               if ((f6 & RF6_RAISE_DEAD) && !raise_possible(floor_ptr, m_ptr))
+               if ((f6 & RF6_RAISE_DEAD) && !raise_possible(target_ptr, m_ptr))
                {
                        /* Remove raise dead spell */
                        f6 &= ~(RF6_RAISE_DEAD);
@@ -601,7 +602,7 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
                /* Special moves restriction */
                if (f6 & RF6_SPECIAL)
                {
-                       if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(floor_ptr, t_ptr->fy, t_ptr->fx))
+                       if ((m_ptr->r_idx == MON_ROLENTO) && !summon_possible(target_ptr, t_ptr->fy, t_ptr->fx))
                        {
                                f6 &= ~(RF6_SPECIAL);
                        }
index 30402d9..842644d 100644 (file)
@@ -878,12 +878,12 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                m_idx = floor_ptr->grid_array[target_row][target_col].m_idx;
                if (!m_idx) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                dispel_monster_status(m_idx);
                break;
        }
        case MS_ROCKET:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                
         msg_print(_("ロケットを発射した。", "You fire a rocket."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_ROCKET), plev, DAM_ROLL);
@@ -891,7 +891,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                break;
        case MS_SHOOT:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                
         msg_print(_("矢を放った。", "You fire an arrow."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_SHOOT), plev, DAM_ROLL);
@@ -905,377 +905,377 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_XXX4:
                break;
        case MS_BR_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_ACID), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_ACID, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_ELEC:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_ELEC), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_ELEC, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_FIRE), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_FIRE, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_COLD:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_COLD), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_COLD, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_POIS:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_POIS), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_POIS, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_NETHER:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NETHER), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_NETHER, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_LITE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_LITE), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_LITE, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_DARK:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DARK), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_DARK, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_CONF:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_CONF), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_CONFUSION, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_SOUND:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_SOUND), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_SOUND, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_CHAOS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_CHAOS), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_CHAOS, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_DISEN:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DISEN), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_DISENCHANT, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_NEXUS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NEXUS), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_NEXUS, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_TIME:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_TIME), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_TIME, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_INERTIA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_INERTIA), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_INERTIAL, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_GRAVITY:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_GRAVITY), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_GRAVITY, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_SHARDS:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_SHARDS), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_SHARDS, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_PLASMA:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_PLASMA), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_PLASMA, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_FORCE:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_FORCE), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_FORCE, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BR_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_MANA), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_MANA, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BALL_NUKE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_NUKE), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_NUKE, dir, damage, 2);
                break;
        case MS_BR_NUKE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NUKE), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_NUKE, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BALL_CHAOS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_CHAOS), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_CHAOS, dir, damage, 4);
                break;
        case MS_BR_DISI:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DISI), plev, DAM_ROLL);
                fire_breath(caster_ptr, GF_DISINTEGRATE, dir, damage, (plev > 40 ? 3 : 2));
                break;
        case MS_BALL_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_ACID), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_ACID, dir, damage, 2);
                break;
        case MS_BALL_ELEC:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_ELEC), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_ELEC, dir, damage, 2);
                break;
        case MS_BALL_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_FIRE), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_FIRE, dir, damage, 2);
                break;
        case MS_BALL_COLD:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_COLD), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_COLD, dir, damage, 2);
                break;
        case MS_BALL_POIS:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_POIS), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_POIS, dir, damage, 2);
                break;
        case MS_BALL_NETHER:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_NETHER), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_NETHER, dir, damage, 2);
                break;
        case MS_BALL_WATER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_WATER), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_WATER, dir, damage, 4);
                break;
        case MS_BALL_MANA:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_MANA), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_MANA, dir, damage, 4);
                break;
        case MS_BALL_DARK:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_DARK), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_DARK, dir, damage, 4);
                break;
        case MS_DRAIN_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_DRAIN_MANA), plev, DAM_ROLL);
         fire_ball_hide(caster_ptr, GF_DRAIN_MANA, dir, damage, 0);
                break;
        case MS_MIND_BLAST:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_MIND_BLAST), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_MIND_BLAST, dir, damage, 0);
                break;
        case MS_BRAIN_SMASH:
-        if (!get_aim_dir(&dir)) return FALSE;
+        if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_BRAIN_SMASH), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_BRAIN_SMASH, dir, damage, 0);
                break;
        case MS_CAUSE_1:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_1), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_CAUSE_1, dir, damage, 0);
                break;
        case MS_CAUSE_2:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_2), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_CAUSE_2, dir, damage, 0);
                break;
        case MS_CAUSE_3:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_3), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_CAUSE_3, dir, damage, 0);
                break;
        case MS_CAUSE_4:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_4), plev, DAM_ROLL);
                fire_ball_hide(caster_ptr, GF_CAUSE_4, dir, damage, 0);
                break;
        case MS_BOLT_ACID:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ACID), plev, DAM_ROLL);
         fire_bolt(caster_ptr, GF_ACID, dir, damage);
                break;
        case MS_BOLT_ELEC:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ELEC), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_ELEC, dir, damage);
                break;
        case MS_BOLT_FIRE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_FIRE), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_FIRE, dir, damage);
                break;
        case MS_BOLT_COLD:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_COLD), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_COLD, dir, damage);
                break;
        case MS_STARBURST:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_STARBURST), plev, DAM_ROLL);
                fire_ball(caster_ptr, GF_LITE, dir, damage, 4);
                break;
        case MS_BOLT_NETHER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_NETHER), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_NETHER, dir, damage);
                break;
        case MS_BOLT_WATER:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_WATER), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_WATER, dir, damage);
                break;
        case MS_BOLT_MANA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_MANA), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_MANA, dir, damage);
                break;
        case MS_BOLT_PLASMA:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_PLASMA), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_PLASMA, dir, damage);
                break;
        case MS_BOLT_ICE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ICE), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_ICE, dir, damage);
                break;
        case MS_MAGIC_MISSILE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_MAGIC_MISSILE), plev, DAM_ROLL);
                fire_bolt(caster_ptr, GF_MISSILE, dir, damage);
                break;
        case MS_SCARE:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
                fear_monster(caster_ptr, dir, plev+10);
                break;
        case MS_BLIND:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                confuse_monster(caster_ptr, dir, plev * 2);
                break;
        case MS_CONF:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
                confuse_monster(caster_ptr, dir, plev * 2);
                break;
        case MS_SLOW:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                slow_monster(caster_ptr, dir, plev);
                break;
        case MS_SLEEP:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
                sleep_monster(caster_ptr, dir, plev);
                break;
        case MS_SPEED:
@@ -1283,7 +1283,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                break;
        case MS_HAND_DOOM:
        {
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
                fire_ball_hide(caster_ptr, GF_HAND_DOOM, dir, plev * 3, 0);
@@ -1319,7 +1319,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                if (!floor_ptr->grid_array[target_row][target_col].m_idx) break;
                if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
-               if (!projectable(floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
+               if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
                m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[target_row][target_col].m_idx];
                r_ptr = &r_info[m_ptr->r_idx];
                monster_desc(m_name, m_ptr, 0);
@@ -1344,7 +1344,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                break;
        }
        case MS_TELE_AWAY:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
                (void)fire_beam(caster_ptr, GF_AWAY_ALL, dir, 100);
                break;
@@ -1354,7 +1354,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                break;
 
        case MS_PSY_SPEAR:
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
         msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
         damage = monspell_bluemage_damage(caster_ptr, (MS_PSY_SPEAR), plev, DAM_ROLL);
index f23f793..3675892 100644 (file)
@@ -2087,7 +2087,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                dummy_hp = (m_ptr->hp + 1) / 2;
                dummy_maxhp = m_ptr->maxhp / 2;
 
-               if (floor_ptr->inside_arena || target_ptr->phase_out || !summon_possible(floor_ptr, m_ptr->fy, m_ptr->fx))
+               if (floor_ptr->inside_arena || target_ptr->phase_out || !summon_possible(target_ptr, m_ptr->fy, m_ptr->fx))
                        return -1;
 
                delete_monster_idx(floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
@@ -3379,12 +3379,12 @@ MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MO
        int count = 0;
        for (int k = 0; k < 30; k++)
        {
-               if (!summon_possible(floor_ptr, cy, cx) || !cave_empty_bold(floor_ptr, cy, cx))
+               if (!summon_possible(target_ptr, cy, cx) || !cave_empty_bold(floor_ptr, cy, cx))
                {
                        int j;
                        for (j = 100; j > 0; j--)
                        {
-                               scatter(floor_ptr, &cy, &cx, y, x, 2, 0);
+                               scatter(target_ptr, &cy, &cx, y, x, 2, 0);
                                if (cave_empty_bold(floor_ptr, cy, cx)) break;
                        }
 
index 1316b91..16f0af2 100644 (file)
@@ -2094,27 +2094,27 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
        switch (power)
        {
                case MUT1_SPIT_ACID:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("酸を吐きかけた...", "You spit acid..."));
                        fire_ball(creature_ptr, GF_ACID, dir, lvl, 1 + (lvl / 30));
                        break;
 
                case MUT1_BR_FIRE:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire..."));
                        fire_breath(creature_ptr, GF_FIRE, dir, lvl * 2, 1 + (lvl / 20));
                        break;
 
                case MUT1_HYPN_GAZE:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("あなたの目は幻惑的になった...", "Your eyes look mesmerizing..."));
                        (void)charm_monster(creature_ptr, dir, lvl);
                        break;
 
                case MUT1_TELEKINES:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("集中している...", "You concentrate..."));
                        fetch(creature_ptr, dir, lvl * 10, TRUE);
                        break;
@@ -2125,7 +2125,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_MIND_BLST:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("集中している...", "You concentrate..."));
                        fire_bolt(creature_ptr, GF_PSI, dir, damroll(3 + ((lvl - 1) / 5), 3));
                        break;
@@ -2159,7 +2159,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
 
                case MUT1_SWAP_POS:
                        project_length = -1;
-                       if (!get_aim_dir(&dir))
+                       if (!get_aim_dir(creature_ptr, &dir))
                        {
                                project_length = 0;
                                return FALSE;
@@ -2280,7 +2280,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_LASER_EYE:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        fire_beam(creature_ptr, GF_LITE, dir, 2 * lvl);
                        break;
 
index 0c6c48b..4e37fac 100644 (file)
@@ -4196,7 +4196,7 @@ bool make_gold(floor_type *floor_ptr, object_type *j_ptr)
  * the object can combine, stack, or be placed.  Artifacts will try very\n
  * hard to be placed, including "teleporting" to a useful grid if needed.\n
  */
-OBJECT_IDX drop_near(player_type *owner_type, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
+OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
 {
        int i, k, d, s;
 
@@ -4248,7 +4248,7 @@ OBJECT_IDX drop_near(player_type *owner_type, object_type *j_ptr, PERCENTAGE cha
        /* Default */
        by = y;
        bx = x;
-       floor_type *floor_ptr = owner_type->current_floor_ptr;
+       floor_type *floor_ptr = owner_ptr->current_floor_ptr;
        /* Scan local grids */
        for (dy = -3; dy <= 3; dy++)
        {
@@ -4269,7 +4269,7 @@ OBJECT_IDX drop_near(player_type *owner_type, object_type *j_ptr, PERCENTAGE cha
                        if (!in_bounds(floor_ptr, ty, tx)) continue;
 
                        /* Require line of projection */
-                       if (!projectable(floor_ptr, y, x, ty, tx)) continue;
+                       if (!projectable(owner_ptr, y, x, ty, tx)) continue;
 
                        /* Obtain grid */
                        g_ptr = &floor_ptr->grid_array[ty][tx];
@@ -4493,7 +4493,7 @@ OBJECT_IDX drop_near(player_type *owner_type, object_type *j_ptr, PERCENTAGE cha
 
        /* Mega-Hack -- no message if "dropped" by player */
        /* Message when an object falls under the player */
-       if (chance && player_bold(owner_type, by, bx))
+       if (chance && player_bold(owner_ptr, by, bx))
        {
                msg_print(_("何かが足下に転がってきた。", "You feel something roll beneath your feet."));
        }
index 04811d9..197402c 100644 (file)
@@ -5191,7 +5191,7 @@ void wreck_the_pattern(player_type *creature_ptr)
 
        while (to_ruin--)
        {
-               scatter(floor_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
+               scatter(creature_ptr, &r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
 
                if (pattern_tile(r_y, r_x) &&
                        (f_info[floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
index dc00339..593d3bf 100644 (file)
@@ -282,7 +282,7 @@ void check_quest_completion(player_type *player_ptr, monster_type *m_ptr)
                while (cave_perma_bold(floor_ptr, y, x) || floor_ptr->grid_array[y][x].o_idx || (floor_ptr->grid_array[y][x].info & CAVE_OBJECT))
                {
                        /* Pick a location */
-                       scatter(floor_ptr, &ny, &nx, y, x, 1, 0);
+                       scatter(player_ptr, &ny, &nx, y, x, 1, 0);
 
                        /* Stagger */
                        y = ny; x = nx;
index 84f0580..03b39c2 100644 (file)
@@ -440,7 +440,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                }
                case CLASS_PALADIN:
                {
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        fire_beam(creature_ptr, is_good_realm(creature_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE,
                                  dir, plev * 3);
                        break;
@@ -495,7 +495,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (command == -3)
                        {
-                               if (!get_aim_dir(&dir)) return FALSE;
+                               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                                project_length = 1;
                                fire_beam(creature_ptr, GF_PHOTO, dir, 1);
                        }
@@ -515,7 +515,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                {
                        if (command == -3)
                        {
-                               if (!get_aim_dir(&dir)) return FALSE;
+                               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                                (void)fire_ball_hide(creature_ptr, GF_CHARM_LIVING, dir, creature_ptr->lev, 0);
                        }
                        else if (command == -4)
@@ -701,7 +701,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_HALF_GIANT:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
                        break;
 
@@ -711,20 +711,20 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_CYCLOPS:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("巨大な岩を投げた。", "You throw a huge boulder."));
                        fire_bolt(creature_ptr, GF_MISSILE, dir, (3 * plev) / 2);
                        break;
 
                case RACE_YEEK:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
                        (void)fear_monster(creature_ptr, dir, plev);
                        break;
 
                case RACE_KLACKON:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("酸を吐いた。", "You spit acid."));
                        if (plev < 25) fire_bolt(creature_ptr, GF_ACID, dir, plev);
@@ -732,7 +732,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_KOBOLD:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("毒のダーツを投げた。", "You throw a dart of poison."));
                        fire_bolt(creature_ptr, GF_POIS, dir, plev);
                        break;
@@ -745,7 +745,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_DARK_ELF:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
                        fire_bolt_or_beam(creature_ptr, 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4));
                        break;
@@ -755,13 +755,13 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_MIND_FLAYER:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red..."));
                        fire_bolt(creature_ptr, GF_PSI, dir, plev);
                        break;
 
                case RACE_IMP:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        if (plev >= 30)
                        {
                                msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire."));
@@ -789,7 +789,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        break;
 
                case RACE_SPECTRE:
-                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
                        stop_mouth(creature_ptr);
                        msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
                        (void)fear_monster(creature_ptr, dir, plev);
index 4dfe05b..8aaae4e 100644 (file)
@@ -45,7 +45,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
                        }
@@ -59,7 +59,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                wizard_lock(caster_ptr, dir);
                        }
@@ -139,7 +139,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                destroy_door(caster_ptr, dir);
                        }
@@ -371,7 +371,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                wall_to_mud(caster_ptr, dir, 20 + randint1(30));
                        }
@@ -390,7 +390,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                msg_print(_("光線が放たれた。", "A line of light appears."));
                                lite_line(caster_ptr, dir, damroll(6, 8));
@@ -464,7 +464,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
                        }
@@ -485,7 +485,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                int type;
 
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                switch (randint1(4))
                                {
index d1982cf..2b7bcc6 100644 (file)
@@ -44,7 +44,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides));
                        }
@@ -122,7 +122,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_MISSILE, dir, damroll(dice, sides) + base, rad);
 
@@ -147,7 +147,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir, damroll(dice, sides));
                        }
@@ -166,7 +166,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_DISINTEGRATE, dir, damroll(dice, sides), 0);
                        }
@@ -199,7 +199,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        if (cast)
                        {
 
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                cast_wonder(caster_ptr, dir);
                        }
@@ -218,7 +218,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_CHAOS, dir, damroll(dice, sides));
                        }
@@ -255,7 +255,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_MANA, dir, damroll(dice, sides));
                        }
@@ -274,7 +274,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_FIRE, dir, dam, rad);
                        }
@@ -292,7 +292,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
                        }
@@ -326,7 +326,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_CHAOS, dir, dam, rad);
                        }
@@ -344,7 +344,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                poly_monster(caster_ptr, dir, plev);
                        }
@@ -396,7 +396,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_DISINTEGRATE, dir, dam, rad);
                        }
@@ -432,7 +432,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                msg_print(_("ロケット発射!", "You launch a rocket!"));
                                fire_rocket(caster_ptr, GF_ROCKET, dir, dam, rad);
@@ -476,7 +476,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_beam(caster_ptr, GF_GRAVITY, dir, damroll(dice, sides));
                        }
                }
@@ -555,7 +555,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball(caster_ptr, GF_MANA, dir, dam, rad);
                        }
                }
@@ -573,7 +573,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_CHAOS, dir, dam, rad);
                        }
index f2e96b3..c829ff3 100644 (file)
@@ -44,7 +44,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                        if (info) return info_damage(dice, sides, 0);
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(dice, sides));
                        }
                }
@@ -80,7 +80,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                        if (info) return info_power(power);
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fear_monster(caster_ptr, dir, power);
                        }
                }
@@ -117,7 +117,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                        if (info) return info_multi_damage_dice(dice, sides);
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_blast(caster_ptr, GF_LITE, dir, dice, sides, 10, 3);
                        }
                }
@@ -145,7 +145,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                        if (info) return info_power(power);
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball(caster_ptr, GF_AWAY_EVIL, dir, power, 0);
                        }
                }
@@ -173,7 +173,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_HOLY_FIRE, dir, damroll(dice, sides) + base, rad);
                        }
@@ -249,7 +249,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_bolt(caster_ptr, GF_ELEC, dir, dam);
                        }
                }
@@ -284,7 +284,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                {
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                destroy_door(caster_ptr, dir);
                        }
@@ -302,7 +302,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                stasis_evil(caster_ptr, dir);
                        }
                }
@@ -382,7 +382,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_LITE, dir, dam, rad);
                        }
@@ -559,7 +559,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                                        while (attempt--)
                                        {
-                                               scatter(caster_ptr->current_floor_ptr, &my, &mx, caster_ptr->y, caster_ptr->x, 4, 0);
+                                               scatter(caster_ptr, &my, &mx, caster_ptr->y, caster_ptr->x, 4, 0);
 
                                                /* Require empty grids */
                                                if (cave_empty_bold2(caster_ptr->current_floor_ptr, my, mx)) break;
index fd13581..b03388f 100644 (file)
@@ -46,7 +46,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides));
                        }
@@ -113,7 +113,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fear_monster(caster_ptr, dir, power);
                                stun_monster(caster_ptr, dir, power);
@@ -133,7 +133,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_NETHER, dir, damroll(dice, sides));
                        }
@@ -176,7 +176,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_HELL_FIRE, dir, damroll(dice, sides) + base, rad);
                        }
@@ -194,7 +194,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                control_one_demon(caster_ptr, dir, plev);
                        }
@@ -245,7 +245,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_PLASMA, dir, damroll(dice, sides));
                        }
@@ -264,7 +264,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_FIRE, dir, dam, rad);
                        }
@@ -295,7 +295,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
                        }
@@ -385,7 +385,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_PLASMA, dir, dam, rad);
                        }
@@ -440,7 +440,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball(caster_ptr, GF_NEXUS, dir, dam, rad);
                        }
                }
@@ -453,7 +453,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir))
+                               if (!get_aim_dir(caster_ptr, &dir))
                                        return NULL;
                                else
                                        msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
@@ -548,7 +548,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
                        }
@@ -568,7 +568,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball_hide(caster_ptr, GF_BLOOD_CURSE, dir, dam, rad);
                                take_hit(caster_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
index 44e7271..1bfe6f0 100644 (file)
@@ -62,7 +62,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                /*
                                * A radius-0 ball may (1) be aimed at
@@ -120,7 +120,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_POIS, dir, dam, rad);
                        }
@@ -138,7 +138,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                sleep_monster(caster_ptr, dir, plev);
                        }
@@ -173,7 +173,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fear_monster(caster_ptr, dir, plev);
                                stun_monster(caster_ptr, dir, plev);
@@ -192,7 +192,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                control_one_undead(caster_ptr, dir, plev);
                        }
@@ -219,7 +219,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_HYPODYNAMIA, dir, damroll(dice, sides) + base, rad);
                        }
@@ -238,7 +238,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_NETHER, dir, damroll(dice, sides));
                        }
@@ -273,7 +273,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball_hide(caster_ptr, GF_GENOCIDE, dir, power, 0);
                        }
@@ -308,7 +308,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                HIT_POINT dam = base + damroll(dice, sides);
 
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                if (hypodynamic_bolt(caster_ptr, dir, dam))
                                {
@@ -392,7 +392,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                cast_invoke_spirits(caster_ptr, dir);
                        }
@@ -411,7 +411,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_DARK, dir, damroll(dice, sides));
                        }
@@ -463,7 +463,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                int i;
 
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                chg_virtue(caster_ptr, V_SACRIFICE, -1);
                                chg_virtue(caster_ptr, V_VITALITY, -1);
@@ -505,7 +505,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_DARK, dir, dam, rad);
                        }
@@ -519,7 +519,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                death_ray(caster_ptr, dir, plev);
                        }
@@ -611,7 +611,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_HELL_FIRE, dir, dam, rad);
                                take_hit(caster_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire"), -1);
index b76afc3..014d4c4 100644 (file)
@@ -1098,7 +1098,7 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                        do
                                        {
                                                msg_print(_("復讐の時だ!", "Time to revenge!"));
-                                       } while (!get_aim_dir(&dir));
+                                       } while (!get_aim_dir(caster_ptr, &dir));
 
                                        fire_ball(caster_ptr, GF_HELL_FIRE, dir, power, 1);
 
index cbe22c3..858726a 100644 (file)
@@ -47,7 +47,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                if (cast)
                {
                        project_length = 2;
-                       if (!get_aim_dir(&dir)) return NULL;
+                       if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                        project_hook(caster_ptr, GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
                }
@@ -588,7 +588,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        int total_damage = 0, basedam, i;
                        BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
-                       if (!get_aim_dir(&dir)) return NULL;
+                       if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                        msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
                        for (i = 0; i < 2; i++)
                        {
@@ -802,7 +802,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
 
                        if (!cave_player_teleportable_bold(y, x, 0L) ||
                                (distance(y, x, caster_ptr->y, caster_ptr->x) > MAX_SIGHT / 2) ||
-                               !projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                        {
                                msg_print(_("失敗!", "You cannot move to that place!"));
                                break;
index 7e5863e..cc17bc2 100644 (file)
@@ -64,7 +64,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
                        }
                }
@@ -157,7 +157,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
                        }
                }
@@ -310,7 +310,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
                        }
                }
index 47a393b..37875df 100644 (file)
@@ -65,7 +65,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                project_length = range;
 
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_ELEC, dir, damroll(dice, sides));
                        }
@@ -144,7 +144,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                charm_animal(caster_ptr, dir, plev);
                        }
@@ -202,7 +202,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                wall_to_mud(caster_ptr, dir, 20 + randint1(30));
                        }
@@ -221,7 +221,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir, damroll(dice, sides));
                        }
                }
@@ -261,7 +261,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_FIRE, dir, damroll(dice, sides));
                        }
                }
@@ -279,7 +279,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                msg_print(_("太陽光線が現れた。", "A line of sunlight appears."));
                                lite_line(caster_ptr, dir, damroll(6, 8));
                        }
@@ -466,7 +466,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_COLD, dir, dam, rad);
                        }
@@ -485,7 +485,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball(caster_ptr, GF_ELEC, dir, dam, rad);
                                break;
                        }
@@ -504,7 +504,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
                                fire_ball(caster_ptr, GF_WATER, dir, dam, rad);
                        }
                }
index 26894dd..dfc018d 100644 (file)
@@ -119,7 +119,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_bolt(caster_ptr, GF_SOUND, dir, damroll(dice, sides));
                        }
@@ -681,7 +681,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_SOUND, dir, damroll(dice, sides));
                        }
@@ -891,7 +891,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_ball(caster_ptr, GF_SOUND, dir, damroll(dice, sides), rad);
                        }
index f11fb86..54dbb4d 100644 (file)
@@ -109,7 +109,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                confuse_monster(caster_ptr, dir, power);
                        }
@@ -143,7 +143,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                sleep_monster(caster_ptr, dir, plev);
                        }
@@ -205,7 +205,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                slow_monster(caster_ptr, dir, plev);
                        }
@@ -239,7 +239,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
                        }
@@ -321,7 +321,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                charm_monster(caster_ptr, dir, plev);
                        }
@@ -461,7 +461,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fetch(caster_ptr, dir, weight, FALSE);
                        }
index fe98a25..4cf246a 100644 (file)
@@ -137,7 +137,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
                        }
@@ -175,7 +175,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               if (!get_aim_dir(&dir)) return NULL;
+                               if (!get_aim_dir(caster_ptr, &dir)) return NULL;
 
                                fetch(caster_ptr, dir, weight, FALSE);
                        }
@@ -253,7 +253,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                bool old_target_pet = target_pet;
                                target_pet = TRUE;
 
-                               result = get_aim_dir(&dir);
+                               result = get_aim_dir(caster_ptr, &dir);
 
                                /* Restore target_pet option */
                                target_pet = old_target_pet;
@@ -341,7 +341,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                /* HACK -- No range limit */
                                project_length = -1;
 
-                               result = get_aim_dir(&dir);
+                               result = get_aim_dir(caster_ptr, &dir);
 
                                /* Restore range to default */
                                project_length = 0;
@@ -520,7 +520,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                                bool old_target_pet = target_pet;
                                target_pet = TRUE;
 
-                               result = get_aim_dir(&dir);
+                               result = get_aim_dir(caster_ptr, &dir);
 
                                /* Restore target_pet option */
                                target_pet = old_target_pet;
index 2abea5e..9d7aa87 100644 (file)
@@ -500,7 +500,7 @@ bool build_type3(player_type *player_ptr)
                place_object(player_ptr, yval, xval, 0L);
 
                /* Let's guard the treasure well */
-               vault_monsters(floor_ptr, yval, xval, randint0(2) + 3);
+               vault_monsters(player_ptr, yval, xval, randint0(2) + 3);
 
                /* Traps naturally */
                vault_traps(player_ptr, yval, xval, 4, 4, randint0(3) + 2);
@@ -677,7 +677,7 @@ bool build_type4(player_type *player_ptr)
                        }
 
                        /* Place a monster in the room */
-                       vault_monsters(floor_ptr, yval, xval, 1);
+                       vault_monsters(player_ptr, yval, xval, 1);
 
                        break;
                }
@@ -715,7 +715,7 @@ bool build_type4(player_type *player_ptr)
                        }
 
                        /* Monsters to guard the "treasure" */
-                       vault_monsters(floor_ptr, yval, xval, randint1(3) + 2);
+                       vault_monsters(player_ptr, yval, xval, randint1(3) + 2);
 
                        /* Object (80%) */
                        if (randint0(100) < 80)
@@ -803,8 +803,8 @@ bool build_type4(player_type *player_ptr)
                                place_secret_door(player_ptr, yval - 3 + (randint1(2) * 2), xval + 3, door_type);
 
                                /* Monsters */
-                               vault_monsters(floor_ptr, yval, xval - 2, randint1(2));
-                               vault_monsters(floor_ptr, yval, xval + 2, randint1(2));
+                               vault_monsters(player_ptr, yval, xval - 2, randint1(2));
+                               vault_monsters(player_ptr, yval, xval + 2, randint1(2));
 
                                /* Objects */
                                if (one_in_(3)) place_object(player_ptr, yval, xval - 2, 0L);
@@ -840,8 +840,8 @@ bool build_type4(player_type *player_ptr)
                        }
 
                        /* Monsters just love mazes. */
-                       vault_monsters(floor_ptr, yval, xval - 5, randint1(3));
-                       vault_monsters(floor_ptr, yval, xval + 5, randint1(3));
+                       vault_monsters(player_ptr, yval, xval - 5, randint1(3));
+                       vault_monsters(player_ptr, yval, xval + 5, randint1(3));
 
                        /* Traps make them entertaining. */
                        vault_traps(player_ptr, yval, xval - 3, 2, 8, randint1(3));
@@ -894,10 +894,10 @@ bool build_type4(player_type *player_ptr)
                        vault_objects(player_ptr, yval, xval, 2 + randint1(2));
 
                        /* Gotta have some monsters. */
-                       vault_monsters(floor_ptr, yval + 1, xval - 4, randint1(4));
-                       vault_monsters(floor_ptr, yval + 1, xval + 4, randint1(4));
-                       vault_monsters(floor_ptr, yval - 1, xval - 4, randint1(4));
-                       vault_monsters(floor_ptr, yval - 1, xval + 4, randint1(4));
+                       vault_monsters(player_ptr, yval + 1, xval - 4, randint1(4));
+                       vault_monsters(player_ptr, yval + 1, xval + 4, randint1(4));
+                       vault_monsters(player_ptr, yval - 1, xval - 4, randint1(4));
+                       vault_monsters(player_ptr, yval - 1, xval + 4, randint1(4));
 
                        break;
                }
@@ -1043,7 +1043,7 @@ bool build_type12(player_type *player_ptr)
                place_object(player_ptr, y0, x0, 0L);
 
                /* Let's guard the treasure well */
-               vault_monsters(floor_ptr, y0, x0, randint0(2) + 3);
+               vault_monsters(player_ptr, y0, x0, randint0(2) + 3);
 
                /* Traps naturally */
                vault_traps(player_ptr, y0, x0, 4, 4, randint0(3) + 2);
index 99042c8..a110451 100644 (file)
@@ -300,8 +300,8 @@ void mitokohmon(player_type *kohmon_ptr)
                        m_ptr = &kohmon_ptr->current_floor_ptr->m_list[i];
                        if (!monster_is_valid(m_ptr)) continue;
                        if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
-                       if (!los(kohmon_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
-                       if (!projectable(kohmon_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
+                       if (!los(kohmon_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
+                       if (!projectable(kohmon_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
                        count++;
                        break;
                }
index afa12c9..9f5b215 100644 (file)
@@ -142,7 +142,7 @@ extern const magic_type technic_info[NUM_TECHNIC][32];
 
 /* spells1.c */
 extern bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern void breath_shape(floor_type *floor_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
+extern void breath_shape(player_type *caster_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
 extern POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 
 #define PROJECT_WHO_UNCTRL_POWER -1 /*!< 魔法効果の自然発生要因: 名状し難い力の解放 */
index a827770..8b620f4 100644 (file)
@@ -1072,6 +1072,7 @@ static bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
 
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
+ * @param caster_ptr プレーヤーへの参照ポインタ
  * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標Y座標 / Target y location (or location to travel "towards")
@@ -1138,12 +1139,11 @@ static bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
  * "flg" was added.
  * </pre>
  */
-
-
-static bool project_m(player_type *caster_ptr, floor_type *floor_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, bool see_s_msg)
+static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, bool see_s_msg)
 {
        int tmp;
 
+       floor_type *floor_ptr = caster_ptr->current_floor_ptr;
        grid_type *g_ptr = &floor_ptr->grid_array[y][x];
 
        monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
@@ -1704,7 +1704,7 @@ static bool project_m(player_type *caster_ptr, floor_type *floor_ptr, MONSTER_ID
                        if (seen) obvious = TRUE;
 
                        /* PSI only works if the monster can see you! -- RG */
-                       if (!(los(floor_ptr, m_ptr->fy, m_ptr->fx, caster_ptr->y, caster_ptr->x)))
+                       if (!(los(caster_ptr, m_ptr->fy, m_ptr->fx, caster_ptr->y, caster_ptr->x)))
                        {
                                if (seen_msg)
                                        msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
@@ -4058,7 +4058,7 @@ static bool project_p(MONSTER_IDX who, player_type *target_ptr, concptr who_name
                                t_y = target_ptr->current_floor_ptr->m_list[who].fy - 1 + randint1(3);
                                t_x = target_ptr->current_floor_ptr->m_list[who].fx - 1 + randint1(3);
                                max_attempts--;
-                       } while (max_attempts && in_bounds2u(target_ptr->current_floor_ptr, t_y, t_x) && !projectable(target_ptr->current_floor_ptr, target_ptr->y, target_ptr->x, t_y, t_x));
+                       } while (max_attempts && in_bounds2u(target_ptr->current_floor_ptr, t_y, t_x) && !projectable(target_ptr, target_ptr->y, target_ptr->x, t_y, t_x));
 
                        if (max_attempts < 1)
                        {
@@ -5322,7 +5322,7 @@ bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, PO
 /*
  * breath shape
  */
-void breath_shape(floor_type *floor_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ)
+void breath_shape(player_type *caster_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ)
 {
        POSITION by = y1;
        POSITION bx = x1;
@@ -5333,6 +5333,7 @@ void breath_shape(floor_type *floor_ptr, u16b *path_g, int dist, int *pgrids, PO
        int path_n = 0;
        int mdis = distance(y1, x1, y2, x2) + rad;
 
+       floor_type *floor_ptr = caster_ptr->current_floor_ptr;
        while (bdis <= mdis)
        {
                POSITION x, y;
@@ -5374,7 +5375,7 @@ void breath_shape(floor_type *floor_ptr, u16b *path_g, int dist, int *pgrids, PO
                                        case GF_LITE:
                                        case GF_LITE_WEAK:
                                                /* Lights are stopped by opaque terrains */
-                                               if (!los(floor_ptr, by, bx, y, x)) continue;
+                                               if (!los(caster_ptr, by, bx, y, x)) continue;
                                                break;
                                        case GF_DISINTEGRATE:
                                                /* Disintegration are stopped only by perma-walls */
@@ -5382,7 +5383,7 @@ void breath_shape(floor_type *floor_ptr, u16b *path_g, int dist, int *pgrids, PO
                                                break;
                                        default:
                                                /* Ball explosions are stopped by walls */
-                                               if (!projectable(floor_ptr, by, bx, y, x)) continue;
+                                               if (!projectable(caster_ptr, by, bx, y, x)) continue;
                                                break;
                                        }
 
@@ -5708,7 +5709,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
 
        /* Calculate the projection path */
 
-       path_n = project_path(caster_ptr->current_floor_ptr, path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
+       path_n = project_path(caster_ptr, path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
        handle_stuff(caster_ptr);
 
        /* Giga-Hack SEEKER & SUPER_RAY */
@@ -5799,12 +5800,12 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                remove_mirror(caster_ptr, y, x);
                                next_mirror(caster_ptr, &oy, &ox, y, x);
 
-                               path_n = i + project_path(caster_ptr->current_floor_ptr, &(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
+                               path_n = i + project_path(caster_ptr, &(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
                                for (j = last_i; j <= i; j++)
                                {
                                        y = GRID_Y(path_g[j]);
                                        x = GRID_X(path_g[j]);
-                                       if (project_m(caster_ptr, caster_ptr->current_floor_ptr, 0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
+                                       if (project_m(caster_ptr, 0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
                                        if (!who && (project_m_n == 1) && !jump) {
                                                if (caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
                                                {
@@ -5830,7 +5831,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                        POSITION py, px;
                        py = GRID_Y(path_g[i]);
                        px = GRID_X(path_g[i]);
-                       if (project_m(caster_ptr, caster_ptr->current_floor_ptr, 0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
+                       if (project_m(caster_ptr, 0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
                                notice = TRUE;
                        if (!who && (project_m_n == 1) && !jump) {
                                if (caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
@@ -5951,14 +5952,14 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
 
                                path_n = i;
                                second_step = i + 1;
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x - 1, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x + 1, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y, x - 1, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y, x + 1, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x - 1, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x, flg);
-                               path_n += project_path(caster_ptr->current_floor_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x + 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x - 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y - 1, x + 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y, x - 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y, x + 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x - 1, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x, flg);
+                               path_n += project_path(caster_ptr, &(path_g[path_n + 1]), (project_length ? project_length : MAX_RANGE), y, x, y + 1, x + 1, flg);
                        }
                }
 
@@ -5966,7 +5967,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                {
                        POSITION py = GRID_Y(path_g[i]);
                        POSITION px = GRID_X(path_g[i]);
-                       (void)project_m(caster_ptr, caster_ptr->current_floor_ptr, 0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
+                       (void)project_m(caster_ptr, 0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
                        if (!who && (project_m_n == 1) && !jump) {
                                if (caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
                                        monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[caster_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
@@ -6122,7 +6123,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                {
                        flg &= ~(PROJECT_HIDE);
 
-                       breath_shape(caster_ptr->current_floor_ptr, path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
+                       breath_shape(caster_ptr, path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
                }
                else
                {
@@ -6145,7 +6146,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                                case GF_LITE:
                                                case GF_LITE_WEAK:
                                                        /* Lights are stopped by opaque terrains */
-                                                       if (!los(caster_ptr->current_floor_ptr, by, bx, y, x)) continue;
+                                                       if (!los(caster_ptr, by, bx, y, x)) continue;
                                                        break;
                                                case GF_DISINTEGRATE:
                                                        /* Disintegration are stopped only by perma-walls */
@@ -6153,7 +6154,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                                        break;
                                                default:
                                                        /* Ball explosions are stopped by walls */
-                                                       if (!projectable(caster_ptr->current_floor_ptr, by, bx, y, x)) continue;
+                                                       if (!projectable(caster_ptr, by, bx, y, x)) continue;
                                                        break;
                                                }
 
@@ -6250,7 +6251,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
        if (flg & PROJECT_KILL)
        {
                see_s_msg = (who > 0) ? is_seen(&caster_ptr->current_floor_ptr->m_list[who]) :
-                       (!who ? TRUE : (player_can_see_bold(caster_ptr, y1, x1) && projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y1, x1)));
+                       (!who ? TRUE : (player_can_see_bold(caster_ptr, y1, x1) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y1, x1)));
        }
 
        /* Check features */
@@ -6362,7 +6363,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                                t_y = y_saver - 1 + randint1(3);
                                                t_x = x_saver - 1 + randint1(3);
                                                max_attempts--;
-                                       } while (max_attempts && in_bounds2u(caster_ptr->current_floor_ptr, t_y, t_x) && !projectable(caster_ptr->current_floor_ptr, y, x, t_y, t_x));
+                                       } while (max_attempts && in_bounds2u(caster_ptr->current_floor_ptr, t_y, t_x) && !projectable(caster_ptr, y, x, t_y, t_x));
 
                                        if (max_attempts < 1)
                                        {
@@ -6476,7 +6477,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                        }
 
                        /* Affect the monster in the grid */
-                       if (project_m(caster_ptr, caster_ptr->current_floor_ptr, who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
+                       if (project_m(caster_ptr, who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
                }
 
 
@@ -6632,7 +6633,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
                                distance(caster_ptr->y, caster_ptr->x, y, x) <= MAX_RANGE &&
                                distance(caster_ptr->y, caster_ptr->x, y, x) != 0 &&
                                player_has_los_bold(caster_ptr, y, x) &&
-                               projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                        {
                                mirror_y[mirror_num] = y;
                                mirror_x[mirror_num] = x;
@@ -6683,7 +6684,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
                                centersign*((point_x[2] - x)*(point_y[0] - y)
                                        - (point_y[2] - y)*(point_x[0] - x)) >= 0)
                        {
-                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                                {
                                        /* Visual effects */
                                        if (!(caster_ptr->blind)
@@ -6711,7 +6712,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
                                centersign*((point_x[2] - x)*(point_y[0] - y)
                                        - (point_y[2] - y)*(point_x[0] - x)) >= 0)
                        {
-                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                                {
                                        (void)project_f(caster_ptr, 0, 0, y, x, dam, GF_MANA);
                                }
@@ -6730,7 +6731,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
                                centersign*((point_x[2] - x)*(point_y[0] - y)
                                        - (point_y[2] - y)*(point_x[0] - x)) >= 0)
                        {
-                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                                {
                                        (void)project_o(caster_ptr, 0, 0, y, x, dam, GF_MANA);
                                }
@@ -6749,9 +6750,9 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam)
                                centersign*((point_x[2] - x)*(point_y[0] - y)
                                        - (point_y[2] - y)*(point_x[0] - x)) >= 0)
                        {
-                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x))
+                               if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x))
                                {
-                                       (void)project_m(caster_ptr, caster_ptr->current_floor_ptr, 0, 0, y, x, dam, GF_MANA,
+                                       (void)project_m(caster_ptr, 0, 0, y, x, dam, GF_MANA,
                                                (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
                                }
                        }
@@ -6781,7 +6782,7 @@ void seal_of_mirror(player_type *caster_ptr, HIT_POINT dam)
                        if (!is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[y][x]))
                                continue;
                        
-                       if (!project_m(caster_ptr, caster_ptr->current_floor_ptr, 0, 0, y, x, dam, GF_GENOCIDE,
+                       if (!project_m(caster_ptr, 0, 0, y, x, dam, GF_GENOCIDE,
                                (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
                                continue;
                        
index 0e9c0db..8586c99 100644 (file)
@@ -802,7 +802,7 @@ bool project_all_los(player_type *caster_ptr, EFFECT_ID typ, HIT_POINT dam)
                x = m_ptr->fx;
 
                /* Require line of sight */
-               if (!player_has_los_bold(caster_ptr, y, x) || !projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x)) continue;
+               if (!player_has_los_bold(caster_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)) continue;
 
                /* Mark the monster */
                m_ptr->mflag |= (MFLAG_LOS);
@@ -1877,7 +1877,7 @@ bool starlight(player_type *caster_ptr, bool magic)
 
                while (attempts--)
                {
-                       scatter(caster_ptr->current_floor_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, PROJECT_LOS);
+                       scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, PROJECT_LOS);
                        if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
                        if (!player_bold(caster_ptr, y, x)) break;
                }
@@ -1966,7 +1966,7 @@ bool fire_ball(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT
        POSITION ty = caster_ptr->y + 99 * ddy[dir];
 
        /* Hack -- Use an actual "target" */
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                flg &= ~(PROJECT_STOP);
                tx = target_col;
@@ -2020,7 +2020,7 @@ bool fire_rocket(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POIN
        POSITION ty = caster_ptr->y + 99 * ddy[dir];
 
        /* Hack -- Use an actual "target" */
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -2053,7 +2053,7 @@ bool fire_ball_hide(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_P
        POSITION ty = caster_ptr->y + 99 * ddy[dir];
 
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                flg &= ~(PROJECT_STOP);
                tx = target_col;
@@ -2156,7 +2156,7 @@ bool fire_blast(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, DICE_NUMB
 bool teleport_swap(player_type *caster_ptr, DIRECTION dir)
 {
        POSITION tx, ty;
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -2227,7 +2227,7 @@ bool project_hook(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POI
 
        POSITION tx = caster_ptr->x + ddx[dir];
        POSITION ty = caster_ptr->y + ddy[dir];
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -2574,7 +2574,7 @@ void call_chaos(player_type *caster_ptr)
                return;
        }
 
-       if (!get_aim_dir(&dir)) return;
+       if (!get_aim_dir(caster_ptr, &dir)) return;
        if (line_chaos)
                fire_beam(caster_ptr, chaos_type, dir, 250);
        else
@@ -2801,7 +2801,7 @@ void wall_breaker(player_type *caster_ptr)
        {
                while (attempts--)
                {
-                       scatter(caster_ptr->current_floor_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
+                       scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
 
                        if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
 
@@ -2824,7 +2824,7 @@ void wall_breaker(player_type *caster_ptr)
        {
                while (TRUE)
                {
-                       scatter(caster_ptr->current_floor_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, 0);
+                       scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, 0);
 
                        if (!player_bold(caster_ptr, y, x)) break;
                }
@@ -3066,13 +3066,13 @@ bool rush_attack(player_type *attacker_ptr, bool *mdeath)
 
        project_length = 5;
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(attacker_ptr, &dir)) return FALSE;
 
        /* Use the given direction */
        int tx = attacker_ptr->x + project_length * ddx[dir];
        int ty = attacker_ptr->y + project_length * ddy[dir];
 
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(attacker_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -3083,7 +3083,7 @@ bool rush_attack(player_type *attacker_ptr, bool *mdeath)
        if (in_bounds(floor_ptr, ty, tx)) tm_idx = floor_ptr->grid_array[ty][tx].m_idx;
 
        u16b path_g[32];
-       int path_n = project_path(floor_ptr, path_g, project_length, attacker_ptr->y, attacker_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
+       int path_n = project_path(attacker_ptr, path_g, project_length, attacker_ptr->y, attacker_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
        project_length = 0;
 
        /* No need to move */
@@ -3387,7 +3387,7 @@ void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
                        if (d >= 9) continue;
 
                        floor_type *floor_ptr = caster_ptr->current_floor_ptr;
-                       if (!in_bounds(floor_ptr, y, x) || !projectable(floor_ptr, caster_ptr->y, caster_ptr->x, y, x)
+                       if (!in_bounds(floor_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)
                                || !cave_have_flag_bold(floor_ptr, y, x, FF_PROJECT)) continue;
 
                        break;
@@ -3410,14 +3410,14 @@ void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
 bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
 {
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
        /* Use the given direction */
        POSITION tx = caster_ptr->x + 99 * ddx[dir];
        POSITION ty = caster_ptr->y + 99 * ddy[dir];
 
        /* Hack -- Use an actual "target" */
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(caster_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -4005,7 +4005,7 @@ void cast_shuffle(player_type *caster_ptr)
        {
                msg_print(_("《恋人》だ。", "It's the Lovers."));
 
-               if (get_aim_dir(&dir))
+               if (get_aim_dir(caster_ptr, &dir))
                {
                        charm_monster(caster_ptr, dir, MIN(caster_ptr->lev, 20));
                }
@@ -4236,7 +4236,7 @@ bool draconian_breath(player_type *creature_ptr)
        concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
 
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
 
        if (randint1(100) < creature_ptr->lev)
        {
@@ -4377,7 +4377,7 @@ bool draconian_breath(player_type *creature_ptr)
 bool android_inside_weapon(player_type *creature_ptr)
 {
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
 
        if (creature_ptr->lev < 10)
        {
@@ -4533,7 +4533,7 @@ 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;
+       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
        stop_mouth(creature_ptr);
        msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
        fire_breath(creature_ptr, type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
index a9ea26a..d36370f 100644 (file)
@@ -516,7 +516,7 @@ void teleport_away_followable(player_type *tracer_ptr, MONSTER_IDX m_idx)
        is_followable &= old_cdis <= MAX_SIGHT;
        is_followable &= !current_world_ptr->timewalk_m_idx;
        is_followable &= !tracer_ptr->phase_out;
-       is_followable &= los(tracer_ptr->current_floor_ptr, tracer_ptr->y, tracer_ptr->x, oldfy, oldfx);
+       is_followable &= los(tracer_ptr, tracer_ptr->y, tracer_ptr->x, oldfy, oldfx);
        if (!is_followable) return;
 
        bool follow = FALSE;
@@ -566,7 +566,7 @@ bool teleport_level_other(player_type *caster_ptr)
        MONSTER_IDX target_m_idx = caster_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
        if (!target_m_idx) return TRUE;
        if (!player_has_los_bold(caster_ptr, target_row, target_col)) return TRUE;
-       if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) return TRUE;
+       if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) return TRUE;
 
        monster_type *m_ptr;
        monster_race *r_ptr;
@@ -1235,7 +1235,7 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
        }
 
        POSITION ty, tx;
-       if (dir == 5 && target_okay())
+       if (dir == 5 && target_okay(caster_ptr))
        {
                tx = target_col;
                ty = target_row;
@@ -1270,7 +1270,7 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
                                msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
                                return;
                        }
-                       else if (!projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, ty, tx))
+                       else if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, ty, tx))
                        {
                                msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
                                return;
@@ -3188,7 +3188,7 @@ bool shock_power(player_type *caster_ptr)
 
        project_length = 1;
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
 
        POSITION y = caster_ptr->y + ddy[dir];
        POSITION x = caster_ptr->x + ddx[dir];
@@ -3389,14 +3389,14 @@ void blood_curse_to_enemy(player_type *caster_ptr, MONSTER_IDX m_idx)
 bool fire_crimson(player_type *shooter_ptr)
 {
        DIRECTION dir;
-       if (!get_aim_dir(&dir)) return FALSE;
+       if (!get_aim_dir(shooter_ptr, &dir)) return FALSE;
 
        /* Use the given direction */
        POSITION tx = shooter_ptr->x + 99 * ddx[dir];
        POSITION ty = shooter_ptr->y + 99 * ddy[dir];
 
        /* Hack -- Use an actual "target" */
-       if ((dir == 5) && target_okay())
+       if ((dir == 5) && target_okay(shooter_ptr))
        {
                tx = target_col;
                ty = target_row;
index b9a496f..67734cf 100644 (file)
@@ -209,23 +209,24 @@ void verify_panel(void)
  * Future versions may restrict the ability to target "trappers"
  * and "mimics", but the semantics is a little bit weird.
  */
-bool target_able(MONSTER_IDX m_idx)
+bool target_able(player_type *creature_ptr, MONSTER_IDX m_idx)
 {
-       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+       monster_type *m_ptr = &floor_ptr->m_list[m_idx];
 
        /* Monster must be alive */
        if (!monster_is_valid(m_ptr)) return FALSE;
 
        /* Hack -- no targeting hallucinations */
-       if (p_ptr->image) return FALSE;
+       if (creature_ptr->image) return FALSE;
 
        /* Monster must be visible */
        if (!m_ptr->ml) return FALSE;
 
-       if (p_ptr->riding && (p_ptr->riding == m_idx)) return TRUE;
+       if (creature_ptr->riding && (creature_ptr->riding == m_idx)) return TRUE;
 
        /* Monster must be projectable */
-       if (!projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) return FALSE;
+       if (!projectable(creature_ptr, creature_ptr->y, creature_ptr->x, m_ptr->fy, m_ptr->fx)) return FALSE;
 
        /* Hack -- Never target trappers */
        /* if (CLEAR_ATTR && (CLEAR_CHAR)) return FALSE; */
@@ -247,7 +248,7 @@ POSITION target_row;
  *
  * We return TRUE if the target is "okay" and FALSE otherwise.
  */
-bool target_okay(void)
+bool target_okay(player_type *creature_ptr)
 {
        /* Accept stationary targets */
        if (target_who < 0) return TRUE;
@@ -256,9 +257,9 @@ bool target_okay(void)
        if (target_who > 0)
        {
                /* Accept reasonable targets */
-               if (target_able(target_who))
+               if (target_able(creature_ptr, target_who))
                {
-                       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[target_who];
+                       monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[target_who];
 
                        /* Acquire monster location */
                        target_row = m_ptr->fy;
@@ -373,7 +374,7 @@ static bool target_set_accept(POSITION y, POSITION x)
  *
  * Return the number of target_able monsters in the set.
  */
-static void target_set_prepare(BIT_FLAGS mode)
+static void target_set_prepare(player_type *creature_ptr, BIT_FLAGS mode)
 {
        POSITION y, x;
        POSITION min_hgt, max_hgt, min_wid, max_wid;
@@ -381,10 +382,10 @@ static void target_set_prepare(BIT_FLAGS mode)
        if (mode & TARGET_KILL)
        {
                /* Inner range */
-               min_hgt = MAX((p_ptr->y - MAX_RANGE), 0);
-               max_hgt = MIN((p_ptr->y + MAX_RANGE), p_ptr->current_floor_ptr->height - 1);
-               min_wid = MAX((p_ptr->x - MAX_RANGE), 0);
-               max_wid = MIN((p_ptr->x + MAX_RANGE), p_ptr->current_floor_ptr->width - 1);
+               min_hgt = MAX((creature_ptr->y - MAX_RANGE), 0);
+               max_hgt = MIN((creature_ptr->y + MAX_RANGE), creature_ptr->current_floor_ptr->height - 1);
+               min_wid = MAX((creature_ptr->x - MAX_RANGE), 0);
+               max_wid = MIN((creature_ptr->x + MAX_RANGE), creature_ptr->current_floor_ptr->width - 1);
        }
        else /* not targetting */
        {
@@ -408,12 +409,12 @@ static void target_set_prepare(BIT_FLAGS mode)
                        /* Require "interesting" contents */
                        if (!target_set_accept(y, x)) continue;
 
-                       g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
 
                        /* Require target_able monsters for "TARGET_KILL" */
-                       if ((mode & (TARGET_KILL)) && !target_able(g_ptr->m_idx)) continue;
+                       if ((mode & (TARGET_KILL)) && !target_able(creature_ptr, g_ptr->m_idx)) continue;
 
-                       if ((mode & (TARGET_KILL)) && !target_pet && is_pet(&p_ptr->current_floor_ptr->m_list[g_ptr->m_idx])) continue;
+                       if ((mode & (TARGET_KILL)) && !target_pet && is_pet(&creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx])) continue;
 
                        /* Save the location */
                        tmp_pos.x[tmp_pos.n] = x;
@@ -432,7 +433,7 @@ static void target_set_prepare(BIT_FLAGS mode)
                ang_sort(tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_importance, ang_sort_swap_distance);
        }
 
-       if (p_ptr->riding && target_pet && (tmp_pos.n > 1) && (mode & (TARGET_KILL)))
+       if (creature_ptr->riding && target_pet && (tmp_pos.n > 1) && (mode & (TARGET_KILL)))
        {
                POSITION tmp;
 
@@ -445,8 +446,9 @@ static void target_set_prepare(BIT_FLAGS mode)
        }
 }
 
-void target_set_prepare_look(void){
-       target_set_prepare(TARGET_LOOK);
+void target_set_prepare_look(player_type *creature_ptr)
+{
+       target_set_prepare(creature_ptr, TARGET_LOOK);
 }
 
 
@@ -1080,7 +1082,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
        }
 
        /* Prepare the "temp" array */
-       target_set_prepare(mode);
+       target_set_prepare(creature_ptr, mode);
 
        /* Start near the player */
        m = 0;
@@ -1104,7 +1106,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                        g_ptr = &floor_ptr->grid_array[y][x];
 
                        /* Allow target */
-                       if (target_able(g_ptr->m_idx))
+                       if (target_able(creature_ptr, g_ptr->m_idx))
                        {
                                strcpy(info, _("q止 t決 p自 o現 +次 -前", "q,t,p,o,+,-,<dir>"));
                        }
@@ -1119,7 +1121,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                        {
                                char cheatinfo[30];
                                sprintf(cheatinfo, " LOS:%d, PROJECTABLE:%d",
-                                       los(floor_ptr, creature_ptr->y, creature_ptr->x, y, x), projectable(floor_ptr, creature_ptr->y, creature_ptr->x, y, x));
+                                       los(creature_ptr, creature_ptr->y, creature_ptr->x, y, x), projectable(creature_ptr, creature_ptr->y, creature_ptr->x, y, x));
                                strcat(info, cheatinfo);
                        }
                        
@@ -1153,7 +1155,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                case '5':
                                case '0':
                                {
-                                       if (target_able(g_ptr->m_idx))
+                                       if (target_able(creature_ptr, g_ptr->m_idx))
                                        {
                                                health_track(creature_ptr, g_ptr->m_idx);
                                                target_who = g_ptr->m_idx;
@@ -1200,7 +1202,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                        handle_stuff(creature_ptr);
 
                                        /* Recalculate interesting grids */
-                                       target_set_prepare(mode);
+                                       target_set_prepare(creature_ptr, mode);
 
                                        y = creature_ptr->y;
                                        x = creature_ptr->x;
@@ -1257,7 +1259,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                                int u = tmp_pos.x[m];
 
                                                /* Recalculate interesting grids */
-                                               target_set_prepare(mode);
+                                               target_set_prepare(creature_ptr, mode);
 
                                                /* Look at interesting grids */
                                                flag = TRUE;
@@ -1286,7 +1288,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                                handle_stuff(creature_ptr);
 
                                                /* Recalculate interesting grids */
-                                               target_set_prepare(mode);
+                                               target_set_prepare(creature_ptr, mode);
 
                                                /* Look at boring grids */
                                                flag = FALSE;
@@ -1313,7 +1315,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                                if ((y >= panel_row_min+hgt) || (y < panel_row_min) ||
                                                    (x >= panel_col_min+wid) || (x < panel_col_min))
                                                {
-                                                       if (change_panel(creature_ptr, dy, dx)) target_set_prepare(mode);
+                                                       if (change_panel(creature_ptr, dy, dx)) target_set_prepare(creature_ptr, mode);
                                                }
 
                                                /* Slide into legality */
@@ -1348,8 +1350,8 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                        {
                                char cheatinfo[100];
                                sprintf(cheatinfo, " LOS:%d, PROJECTABLE:%d, SPECIAL:%d",
-                                       los(floor_ptr, creature_ptr->y, creature_ptr->x, y, x),
-                                       projectable(floor_ptr, creature_ptr->y, creature_ptr->x, y, x), g_ptr->special);
+                                       los(creature_ptr, creature_ptr->y, creature_ptr->x, y, x),
+                                       projectable(creature_ptr, creature_ptr->y, creature_ptr->x, y, x), g_ptr->special);
                                strcat(info, cheatinfo);
                        }
 
@@ -1396,7 +1398,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                        handle_stuff(creature_ptr);
 
                                        /* Recalculate interesting grids */
-                                       target_set_prepare(mode);
+                                       target_set_prepare(creature_ptr, mode);
 
                                        y = creature_ptr->y;
                                        x = creature_ptr->x;
@@ -1487,7 +1489,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
                                if ((y >= panel_row_min + hgt) || (y < panel_row_min) ||
                                         (x >= panel_col_min + wid) || (x < panel_col_min))
                                {
-                                       if (change_panel(creature_ptr, dy, dx)) target_set_prepare(mode);
+                                       if (change_panel(creature_ptr, dy, dx)) target_set_prepare(creature_ptr, mode);
                                }
 
                                /* Slide into legality */
@@ -1531,7 +1533,7 @@ bool target_set(player_type *creature_ptr, BIT_FLAGS mode)
  *
  * Note that confusion over-rides any (explicit?) user choice.
  */
-bool get_aim_dir(DIRECTION *dp)
+bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp)
 {
        DIRECTION dir;
        char    command;
@@ -1544,14 +1546,14 @@ bool get_aim_dir(DIRECTION *dp)
        dir = command_dir;
 
        /* Hack -- auto-target if requested */
-       if (use_old_target && target_okay()) dir = 5;
+       if (use_old_target && target_okay(creature_ptr)) dir = 5;
 
        if (repeat_pull(&code))
        {
                /* Confusion? */
 
                /* Verify */
-               if (!(code == 5 && !target_okay()))
+               if (!(code == 5 && !target_okay(creature_ptr)))
                {
 /*                     return TRUE; */
                        dir = (DIRECTION)code;
@@ -1563,7 +1565,7 @@ bool get_aim_dir(DIRECTION *dp)
        while (!dir)
        {
                /* Choose a prompt */
-               if (!target_okay())
+               if (!target_okay(creature_ptr))
                {
                        p = _("方向 ('*'でターゲット選択, ESCで中断)? ", "Direction ('*' to choose a target, Escape to cancel)? ");
                }
@@ -1599,7 +1601,7 @@ bool get_aim_dir(DIRECTION *dp)
                        case ' ':
                        case '\r':
                        {
-                               if (target_set(p_ptr, TARGET_KILL)) dir = 5;
+                               if (target_set(creature_ptr, TARGET_KILL)) dir = 5;
                                break;
                        }
 
@@ -1613,7 +1615,7 @@ bool get_aim_dir(DIRECTION *dp)
                }
 
                /* Verify requested targets */
-               if ((dir == 5) && !target_okay()) dir = 0;
+               if ((dir == 5) && !target_okay(creature_ptr)) dir = 0;
 
                /* Error */
                if (!dir) bell();
@@ -1630,7 +1632,7 @@ bool get_aim_dir(DIRECTION *dp)
        command_dir = dir;
 
        /* Check for confusion */
-       if (p_ptr->confused)
+       if (creature_ptr->confused)
        {
                /* Random direction */
                dir = ddd[randint0(8)];
@@ -2188,7 +2190,7 @@ bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp)
        while (!dir)
        {
                /* Choose a prompt */
-               if (!target_okay())
+               if (!target_okay(creature_ptr))
                {
                        p = _("方向 ('*'でターゲット選択, ESCで中断)? ", "Direction ('*' to choose a target, Escape to cancel)? ");
                }
@@ -2238,7 +2240,7 @@ bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp)
                }
 
                /* Verify requested targets */
-               if ((dir == 5) && !target_okay()) dir = 0;
+               if ((dir == 5) && !target_okay(creature_ptr)) dir = 0;
 
                /* Error */
                if (!dir) bell();
@@ -2251,7 +2253,7 @@ bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp)
        command_dir = dir;
 
        /* Check for confusion */
-       if (p_ptr->confused)
+       if (creature_ptr->confused)
        {
                /* Random direction */
                dir = ddd[randint0(8)];
index e80228f..2bf7b5d 100644 (file)
@@ -7,8 +7,8 @@ extern POSITION target_row;
 /* xtra2.c */
 extern void panel_bounds_center(void);
 extern void verify_panel(void);
-extern bool target_able(MONSTER_IDX m_idx);
-extern bool target_okay(void);
+extern bool target_able(player_type *creature_ptr, MONSTER_IDX m_idx);
+extern bool target_okay(player_type *creature_ptr);
 
 /*
  * target_set用関数の利用用途フラグ / Bit flags for the "target_set" function
@@ -18,8 +18,8 @@ extern bool target_okay(void);
 #define TARGET_XTRA     0x04 /*!< 現在未使用 / Currently unused flag */
 #define TARGET_GRID     0x08 /*!< 全てのマス対象にする(現在未使用) / Select from all grids */
 extern bool target_set(player_type *creature_ptr, BIT_FLAGS mode);
-extern void target_set_prepare_look(void);
-extern bool get_aim_dir(DIRECTION *dp);
+extern void target_set_prepare_look(player_type *creature_ptr);
+extern bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp);
 extern bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp);
 extern bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, bool with_steed);
 extern bool get_rep_dir(DIRECTION *dp, bool under);
index d1b098f..a8f9803 100644 (file)
@@ -628,7 +628,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
                                if (!in_bounds(trapped_ptr->current_floor_ptr, y1, x1)) continue;
 
                                /* Require line of projection */
-                               if (!projectable(trapped_ptr->current_floor_ptr, trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
+                               if (!projectable(trapped_ptr, trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
 
                                if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
                                        evil_idx = hack_m_idx_ii;
index 8df7aca..3eb88b9 100644 (file)
@@ -1740,7 +1740,7 @@ static void fix_monster_list(player_type *player_ptr)
 
                Term_clear();
 
-               target_set_prepare_look();//モンスター一覧を生成,ソート
+               target_set_prepare_look(player_ptr);//モンスター一覧を生成,ソート
                print_monster_list(player_ptr->current_floor_ptr, 0, 0, h);
                Term_fresh();
                Term_activate(old);
@@ -3760,7 +3760,7 @@ void print_path(player_type *player_ptr, POSITION y, POSITION x)
 
        /* Get projection path */
        floor_type *floor_ptr = player_ptr->current_floor_ptr;
-       path_n = project_path(floor_ptr, path_g, (project_length ? project_length : MAX_RANGE), player_ptr->y, player_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
+       path_n = project_path(player_ptr, path_g, (project_length ? project_length : MAX_RANGE), player_ptr->y, player_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
 
        player_ptr->redraw |= (PR_MAP);
        handle_stuff(player_ptr);
index 5ef1965..94b0f66 100644 (file)
@@ -429,7 +429,7 @@ bool process_warning(player_type *creature_ptr, POSITION xx, POSITION yy)
                        r_ptr = &r_info[m_ptr->r_idx];
 
                        /* Monster spells (only powerful ones)*/
-                       if (projectable(creature_ptr->current_floor_ptr, my, mx, yy, xx))
+                       if (projectable(creature_ptr, my, mx, yy, xx))
                        {
                                BIT_FLAGS f4 = r_ptr->flags4;
                                BIT_FLAGS f5 = r_ptr->a_ability_flags1;
index bb50f61..13dd3bf 100644 (file)
@@ -196,7 +196,7 @@ static void do_cmd_summon_horde(player_type *caster_ptr)
 
        while (--attempts)
        {
-               scatter(caster_ptr->current_floor_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
+               scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
                if (cave_empty_bold(caster_ptr->current_floor_ptr, wy, wx)) break;
        }