OSDN Git Service

[Refactor] #38997 is_known_trap() とis_hidden_door()にplayer_type * 引数を追加 / Added playe...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 12:08:12 +0000 (21:08 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:53 +0000 (23:01 +0900)
20 files changed:
src/cmd/cmd-basic.c
src/feature.c
src/feature.h
src/floor-generate.c
src/floor-save.c
src/floor-streams.c
src/floor.c
src/grid.c
src/grid.h
src/mind.c
src/monster-process.c
src/player-move.c
src/realm-hissatsu.c
src/rooms-special.c
src/rooms-vault.c
src/spells-floor.c
src/spells1.c
src/spells3.c
src/trap.c
src/warning.c

index 1f054c6..074e52d 100644 (file)
@@ -621,7 +621,7 @@ static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OB
  * @details Return the number of features around (or under) the character.
  * Usually look for doors and floor traps.
  */
-static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*test)(FEAT_IDX feat), bool under)
+static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*test)(player_type*, FEAT_IDX feat), bool under)
 {
        /* Check around (and under) the character */
        int count = 0;
@@ -647,7 +647,7 @@ static int count_dt(player_type *creature_ptr, POSITION *y, POSITION *x, bool (*
                feat = get_feat_mimic(g_ptr);
 
                /* Not looking for this feature */
-               if (!((*test)(feat))) continue;
+               if (!((*test)(creature_ptr, feat))) continue;
 
                /* OK */
                ++count;
@@ -902,7 +902,7 @@ static bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
                return more;
        }
        
-       s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+       s16b closed_feat = feat_state(creature_ptr, old_feat, FF_CLOSE);
 
        /* Hack -- object in the way */
        if ((g_ptr->o_idx || (g_ptr->info & CAVE_OBJECT)) &&
@@ -1160,7 +1160,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                }
        }
 
-       if (is_hidden_door(g_ptr))
+       if (is_hidden_door(creature_ptr, g_ptr))
        {
                /* Occasional Search XXX XXX */
                if (randint0(100) < 25) search(creature_ptr);
@@ -1276,7 +1276,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
        feature_type *f_ptr = &f_info[g_ptr->feat];
 
        /* Must be a closed door */
-       if (!is_closed_door(g_ptr->feat))
+       if (!is_closed_door(creature_ptr, g_ptr->feat))
        {
                return FALSE;
        }
@@ -1579,7 +1579,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                o_idx = chest_check(creature_ptr->current_floor_ptr, y, x, TRUE);
 
                /* Disarm a trap */
-               if (!is_trap(feat) && !o_idx)
+               if (!is_trap(creature_ptr, feat) && !o_idx)
                {
                        msg_print(_("そこには解除するものが見当たらない。", "You see nothing there to disarm."));
                }
@@ -1663,7 +1663,7 @@ static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, D
                sound(have_flag(f_ptr->flags, FF_GLASS) ? SOUND_GLASS : SOUND_OPENDOOR);
 
                /* Break down the door */
-               if ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))
+               if ((randint0(100) < 50) || (feat_state(creature_ptr, g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))
                {
                        cave_alter_feat(creature_ptr, y, x, FF_BASH);
                }
index ace583e..e63a1f9 100644 (file)
@@ -103,8 +103,10 @@ FEAT_IDX max_f_idx;
  * @param feat 地形情報のID
  * @return 罠持ちの地形ならばTRUEを返す。
  */
-bool is_trap(FEAT_IDX feat)
+bool is_trap(player_type *player_ptr, FEAT_IDX feat)
 {
+       /* 関数ポインタの都合 */
+       (void)player_ptr;
        return have_flag(f_info[feat].flags, FF_TRAP);
 }
 
@@ -113,11 +115,12 @@ bool is_trap(FEAT_IDX feat)
  * @param feat 地形情報のID
  * @return 閉じたドアのある地形ならばTRUEを返す。
  */
-bool is_closed_door(FEAT_IDX feat)
+bool is_closed_door(player_type *player_ptr, FEAT_IDX feat)
 {
+       /* 関数ポインタの都合 */
+       (void)player_ptr;
        feature_type *f_ptr = &f_info[feat];
 
        return (have_flag(f_ptr->flags, FF_OPEN) || have_flag(f_ptr->flags, FF_BASH)) &&
                !have_flag(f_ptr->flags, FF_MOVE);
 }
-
index 16f990c..c5559f9 100644 (file)
@@ -198,8 +198,8 @@ extern feature_type *f_info;
 extern char *f_name;
 extern char *f_tag;
 
-extern bool is_closed_door(FEAT_IDX feat);
-extern bool is_trap(FEAT_IDX feat);
+extern bool is_closed_door(player_type *player_ptr, FEAT_IDX feat);
+extern bool is_trap(player_type *player_ptr, FEAT_IDX feat);
 
 /*** Terrain feature variables ***/
 extern FEAT_IDX feat_none;
index c2bab25..b01e092 100644 (file)
@@ -287,7 +287,7 @@ static bool alloc_stairs(player_type *owner_ptr, FEAT_IDX feat, int num, int wal
                        g_ptr->mimic = 0;
 
                        /* Clear previous contents, add stairs */
-                       g_ptr->feat = (i < shaft_num) ? feat_state(feat, FF_SHAFT) : feat;
+                       g_ptr->feat = (i < shaft_num) ? feat_state(owner_ptr, feat, FF_SHAFT) : feat;
 
                        /* No longer "FLOOR" */
                        g_ptr->info &= ~(CAVE_FLOOR);
index babd1d5..90fa7ef 100644 (file)
@@ -1340,13 +1340,13 @@ void change_floor(player_type *creature_ptr)
                                /* No stairs down from Quest */
                                if ((creature_ptr->change_floor_mode & CFM_UP) && !quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level))
                                {
-                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair;
+                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(creature_ptr, feat_down_stair, FF_SHAFT) : feat_down_stair;
                                }
 
                                /* No stairs up when ironman_downward */
                                else if ((creature_ptr->change_floor_mode & CFM_DOWN) && !ironman_downward)
                                {
-                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair;
+                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(creature_ptr, feat_up_stair, FF_SHAFT) : feat_up_stair;
                                }
 
                                /* Paranoia -- Clear mimic */
index a8b6532..68db430 100644 (file)
@@ -291,7 +291,7 @@ void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance)
                        if (streamer_is_wall)
                        {
                                if (!is_extra_grid(g_ptr) && !is_inner_grid(g_ptr) && !is_outer_grid(g_ptr) && !is_solid_grid(g_ptr)) continue;
-                               if (is_closed_door(g_ptr->feat)) continue;
+                               if (is_closed_door(player_ptr, g_ptr->feat)) continue;
                        }
 
                        if (g_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[floor_ptr->m_list[g_ptr->m_idx].r_idx], 0)))
