OSDN Git Service

[Refactor] enum spells-typeをenum class AttributeTypeに置換
[hengbandforosx/hengbandosx.git] / src / grid / grid.cpp
index 38aa28d..07424a8 100644 (file)
@@ -45,7 +45,7 @@
 #include "player/player-status-flags.h"
 #include "player/player-status.h"
 #include "room/rooms-builder.h"
-#include "spell/spell-types.h"
+#include "effect/attribute-types.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-race-definition.h"
@@ -67,7 +67,7 @@
 
 /*!
  * @brief 新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object
- * @param player_ptr 配置したいクリーチャーの参照ポインタ
+ * @param player_ptr プレイヤーへの参照ポインタ
  * @return 配置に成功したらTRUEを返す
  */
 bool new_player_spot(player_type *player_ptr)
@@ -131,7 +131,7 @@ bool new_player_spot(player_type *player_ptr)
 
 /*!
  * @brief マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
  * @param g_ptr マス構造体の参照ポインタ
  * @return 隠されたドアがあるならTRUEを返す。
  */
@@ -183,7 +183,7 @@ bool check_local_illumination(player_type *player_ptr, POSITION y, POSITION x)
 
 /*!
  * @brief 指定された座標の照明状態を更新する / Update "local" illumination
- * @param player_ptr 視界元のクリーチャー
+ * @param player_ptr プレイヤーへの参照ポインタ
  * @param y 視界先y座標
  * @param x 視界先x座標
  */
@@ -246,17 +246,17 @@ bool no_lite(player_type *player_ptr)
 /*
  * Place an attr/char pair at the given map coordinate, if legal.
  */
-void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x)
+void print_rel(player_type *player_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y, POSITION x)
 {
     /* Only do "legal" locations */
     if (panel_contains(y, x)) {
         /* Hack -- fake monochrome */
         if (!use_graphics) {
-            if (current_world_ptr->timewalk_m_idx)
+            if (w_ptr->timewalk_m_idx)
                 a = TERM_DARK;
-            else if (is_invuln(subject_ptr) || subject_ptr->timewalk)
+            else if (is_invuln(player_ptr) || player_ptr->timewalk)
                 a = TERM_WHITE;
-            else if (subject_ptr->wraith_form)
+            else if (player_ptr->wraith_form)
                 a = TERM_L_DARK;
         }
 
@@ -396,7 +396,7 @@ void lite_spot(player_type *player_ptr, POSITION y, POSITION x)
 
         /* Hack -- fake monochrome */
         if (!use_graphics) {
-            if (current_world_ptr->timewalk_m_idx)
+            if (w_ptr->timewalk_m_idx)
                 a = TERM_DARK;
             else if (is_invuln(player_ptr) || player_ptr->timewalk)
                 a = TERM_WHITE;
@@ -639,14 +639,14 @@ static POSITION flow_y = 0;
  * We do not need a priority queue because the cost from grid
  * to grid is always "one" and we process them in order.
  */
-void update_flow(player_type *subject_ptr)
+void update_flow(player_type *player_ptr)
 {
     POSITION x, y;
     DIRECTION d;
-    floor_type *f_ptr = subject_ptr->current_floor_ptr;
+    floor_type *f_ptr = player_ptr->current_floor_ptr;
 
     /* The last way-point is on the map */
-    if (subject_ptr->running && in_bounds(f_ptr, flow_y, flow_x)) {
+    if (player_ptr->running && in_bounds(f_ptr, flow_y, flow_x)) {
         /* The way point is in sight - do not update.  (Speedup) */
         if (f_ptr->grid_array[flow_y][flow_x].info & CAVE_VIEW)
             return;
@@ -661,13 +661,13 @@ void update_flow(player_type *subject_ptr)
     }
 
     /* Save player position */
-    flow_y = subject_ptr->y;
-    flow_x = subject_ptr->x;
+    flow_y = player_ptr->y;
+    flow_x = player_ptr->x;
 
     for (int i = 0; i < FLOW_MAX; i++) {
         // 幅優先探索用のキュー。
         std::queue<Pos2D> que;
-        que.emplace(subject_ptr->y, subject_ptr->x);
+        que.emplace(player_ptr->y, player_ptr->x);
 
         /* Now process the queue */
         while (!que.empty()) {
@@ -677,20 +677,20 @@ void update_flow(player_type *subject_ptr)
 
             /* Add the "children" */
             for (d = 0; d < 8; d++) {
-                byte m = subject_ptr->current_floor_ptr->grid_array[ty][tx].costs[i] + 1;
-                byte n = subject_ptr->current_floor_ptr->grid_array[ty][tx].dists[i] + 1;
+                byte m = player_ptr->current_floor_ptr->grid_array[ty][tx].costs[i] + 1;
+                byte n = player_ptr->current_floor_ptr->grid_array[ty][tx].dists[i] + 1;
 
                 /* Child location */
                 y = ty + ddy_ddd[d];
                 x = tx + ddx_ddd[d];
 
                 /* Ignore player's grid */
-                if (player_bold(subject_ptr, y, x))
+                if (player_bold(player_ptr, y, x))
                     continue;
 
-                grid_type *g_ptr = &subject_ptr->current_floor_ptr->grid_array[y][x];
+                grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
 
-                if (is_closed_door(subject_ptr, g_ptr->feat))
+                if (is_closed_door(player_ptr, g_ptr->feat))
                     m += 3;
 
                 /* Ignore "pre-stamped" entries */
@@ -708,7 +708,7 @@ void update_flow(player_type *subject_ptr)
                     break;
                 }
 
-                if (!can_move && !is_closed_door(subject_ptr, g_ptr->feat))
+                if (!can_move && !is_closed_door(player_ptr, g_ptr->feat))
                     continue;
 
                 /* Save the flow cost */
@@ -788,7 +788,7 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FF action)
             found = true;
         }
 
-        if (found && current_world_ptr->character_dungeon && player_can_see_bold(player_ptr, y, x)) {
+        if (found && w_ptr->character_dungeon && player_can_see_bold(player_ptr, y, x)) {
             msg_print(_("何かを発見した!", "You have found something!"));
         }
     }
@@ -796,8 +796,8 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FF action)
     if (feature_action_flags[enum2i(action)] & FAF_CRASH_GLASS) {
         feature_type *old_f_ptr = &f_info[oldfeat];
 
-        if (old_f_ptr->flags.has(FF::GLASS) && current_world_ptr->character_dungeon) {
-            project(player_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(floor_ptr->dun_level, 100) / 4, GF_SHARDS,
+        if (old_f_ptr->flags.has(FF::GLASS) && w_ptr->character_dungeon) {
+            project(player_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, std::min(floor_ptr->dun_level, 100) / 4, AttributeType::SHARDS,
                 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI));
         }
     }
@@ -829,7 +829,7 @@ void remove_mirror(player_type *player_ptr, POSITION y, POSITION x)
 
 /*!
  * @brief 指定されたマスがモンスターのテレポート可能先かどうかを判定する。
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
  * @param m_idx モンスターID
  * @param y 移動先Y座標
  * @param x 移動先X座標
@@ -867,7 +867,7 @@ bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx,
 
 /*!
  * @brief 指定されたマスにプレイヤーがテレポート可能かどうかを判定する。
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
  * @param y 移動先Y座標
  * @param x 移動先X座標
  * @param mode オプション
@@ -1043,7 +1043,7 @@ void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type gb_typ
 
 /*!
  * モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster?
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
  * @param g_ptr グリッドへの参照ポインタ
  * @return 照明が消されている地形ならばTRUE
  */