Hengband  2.2.1
マクロ定義 | 関数 | 変数
player-move.c ファイル
#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 "trap.h"
#include "quest.h"
#include "artifact.h"
#include "player-move.h"
#include "player-status.h"
#include "player-effects.h"
#include "player-class.h"
#include "player-personality.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 "targeting.h"
player-move.c の依存先関係図:

マクロ定義

#define boundary_floor(C, F, MF)
 
#define TRAVEL_UNABLE   9999
 

関数

static void discover_hidden_things (POSITION y, POSITION x)
 地形やその上のアイテムの隠された要素を全て明かす / Search for hidden things [詳解]
 
void search (player_type *creature_ptr)
 プレイヤーの探索処理判定 [詳解]
 
void py_pickup_aux (OBJECT_IDX o_idx)
 プレイヤーがオブジェクトを拾った際のメッセージ表示処理 / Helper routine for py_pickup() and py_pickup_floor(). [詳解]
 
void carry (bool pickup)
 プレイヤーがオブジェクト上に乗った際の表示処理 [詳解]
 
bool pattern_seq (player_type *creature_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
 パターンによる移動制限処理 [詳解]
 
bool move_player_effect (player_type *creature_ptr, POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
 移動に伴うプレイヤーのステータス変化処理 [詳解]
 
bool trap_can_be_ignored (player_type *creature_ptr, FEAT_IDX feat)
 該当地形のトラップがプレイヤーにとって無効かどうかを判定して返す [詳解]
 
void move_player (player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool break_trap)
 該当地形のトラップがプレイヤーにとって無効かどうかを判定して返す / Move player in the given direction, with the given "pickup" flag. [詳解]
 
static bool see_wall (DIRECTION dir, POSITION y, POSITION x)
 ダッシュ移動処理中、移動先のマスが既知の壁かどうかを判定する / Hack – Check for a "known wall" (see below) [詳解]
 
static bool see_nothing (DIRECTION dir, POSITION y, POSITION x)
 ダッシュ移動処理中、移動先のマスか未知の地形かどうかを判定する / Hack – Check for an "unknown corner" (see below) [詳解]
 
static void run_init (DIRECTION dir)
 ダッシュ処理の導入 / Initialize the running algorithm for a new direction. [詳解]
 
static bool run_test (void)
 ダッシュ移動が継続できるかどうかの判定 / Update the current "run" path [詳解]
 
void run_step (DIRECTION dir)
 継続的なダッシュ処理 / Take one step along the current "run" path [詳解]
 
static DIRECTION travel_test (DIRECTION prev_dir)
 トラベル機能の判定処理 / Test for traveling [詳解]
 
void travel_step (void)
 トラベル機能の実装 / Travel command [詳解]
 
void forget_travel_flow (void)
 トラベル処理の記憶配列を初期化する Hack: forget the "flow" information [詳解]
 
static int travel_flow_cost (POSITION y, POSITION x)
 トラベル処理中に地形に応じた移動コスト基準を返す [詳解]
 
static void travel_flow_aux (POSITION y, POSITION x, int n, bool wall)
 トラベル処理の到達地点までの行程を得る処理のサブルーチン [詳解]
 
static void travel_flow (POSITION ty, POSITION tx)
 トラベル処理の到達地点までの行程を得る処理のメインルーチン [詳解]
 
void do_cmd_travel (player_type *creature_ptr)
 トラベル処理のメインルーチン [詳解]
 
void disturb (player_type *creature_ptr, bool stop_search, bool stop_travel)
 

変数

travel_type travel
 
static bool ignore_avoid_run
 
static byte cycle [] = { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 }
 
static byte chome [] = { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 }
 
static DIRECTION find_current
 
static DIRECTION find_prevdir
 
static bool find_openarea
 
static bool find_breakright
 
static bool find_breakleft
 
static int flow_head = 0
 
static int flow_tail = 0
 
static POSITION temp2_x [MAX_SHORT]
 
static POSITION temp2_y [MAX_SHORT]
 

マクロ定義詳解

◆ boundary_floor

#define boundary_floor (   C,
  F,
  MF 
)
値:
((C)->mimic && permanent_wall(F) && \
(have_flag((MF)->flags, FF_MOVE) || have_flag((MF)->flags, FF_CAN_FLY)) && \
have_flag((MF)->flags, FF_PROJECT) && \
!have_flag((MF)->flags, FF_OPEN))
#define FF_OPEN
開けるコマンドの対象となる地形である
Definition: feature.h:21
#define FF_CAN_FLY
< 未使用
Definition: feature.h:66
#define FF_PROJECT
飛び道具が通過できる地形である
Definition: feature.h:14
#define FF_MOVE
移動可能な地形である
Definition: feature.h:15
#define permanent_wall(F)
Definition: floor.h:351
#define have_flag(ARRAY, INDEX)
Definition: util.h:73

◆ TRAVEL_UNABLE

#define TRAVEL_UNABLE   9999

関数詳解

◆ carry()

void carry ( bool  pickup)

プレイヤーがオブジェクト上に乗った際の表示処理

引数
pickup自動拾い処理を行うならばTRUEとする
戻り値
なし

Player "wants" to pick up an object or gold. Note that we ONLY handle things that can be picked up. See "move_player(p_ptr, )" for handling of other things.

呼び出し関係図:

◆ discover_hidden_things()

static void discover_hidden_things ( POSITION  y,
POSITION  x 
)
static

地形やその上のアイテムの隠された要素を全て明かす / Search for hidden things

引数
y対象となるマスのY座標
x対象となるマスのX座標
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ disturb()

void disturb ( player_type creature_ptr,
bool  stop_search,
bool  stop_travel 
)
呼び出し関係図:

◆ do_cmd_travel()

void do_cmd_travel ( player_type creature_ptr)

トラベル処理のメインルーチン

戻り値
なし
呼び出し関係図:

◆ forget_travel_flow()

void forget_travel_flow ( void  )

トラベル処理の記憶配列を初期化する Hack: forget the "flow" information

戻り値
なし
被呼び出し関係図:

◆ move_player()

void move_player ( player_type creature_ptr,
DIRECTION  dir,
bool  do_pickup,
bool  break_trap 
)

該当地形のトラップがプレイヤーにとって無効かどうかを判定して返す / Move player in the given direction, with the given "pickup" flag.

引数
dir移動方向ID
do_pickup罠解除を試みながらの移動ならばTRUE
break_trapトラップ粉砕処理を行うならばTRUE
戻り値
実際に移動が行われたならばTRUEを返す。
覚え書き
This routine should (probably) always induce energy expenditure.

Note that moving will always take a turn, and will always hit
any monster which might be in the destination grid. Previously,
moving into walls was "free" and did NOT hit invisible monsters.

呼び出し関係図:

◆ move_player_effect()

bool move_player_effect ( player_type creature_ptr,
POSITION  ny,
POSITION  nx,
BIT_FLAGS  mpe_mode 
)

移動に伴うプレイヤーのステータス変化処理

引数
ny移動先Y座標
nx移動先X座標
mpe_mode移動オプションフラグ
戻り値
プレイヤーが死亡やフロア離脱を行わず、実際に移動が可能ならばTRUEを返す。
呼び出し関係図:

◆ pattern_seq()

bool pattern_seq ( player_type creature_ptr,
POSITION  c_y,
POSITION  c_x,
POSITION  n_y,
POSITION  n_x 
)

パターンによる移動制限処理

引数
c_yプレイヤーの移動元Y座標
c_xプレイヤーの移動元X座標
n_yプレイヤーの移動先Y座標
n_xプレイヤーの移動先X座標
戻り値
移動処理が可能である場合(可能な場合に選択した場合)TRUEを返す。
呼び出し関係図:

◆ py_pickup_aux()

void py_pickup_aux ( OBJECT_IDX  o_idx)

プレイヤーがオブジェクトを拾った際のメッセージ表示処理 / Helper routine for py_pickup() and py_pickup_floor().

引数
o_idx取得したオブジェクトの参照ID
戻り値
なし

アイテムを拾った際に「2つのケーキを持っている」
"You have two cakes." とアイテムを拾った後の合計のみの表示がオリジナル
だが、違和感が
あるという指摘をうけたので、「~を拾った、~を持っている」という表示
にかえてある。そのための配列。
Add the given dungeon object to the character's p_ptr->inventory_list.
Delete the object afterwards.

呼び出し関係図:

◆ run_init()

static void run_init ( DIRECTION  dir)
static

ダッシュ処理の導入 / Initialize the running algorithm for a new direction.

引数
dir導入の移動先

Diagonal Corridor – allow diaginal entry into corridors.

Blunt Corridor – If there is a wall two spaces ahead and
we seem to be in a corridor, then force a turn into the side
corridor, must be moving straight into a corridor here. ???

Diagonal Corridor Blunt Corridor (?)
# # #
#x# @x#
@@p. p

呼び出し関係図:
被呼び出し関係図:

◆ run_step()

void run_step ( DIRECTION  dir)

継続的なダッシュ処理 / Take one step along the current "run" path

引数
dir移動を試みる方向ID
戻り値
なし
呼び出し関係図:

◆ run_test()

static bool run_test ( void  )
static

ダッシュ移動が継続できるかどうかの判定 / Update the current "run" path

戻り値
ダッシュ移動が継続できるならばTRUEを返す。 Return TRUE if the running should be stopped
呼び出し関係図:
被呼び出し関係図:

◆ search()

void search ( player_type creature_ptr)

プレイヤーの探索処理判定

戻り値
なし
呼び出し関係図:

◆ see_nothing()

static bool see_nothing ( DIRECTION  dir,
POSITION  y,
POSITION  x 
)
static

ダッシュ移動処理中、移動先のマスか未知の地形かどうかを判定する / Hack – Check for an "unknown corner" (see below)

引数
dir想定する移動方向ID
y移動元のY座標
x移動元のX座標
戻り値
移動先が未知の地形ならばTRUE
呼び出し関係図:
被呼び出し関係図:

◆ see_wall()

static bool see_wall ( DIRECTION  dir,
POSITION  y,
POSITION  x 
)
static

ダッシュ移動処理中、移動先のマスが既知の壁かどうかを判定する / Hack – Check for a "known wall" (see below)

引数
dir想定する移動方向ID
y移動元のY座標
x移動元のX座標
戻り値
移動先が既知の壁ならばTRUE
呼び出し関係図:
被呼び出し関係図:

◆ trap_can_be_ignored()

bool trap_can_be_ignored ( player_type creature_ptr,
FEAT_IDX  feat 
)

該当地形のトラップがプレイヤーにとって無効かどうかを判定して返す

引数
feat地形ID
戻り値
トラップが自動的に無効ならばTRUEを返す

◆ travel_flow()

static void travel_flow ( POSITION  ty,
POSITION  tx 
)
static

トラベル処理の到達地点までの行程を得る処理のメインルーチン

引数
ty目標地点のY座標
tx目標地点のX座標
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ travel_flow_aux()

static void travel_flow_aux ( POSITION  y,
POSITION  x,
int  n,
bool  wall 
)
static

トラベル処理の到達地点までの行程を得る処理のサブルーチン

引数
y目標地点のY座標
x目標地点のX座標
n現在のコスト
wallプレイヤーが壁の中にいるならばTRUE
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ travel_flow_cost()

static int travel_flow_cost ( POSITION  y,
POSITION  x 
)
static

トラベル処理中に地形に応じた移動コスト基準を返す

引数
y該当地点のY座標
x該当地点のX座標
戻り値
コスト値
被呼び出し関係図:

◆ travel_step()

void travel_step ( void  )

トラベル機能の実装 / Travel command

戻り値
なし
呼び出し関係図:

◆ travel_test()

static DIRECTION travel_test ( DIRECTION  prev_dir)
static

トラベル機能の判定処理 / Test for traveling

引数
prev_dir前回移動を行った元の方角ID
戻り値
次の方向
呼び出し関係図:
被呼び出し関係図:

変数詳解

◆ chome

byte chome[] = { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 }
static

◆ cycle

byte cycle[] = { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 }
static

◆ find_breakleft

bool find_breakleft
static

◆ find_breakright

bool find_breakright
static

◆ find_current

DIRECTION find_current
static

◆ find_openarea

bool find_openarea
static

◆ find_prevdir

DIRECTION find_prevdir
static

◆ flow_head

int flow_head = 0
static

◆ flow_tail

int flow_tail = 0
static

◆ ignore_avoid_run

bool ignore_avoid_run
static

◆ temp2_x

POSITION temp2_x[MAX_SHORT]
static

◆ temp2_y

POSITION temp2_y[MAX_SHORT]
static

◆ travel

travel_type travel