index dc1e51d..461bc00 100644 (file)
@@ -162,7 +162,7 @@ void update_smell(floor_type *floor_ptr, player_type *subject_ptr)
                        g_ptr = &floor_ptr->grid_array[y][x];
 
                        /* Walls, water, and lava cannot hold scent. */
-                       if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue;
+                       if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(subject_ptr, g_ptr->feat)) continue;
 
                        /* Grid must not be blocked by walls from the character */
                        if (!player_has_los_bold(subject_ptr, y, x)) continue;
index 21aaf7c..f4a508e 100644 (file)
@@ -250,7 +250,7 @@ void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr)
                /* Hack -- Decline boundary walls with known treasure  */
                if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) &&
                        !have_flag(f_ptr->flags, FF_SECRET))
-                       g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET);
+                       g_ptr->feat = feat_state(player_ptr, g_ptr->feat, FF_ENSECRET);
 
                /* Set boundary mimic */
                g_ptr->mimic = g_ptr->feat;
@@ -262,13 +262,14 @@ void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr)
 
 /*!
  * @brief マスに看破済みの罠があるかの判定を行う。 / Return TRUE if the given grid is a known trap
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param g_ptr マス構造体の参照ポインタ
  * @return 看破済みの罠があるならTRUEを返す。
  */
