Hengband
2.2.1
|
#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"
マクロ定義 | |
#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] |
#define boundary_floor | ( | C, | |
F, | |||
MF | |||
) |
#define TRAVEL_UNABLE 9999 |
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.
地形やその上のアイテムの隠された要素を全て明かす / Search for hidden things
y | 対象となるマスのY座標 |
x | 対象となるマスのX座標 |
void disturb | ( | player_type * | creature_ptr, |
bool | stop_search, | ||
bool | stop_travel | ||
) |
void do_cmd_travel | ( | player_type * | creature_ptr | ) |
トラベル処理のメインルーチン
void forget_travel_flow | ( | void | ) |
トラベル処理の記憶配列を初期化する Hack: forget the "flow" information
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 |
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.
bool move_player_effect | ( | player_type * | creature_ptr, |
POSITION | ny, | ||
POSITION | nx, | ||
BIT_FLAGS | mpe_mode | ||
) |
移動に伴うプレイヤーのステータス変化処理
ny | 移動先Y座標 |
nx | 移動先X座標 |
mpe_mode | 移動オプションフラグ |
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座標 |
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.
|
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
void run_step | ( | DIRECTION | dir | ) |
継続的なダッシュ処理 / Take one step along the current "run" path
dir | 移動を試みる方向ID |
|
static |
ダッシュ移動が継続できるかどうかの判定 / Update the current "run" path
void search | ( | player_type * | creature_ptr | ) |
プレイヤーの探索処理判定
ダッシュ移動処理中、移動先のマスか未知の地形かどうかを判定する / Hack – Check for an "unknown corner" (see below)
dir | 想定する移動方向ID |
y | 移動元のY座標 |
x | 移動元のX座標 |
ダッシュ移動処理中、移動先のマスが既知の壁かどうかを判定する / Hack – Check for a "known wall" (see below)
dir | 想定する移動方向ID |
y | 移動元のY座標 |
x | 移動元のX座標 |
bool trap_can_be_ignored | ( | player_type * | creature_ptr, |
FEAT_IDX | feat | ||
) |
該当地形のトラップがプレイヤーにとって無効かどうかを判定して返す
feat | 地形ID |
トラベル処理の到達地点までの行程を得る処理のメインルーチン
ty | 目標地点のY座標 |
tx | 目標地点のX座標 |
トラベル処理の到達地点までの行程を得る処理のサブルーチン
y | 目標地点のY座標 |
x | 目標地点のX座標 |
n | 現在のコスト |
wall | プレイヤーが壁の中にいるならばTRUE |
トラベル処理中に地形に応じた移動コスト基準を返す
y | 該当地点のY座標 |
x | 該当地点のX座標 |
void travel_step | ( | void | ) |
トラベル機能の実装 / Travel command
トラベル機能の判定処理 / Test for traveling
prev_dir | 前回移動を行った元の方角ID |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
travel_type travel |