OSDN Git Service

[Refactor] #37353 職業ID定義を player-class.h へ移動.
[hengband/hengband.git] / src / player-move.c
index d8b8953..2d96595 100644 (file)
  */
 
 #include "angband.h"
+#include "core.h"
+#include "util.h"
+
+#include "realm-song.h"
+#include "autopick.h"
+#include "dungeon.h"
 #include "floor.h"
 #include "melee.h"
 #include "grid.h"
 #include "artifact.h"
 #include "player-move.h"
 #include "player-status.h"
+#include "player-effects.h"
+#include "player-class.h"
 #include "spells-floor.h"
 #include "feature.h"
 #include "warning.h"
 #include "monster.h"
 #include "monster-spell.h"
+#include "monster-status.h"
 #include "object-hook.h"
 #include "object-flavor.h"
 #include "spells.h"
+#include "cmd-basic.h"
+#include "view-mainwindow.h"
+#include "world.h"
+#include "objectkind.h"
+#include "autopick.h"
+#include "targeting.h"
 
 
+#ifdef TRAVEL
+ /* for travel */
+travel_type travel;
+#endif
 
 /*!
  * @brief 地形やその上のアイテムの隠された要素を明かす /
@@ -260,7 +279,7 @@ void search(void)
  * だが、違和感が\n
  * あるという指摘をうけたので、「~を拾った、~を持っている」という表示\n
  * にかえてある。そのための配列。\n
- * Add the given dungeon object to the character's inventory.\n
+ * Add the given dungeon object to the character's p_ptr->inventory_list.\n
  * Delete the object afterwards.\n
  */
 void py_pickup_aux(OBJECT_IDX o_idx)
@@ -289,7 +308,7 @@ void py_pickup_aux(OBJECT_IDX o_idx)
        slot = inven_carry(o_ptr);
 
        /* Get the object again */
-       o_ptr = &inventory[slot];
+       o_ptr = &p_ptr->inventory_list[slot];
 
        delete_object_idx(o_idx);
 
@@ -590,34 +609,6 @@ bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
        }
 }
 
-
-/*!
- * @brief プレイヤーが地形踏破可能かを返す
- * @param feature 判定したい地形ID
- * @param mode 移動に関するオプションフラグ
- * @return 移動可能ならばTRUEを返す
- */
-bool player_can_enter(FEAT_IDX feature, BIT_FLAGS16 mode)
-{
-       feature_type *f_ptr = &f_info[feature];
-
-       if (p_ptr->riding) return monster_can_cross_terrain(feature, &r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx], mode | CEM_RIDING);
-
-       if (have_flag(f_ptr->flags, FF_PATTERN))
-       {
-               if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
-       }
-
-       if (have_flag(f_ptr->flags, FF_CAN_FLY) && p_ptr->levitation) return TRUE;
-       if (have_flag(f_ptr->flags, FF_CAN_SWIM) && p_ptr->can_swim) return TRUE;
-       if (have_flag(f_ptr->flags, FF_CAN_PASS) && p_ptr->pass_wall) return TRUE;
-
-       if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
-
-       return TRUE;
-}
-
-
 /*!
  * @brief 移動に伴うプレイヤーのステータス変化処理
  * @param ny 移動先Y座標
@@ -1016,8 +1007,8 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
 
        m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
 
-       if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
-       if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
+       if (p_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
+       if (p_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
 
        /* Player can not walk through "walls"... */
        /* unless in Shadow Form */
@@ -1149,7 +1140,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
        {
                msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(g_ptr)].name);
                free_turn(p_ptr);
-               running = 0;
+               p_ptr->running = 0;
                oktomove = FALSE;
        }
 
@@ -1900,7 +1891,7 @@ void run_step(DIRECTION dir)
        }
 
        /* Decrease the run counter */
-       if (--running <= 0) return;
+       if (--p_ptr->running <= 0) return;
 
        /* Take time */
        take_turn(p_ptr, 100);
@@ -2328,10 +2319,10 @@ void disturb(bool stop_search, bool stop_travel)
        }
 
        /* Cancel running */
-       if (running)
+       if (p_ptr->running)
        {
                /* Cancel */
-               running = 0;
+               p_ptr->running = 0;
 
                /* Check for new panel if appropriate */
                if (center_player && !center_running) verify_panel();