-bool is_known_trap(grid_type *g_ptr)
+bool is_known_trap(player_type *player_ptr, grid_type *g_ptr)
 {
        if (!g_ptr->mimic && !cave_have_flag_grid(g_ptr, FF_SECRET) &&
-               is_trap(g_ptr->feat)) return TRUE;
+               is_trap(player_ptr, g_ptr->feat)) return TRUE;
        else
                return FALSE;
 }
@@ -277,13 +278,14 @@ bool is_known_trap(grid_type *g_ptr)
 
 /*!
  * @brief マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param g_ptr マス構造体の参照ポインタ
  * @return 隠されたドアがあるならTRUEを返す。
  */
-bool is_hidden_door(grid_type *g_ptr)
+bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr)
 {
        if ((g_ptr->mimic || cave_have_flag_grid(g_ptr, FF_SECRET)) &&
-               is_closed_door(g_ptr->feat))
+               is_closed_door(player_ptr, g_ptr->feat))
                return TRUE;
        else
                return FALSE;
@@ -925,13 +927,13 @@ void update_flow(player_type *subject_ptr)
 
                        g_ptr = &subject_ptr->current_floor_ptr->grid_array[y][x];
 
-                       if (is_closed_door(g_ptr->feat)) m += 3;
+                       if (is_closed_door(subject_ptr, g_ptr->feat)) m += 3;
 
                        /* Ignore "pre-stamped" entries */
                        if (g_ptr->dist != 0 && g_ptr->dist <= n && g_ptr->cost <= m) continue;
 
                        /* Ignore "walls" and "rubble" */
-                       if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue;
+                       if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(subject_ptr, g_ptr->feat)) continue;
 
                        /* Save the flow cost */
                        if (g_ptr->cost == 0 || g_ptr->cost > m) g_ptr->cost = m;
@@ -957,20 +959,21 @@ void update_flow(player_type *subject_ptr)
  * Take a feature, determine what that feature becomes
  * through applying the given action.
  */
-FEAT_IDX feat_state(FEAT_IDX feat, int action)
+FEAT_IDX feat_state(player_type *player_ptr, FEAT_IDX feat, int action)
 {
        feature_type *f_ptr = &f_info[feat];
        int i;
 
        /* Get the new feature */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (i = 0; i < MAX_FEAT_STATES; i++)
        {
-               if (f_ptr->state[i].action == action) return conv_dungeon_feat(p_ptr->current_floor_ptr, f_ptr->state[i].result);
+               if (f_ptr->state[i].action == action) return conv_dungeon_feat(floor_ptr, f_ptr->state[i].result);
        }
 
        if (have_flag(f_ptr->flags, FF_PERMANENT)) return feat;
 
-       return (feature_action_flags[action] & FAF_DESTROY) ? conv_dungeon_feat(p_ptr->current_floor_ptr, f_ptr->destroyed) : feat;
+       return (feature_action_flags[action] & FAF_DESTROY) ? conv_dungeon_feat(floor_ptr, f_ptr->destroyed) : feat;
 }
 
 /*
@@ -984,7 +987,7 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action
        FEAT_IDX oldfeat = floor_ptr->grid_array[y][x].feat;
 
        /* Get the new feat */
-       FEAT_IDX newfeat = feat_state(oldfeat, action);
+       FEAT_IDX newfeat = feat_state(player_ptr, oldfeat, action);
 
        /* No change */
        if (newfeat == oldfeat) return;
@@ -1178,9 +1181,9 @@ bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION
  * @param feat 地形ID
  * @return 開いた地形である場合TRUEを返す /  Return TRUE if the given feature is an open door
  */
