OSDN Git Service

[Refactor] #40514 player_type の pass_wall 変数を廃止. / Abolished pass_wall variable in...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:47:54 +0000 (14:47 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 05:47:54 +0000 (14:47 +0900)
src/core/hp-mp-processor.c
src/grid/grid.c
src/monster-floor/monster-direction.c
src/monster-floor/monster-move.c
src/monster-floor/monster-sweep-grid.c
src/monster/monster-info.c
src/player/player-status-flags.c
src/player/player-status.c
src/player/player-status.h
src/spell-kind/earthquake.c

index a4e8972..a4e906f 100644 (file)
@@ -331,11 +331,11 @@ void process_player_hp_mp(player_type *creature_ptr)
      */
     if (!has_flag(f_ptr->flags, FF_MOVE) && !has_flag(f_ptr->flags, FF_CAN_FLY)) {
         if (!is_invuln(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->tim_pass_wall
-            && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall)) {
+            && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !has_pass_wall(creature_ptr))) {
             concptr dam_desc;
             cave_no_regen = TRUE;
 
-            if (creature_ptr->pass_wall) {
+            if (has_pass_wall(creature_ptr)) {
                 msg_print(_("体の分子が分解した気がする!", "Your molecules feel disrupted!"));
                 dam_desc = _("密度", "density");
             } else {
index 063fc1d..98fdc4b 100644 (file)
@@ -1152,7 +1152,7 @@ bool player_can_enter(player_type *creature_ptr, FEAT_IDX feature, BIT_FLAGS16 m
         return TRUE;
     if (has_flag(f_ptr->flags, FF_CAN_SWIM) && creature_ptr->can_swim)
         return TRUE;
-    if (has_flag(f_ptr->flags, FF_CAN_PASS) && creature_ptr->pass_wall)
+    if (has_flag(f_ptr->flags, FF_CAN_PASS) && has_pass_wall(creature_ptr))
         return TRUE;
 
     if (!has_flag(f_ptr->flags, FF_MOVE))
index f63b26e..22b3a0d 100644 (file)
@@ -17,6 +17,7 @@
 #include "spell/range-calc.h"
 #include "system/floor-type-definition.h"
 #include "target/projection-path-calculator.h"
+#include "player/player-status-flags.h"
 
 /*!
  * @brief ペットが敵に接近するための方向を決定する
@@ -75,7 +76,7 @@ static void decide_enemy_approch_direction(player_type *target_ptr, MONSTER_IDX
                if (decide_pet_approch_direction(target_ptr, m_ptr, t_ptr)) continue;
                if (!are_enemies(target_ptr, m_ptr, t_ptr)) continue;
 
-               if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) ||
+               if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || has_pass_wall(target_ptr))) ||
                        ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)))
                {
                        if (!in_disintegration_range(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
index 6106e20..336b6d8 100644 (file)
@@ -34,6 +34,7 @@
 #include "target/projection-path-calculator.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
+#include "player/player-status-flags.h"
 
 static bool check_hp_for_feat_destruction(feature_type *f_ptr, monster_type *m_ptr)
 {
@@ -80,7 +81,8 @@ static bool process_wall(player_type *target_ptr, turn_flags *turn_flags_ptr, mo
         return FALSE;
 
     turn_flags_ptr->do_move = TRUE;
-    if (((r_ptr->flags2 & RF2_PASS_WALL) != 0) && (!turn_flags_ptr->is_riding_mon || target_ptr->pass_wall) && has_flag(f_ptr->flags, FF_CAN_PASS)) {
+    if (((r_ptr->flags2 & RF2_PASS_WALL) != 0) && (!turn_flags_ptr->is_riding_mon || has_pass_wall(target_ptr))
+        && has_flag(f_ptr->flags, FF_CAN_PASS)) {
         turn_flags_ptr->did_pass_wall = TRUE;
     }
 
index 6d49990..13176c6 100644 (file)
@@ -23,6 +23,7 @@
 #include "mspell/mspell-mask-definitions.h"
 #include "system/floor-type-definition.h"
 #include "target/projection-path-calculator.h"
+#include "player/player-status-flags.h"
 
  /*!
   * @brief モンスターがプレイヤーから逃走するかどうかを返す /
@@ -112,7 +113,7 @@ static bool sweep_ranged_attack_grid(player_type *target_ptr, MONSTER_IDX m_idx,
                grid_type *g_ptr;
                g_ptr = &floor_ptr->grid_array[y][x];
                int cost = g_ptr->cost;
-               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 (!(((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || has_pass_wall(target_ptr))) || ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding))))
                {
                        if (cost == 0) continue;
                        if (!can_open_door && is_closed_door(target_ptr, g_ptr->feat)) continue;
@@ -178,7 +179,7 @@ static void sweep_movable_grid(player_type *target_ptr, MONSTER_IDX m_idx, POSIT
        }
 
        if (no_flow) return;
-       if ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) return;
+       if ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || has_pass_wall(target_ptr))) return;
        if ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)) return;
 
        POSITION y1 = m_ptr->fy;
@@ -314,7 +315,7 @@ bool get_movable_grid(player_type *target_ptr, MONSTER_IDX m_idx, DIRECTION *mm)
        bool will_run = mon_will_run(target_ptr, m_idx);
        grid_type *g_ptr;
        bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) != 0) && (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].cost > 2);
-       bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) != 0) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall);
+       bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) != 0) && ((m_idx != target_ptr->riding) || has_pass_wall(target_ptr));
 
        if (!will_run && m_ptr->target_y)
        {
index 5d0d142..b4d1878 100644 (file)
@@ -27,6 +27,7 @@
 #include "monster/smart-learn-types.h"
 #include "system/floor-type-definition.h"
 #include "util/bit-flags-calculator.h"
+#include "player/player-status-flags.h"
 
 /*!
  * @brief モンスターを友好的にする
@@ -63,7 +64,7 @@ bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_r
     if (has_flag(f_ptr->flags, FF_CAN_SWIM) && (r_ptr->flags7 & RF7_CAN_SWIM))
         return TRUE;
     if (has_flag(f_ptr->flags, FF_CAN_PASS)) {
-        if ((r_ptr->flags2 & RF2_PASS_WALL) && (!(mode & CEM_RIDING) || player_ptr->pass_wall))
+        if ((r_ptr->flags2 & RF2_PASS_WALL) && (!(mode & CEM_RIDING) || has_pass_wall(player_ptr)))
             return TRUE;
     }
 
index d0ce917..29ac07b 100644 (file)
@@ -339,7 +339,7 @@ void has_no_flowed(player_type *creature_ptr)
 
     creature_ptr->no_flowed = FALSE;
 
-    if (creature_ptr->pass_wall && !creature_ptr->kill_wall)
+    if (has_pass_wall(creature_ptr) && !creature_ptr->kill_wall)
         creature_ptr->no_flowed = TRUE;
 
     for (int i = 0; i < INVEN_PACK; i++) {
index 53a3139..7190774 100644 (file)
@@ -346,7 +346,6 @@ void calc_bonuses(player_type *creature_ptr)
     ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
     ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
 
-    creature_ptr->pass_wall = has_pass_wall(creature_ptr);
     creature_ptr->kill_wall = has_kill_wall(creature_ptr);
     creature_ptr->xtra_might = has_xtra_might(creature_ptr);
     creature_ptr->esp_evil = has_esp_evil(creature_ptr);
index 255cccd..c1949c4 100644 (file)
@@ -397,7 +397,6 @@ typedef struct player_type {
     BIT_FLAGS bless_blade; /* Blessed blade */
     BIT_FLAGS xtra_might; /* Extra might bow */
     BIT_FLAGS impact; /* Earthquake blows */
-    bool pass_wall; /* Permanent wraithform */
     bool kill_wall;
     BIT_FLAGS dec_mana;
     BIT_FLAGS easy_spell;
index 6fd219b..3fb9e42 100644 (file)
@@ -27,6 +27,7 @@
 #include "player/player-damage.h"
 #include "player/player-move.h"
 #include "player/special-defense-types.h"
+#include "player/player-status-flags.h"
 #include "system/floor-type-definition.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -89,7 +90,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
 
     int sn = 0;
     POSITION sy = 0, sx = 0;
-    if (hurt && !caster_ptr->pass_wall && !caster_ptr->kill_wall) {
+    if (hurt && !has_pass_wall(caster_ptr) && !caster_ptr->kill_wall) {
         for (DIRECTION i = 0; i < 8; i++) {
             POSITION y = caster_ptr->y + ddy_ddd[i];
             POSITION x = caster_ptr->x + ddx_ddd[i];