-bool is_open(FEAT_IDX feat)
+bool is_open(player_type *player_ptr, FEAT_IDX feat)
 {
-       return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(feat, FF_CLOSE));
+       return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(player_ptr, feat, FF_CLOSE));
 }
 
 /*!
@@ -1254,7 +1257,7 @@ void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_typ
                feature_type *f_ptr = &f_info[feat_wall_outer];
                if (permanent_wall(f_ptr))
                {
-                       g_ptr->feat = (s16b)feat_state(feat_wall_outer, FF_UNPERM);
+                       g_ptr->feat = (s16b)feat_state(player_ptr, feat_wall_outer, FF_UNPERM);
                }
                else
                {
@@ -1352,7 +1355,7 @@ void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type
        case outer_noperm:
        {
                feature_type *_f_ptr = &f_info[feat_wall_outer];
-               if (permanent_wall(_f_ptr)) set_cave_feat(floor_ptr, y, x, (s16b)feat_state(feat_wall_outer, FF_UNPERM));
+               if (permanent_wall(_f_ptr)) set_cave_feat(floor_ptr, y, x, (s16b)feat_state(player_ptr, feat_wall_outer, FF_UNPERM));
                else set_cave_feat(floor_ptr, y, x, feat_wall_outer);
                floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
                add_cave_info(floor_ptr, y, x, (CAVE_OUTER | CAVE_VAULT));
@@ -1369,7 +1372,7 @@ void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type
        {
                feature_type *f_ptr = &f_info[feat_wall_solid];
                if ((floor_ptr->grid_array[y][x].info & CAVE_VAULT) && permanent_wall(f_ptr))
-                       set_cave_feat(floor_ptr, y, x, feat_state(feat_wall_solid, FF_UNPERM));
+                       set_cave_feat(floor_ptr, y, x, feat_state(player_ptr, feat_wall_solid, FF_UNPERM));
                else set_cave_feat(floor_ptr, y, x, feat_wall_solid);
                floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
                add_cave_info(floor_ptr, y, x, CAVE_SOLID);
index da87883..4a22f0a 100644 (file)
@@ -171,8 +171,8 @@ extern bool new_player_spot(player_type *creature_ptr);
 
 extern void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr);
 
-extern bool is_known_trap(grid_type *g_ptr);
-extern bool is_hidden_door(grid_type *g_ptr);
+extern bool is_known_trap(player_type *player_ptr, grid_type *g_ptr);
+extern bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr);
 extern bool is_mirror_grid(grid_type *g_ptr);
 extern bool is_glyph_grid(grid_type *g_ptr);
 extern bool is_explosive_rune_grid(grid_type *g_ptr);
@@ -184,7 +184,10 @@ extern bool player_can_enter(player_type *creature_ptr, FEAT_IDX feature, BIT_FL
  */
 #define feat_uses_special(F) (have_flag(f_info[(F)].flags, FF_SPECIAL))
 
-/* grids.c */
+/*!
+ * grids.c
+ * ここにfloor_type を引数として加えるとコンパイルエラー
+ */
 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern void update_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
 extern bool no_lite(player_type *creature_ptr);
@@ -192,10 +195,10 @@ extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TER
 extern void note_spot(player_type *player_ptr, POSITION y, POSITION x);
 extern void lite_spot(player_type *player_ptr, POSITION y, POSITION x);
 extern void update_flow(player_type *subject_ptr);
-extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
+extern FEAT_IDX feat_state(player_type *player_ptr, FEAT_IDX feat, int action);
 extern void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action);
 extern void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x);
-extern bool is_open(FEAT_IDX feat);
+extern bool is_open(player_type *player_ptr, FEAT_IDX feat);
 extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
 
 extern bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
index 92f1720..cc9ee89 100644 (file)
@@ -1497,13 +1497,13 @@ static bool cast_berserk_spell(player_type *caster_ptr, int spell)
 
                py_attack(caster_ptr, y, x, 0);
 
-               if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr->current_floor_ptr->grid_array[y][x].feat))
+               if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
                        break;
 
                y += ddy[dir];
                x += ddx[dir];
 
-               if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
+               if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                {
                        msg_print(NULL);
                        (void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
index e968a6a..efd9632 100644 (file)
@@ -340,7 +340,7 @@ static bool get_moves_aux2(player_type *target_ptr, MONSTER_IDX m_idx, POSITION
                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;
+                       if (!can_open_door && is_closed_door(target_ptr, g_ptr->feat)) continue;
                }
 
                /* Hack -- for kill or pass wall monster.. */
@@ -1803,7 +1803,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                }
 
                /* Handle doors and secret doors */
-               else if (is_closed_door(g_ptr->feat))
+               else if (is_closed_door(target_ptr, g_ptr->feat))
                {
                        bool may_bash = TRUE;
 
@@ -1872,7 +1872,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        if (did_open_door || did_bash_door)
                        {
                                /* Break down the door */
-                               if (did_bash_door && ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)))
+                               if (did_bash_door && ((randint0(100) < 50) || (feat_state(target_ptr, g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)))
                                {
                                        cave_alter_feat(target_ptr, ny, nx, FF_BASH);
 
index 8e87b88..7ae0208 100644 (file)
@@ -193,14 +193,14 @@ static void discover_hidden_things(player_type *creature_ptr, POSITION y, POSITI
        floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        g_ptr = &floor_ptr->grid_array[y][x];
 
-       if (g_ptr->mimic && is_trap(g_ptr->feat))
+       if (g_ptr->mimic && is_trap(creature_ptr, g_ptr->feat))
        {
                disclose_grid(creature_ptr, y, x);
                msg_print(_("トラップを発見した。", "You have found a trap."));
                disturb(creature_ptr, FALSE, TRUE);
        }
 
-       if (is_hidden_door(g_ptr))
+       if (is_hidden_door(creature_ptr, g_ptr))
        {
                msg_print(_("隠しドアを発見した。", "You have found a secret door."));
                disclose_grid(creature_ptr, y, x);
@@ -638,7 +638,7 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
                creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                /* Remove "unsafe" flag */
-               if ((!creature_ptr->blind && !no_lite(creature_ptr)) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
+               if ((!creature_ptr->blind && !no_lite(creature_ptr)) || !is_trap(creature_ptr, g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
 
                /* For get everything when requested hehe I'm *NASTY* */
                if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark(creature_ptr);
@@ -1177,7 +1177,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
                        else
                        {
                                /* Closed doors */
-                               if (easy_open && is_closed_door(feat) && easy_open_door(creature_ptr, y, x)) return;
+                               if (easy_open && is_closed_door(creature_ptr, feat) && easy_open_door(creature_ptr, y, x)) return;
 
 #ifdef JP
                                msg_format("%sが行く手をはばんでいる。", name);
@@ -1926,7 +1926,7 @@ static DIRECTION travel_test(player_type *creature_ptr, DIRECTION prev_dir)
        g_ptr = &floor_ptr->grid_array[creature_ptr->y+ddy[new_dir]][creature_ptr->x+ddx[new_dir]];
 
        /* Close door abort traveling */
-       if (!easy_open && is_closed_door(g_ptr->feat)) return 0;
+       if (!easy_open && is_closed_door(creature_ptr, g_ptr->feat)) return 0;
 
        /* Visible and unignorable trap abort tarveling */
        if (!g_ptr->mimic && !trap_can_be_ignored(creature_ptr, g_ptr->feat)) return 0;
index b6989f9..4e5b53d 100644 (file)
@@ -210,13 +210,13 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
 
                        py_attack(caster_ptr, y, x, 0);
 
-                       if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr->current_floor_ptr->grid_array[y][x].feat))
+                       if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
                                break;
 
                        y += ddy[dir];
                        x += ddx[dir];
 
-                       if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
+                       if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                        {
                                msg_print(NULL);
                                (void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
index 7df5158..ede0618 100644 (file)
@@ -118,7 +118,7 @@ bool build_type15(player_type *player_ptr)
                x = xval + 2 * ddx_ddd[dir1];
                place_secret_door(player_ptr, y, x, DOOR_GLASS_DOOR);
                g_ptr = &floor_ptr->grid_array[y][x];
-               if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
+               if (is_closed_door(player_ptr, g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
 
                /* Place a potion */
                get_obj_num_hook = kind_is_potion;
index ad7c973..40498e1 100644 (file)
@@ -432,7 +432,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                /* Secret glass doors */
                        case '-':
                                place_secret_door(player_ptr, y, x, DOOR_GLASS_DOOR);
-                               if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
+                               if (is_closed_door(player_ptr, g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
                                break;
 
                                /* Curtains */
index 397dcec..0ad3721 100644 (file)
@@ -361,13 +361,13 @@ void stair_creation(player_type *caster_ptr)
        {
                cave_set_feat(caster_ptr, caster_ptr->y, caster_ptr->x,
                        (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= floor_ptr->dun_level - 2)) ?
-                       feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair);
+                       feat_state(caster_ptr, feat_up_stair, FF_SHAFT) : feat_up_stair);
        }
        else
        {
                cave_set_feat(caster_ptr, caster_ptr->y, caster_ptr->x,
                        (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= floor_ptr->dun_level + 2)) ?
-                       feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair);
+                       feat_state(caster_ptr, feat_down_stair, FF_SHAFT) : feat_down_stair);
        }
 
        /* Connect this stairs to the destination */
index ab484e5..8f7395d 100644 (file)
@@ -370,7 +370,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
        case GF_KILL_TRAP:
        {
                /* Reveal secret doors */
-               if (is_hidden_door(g_ptr))
+               if (is_hidden_door(caster_ptr, g_ptr))
                {
                        /* Pick a door */
                        disclose_grid(caster_ptr, y, x);
@@ -383,7 +383,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                }
 
                /* Destroy traps */
-               if (is_trap(g_ptr->feat))
+               if (is_trap(caster_ptr, g_ptr->feat))
                {
                        /* Check line of sight */
                        if (known)
@@ -397,7 +397,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                }
 
                /* Locked doors are unlocked */
-               if (is_closed_door(g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
+               if (is_closed_door(caster_ptr, g_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
                {
                        FEAT_IDX old_feat = g_ptr->feat;
 
@@ -427,7 +427,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
        case GF_KILL_DOOR:
        {
                /* Destroy all doors and traps */
-               if (is_trap(g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
+               if (is_trap(caster_ptr, g_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
                {
                        /* Check line of sight */
                        if (known)
index 3f09435..a79dee6 100644 (file)
@@ -1068,7 +1068,7 @@ bool vanish_dungeon(player_type *caster_ptr)
                /* Set boundary mimic if needed */
                if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
                {
-                       g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
+                       g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
 
                        /* Check for change to boring grid */
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
@@ -1083,7 +1083,7 @@ bool vanish_dungeon(player_type *caster_ptr)
                /* Set boundary mimic if needed */
                if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
                {
-                       g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
+                       g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
 
                        /* Check for change to boring grid */
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
@@ -1102,7 +1102,7 @@ bool vanish_dungeon(player_type *caster_ptr)
                /* Set boundary mimic if needed */
                if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
                {
-                       g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
+                       g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
 
                        /* Check for change to boring grid */
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
@@ -1117,7 +1117,7 @@ bool vanish_dungeon(player_type *caster_ptr)
                /* Set boundary mimic if needed */
                if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
                {
-                       g_ptr->mimic = feat_state(g_ptr->mimic, FF_HURT_DISI);
+                       g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
 
                        /* Check for change to boring grid */
                        if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
index a01d3d6..6a4b7b1 100644 (file)
@@ -670,7 +670,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
        }
        }
 
-       if (break_trap && is_trap(g_ptr->feat))
+       if (break_trap && is_trap(trapped_ptr, g_ptr->feat))
        {
                cave_alter_feat(trapped_ptr, y, x, FF_DISARM);
                msg_print(_("トラップを粉砕した。", "You destroyed the trap."));
index 90d2f22..4b37193 100644 (file)
@@ -514,7 +514,7 @@ bool process_warning(player_type *creature_ptr, POSITION xx, POSITION yy)
        else old_damage = old_damage / 2;
 
        g_ptr = &creature_ptr->current_floor_ptr->grid_array[yy][xx];
-       bool is_warning = (!easy_disarm && is_trap(g_ptr->feat)) || (g_ptr->mimic && is_trap(g_ptr->feat));
+       bool is_warning = (!easy_disarm && is_trap(creature_ptr, g_ptr->feat)) || (g_ptr->mimic && is_trap(creature_ptr, g_ptr->feat));
        is_warning = !one_in_(13);
        if (!is_warning) return TRUE;