Hengband  2.1.4
 全て データ構造 ファイル 関数 変数 型定義 マクロ定義 ページ
関数
cmd2.c

プレイヤーのコマンド処理2 / Movement commands (part 2) [詳細]

#include "angband.h"
cmd2.cのインクルード依存関係図

関数

bool confirm_leave_level (bool down_stair)
 フロア脱出時に出戻りが不可能だった場合に警告を加える処理 [詳細]
 
void do_cmd_go_up (void)
 階段を使って階層を昇る処理 / Go up one level [詳細]
 
void do_cmd_go_down (void)
 階段を使って階層を降りる処理 / Go down one level [詳細]
 
void do_cmd_search (void)
 探索コマンドのメインルーチン / Simple command to "search" for one turn [詳細]
 
static s16b chest_check (int y, int x, bool trapped)
 該当のマスに存在している箱のオブジェクトIDを返す。 [詳細]
 
static void chest_death (bool scatter, int y, int x, s16b o_idx)
 箱からアイテムを引き出す / Allocates objects upon opening a chest -BEN- [詳細]
 
static void chest_trap (int y, int x, s16b o_idx)
 箱のトラップ処理 / Chests have traps too. [詳細]
 
static bool do_cmd_open_chest (int y, int x, s16b o_idx)
 箱を開けるコマンドのメインルーチン / Attempt to open the given chest at the given location [詳細]
 
static bool is_open (int feat)
 地形は開くものであって、かつ開かれているかを返す / Attempt to open the given chest at the given location [詳細]
 
static int count_dt (int *y, int *x, bool(*test)(int feat), bool under)
 プレイヤーの周辺9マスに該当する地形がいくつあるかを返す / Attempt to open the given chest at the given location [詳細]
 
static int count_chests (int *y, int *x, bool trapped)
 プレイヤーの周辺9マスに箱のあるマスがいくつあるかを返す / Return the number of chests around (or under) the character. [詳細]
 
static int coords_to_dir (int y, int x)
 プレイヤーから指定の座標がどの方角にあるかを返す / Convert an adjacent location to a direction. [詳細]
 
static bool do_cmd_open_aux (int y, int x)
 「開ける」動作コマンドのサブルーチン / Perform the basic "open" command on doors [詳細]
 
void do_cmd_open (void)
 「開ける」コマンドのメインルーチン / Open a closed/locked/jammed door or a closed/locked chest. [詳細]
 
static bool do_cmd_close_aux (int y, int x)
 「閉じる」動作コマンドのサブルーチン / Perform the basic "close" command [詳細]
 
void do_cmd_close (void)
 「閉じる」コマンドのメインルーチン / Close an open door. [詳細]
 
static bool do_cmd_tunnel_test (int y, int x)
 「掘る」コマンドを該当のマスに行えるかの判定と結果メッセージの表示 / Determine if a given grid may be "tunneled" [詳細]
 
static bool do_cmd_tunnel_aux (int y, int x)
 「掘る」動作コマンドのサブルーチン / Perform the basic "tunnel" command [詳細]
 
void do_cmd_tunnel (void)
 「掘る」動作コマンドのメインルーチン / Tunnels through "walls" (including rubble and closed doors) [詳細]
 
bool easy_open_door (int y, int x)
 移動処理による簡易な「開く」処理 / easy_open_door – [詳細]
 
static bool do_cmd_disarm_chest (int y, int x, s16b o_idx)
 箱のトラップを解除するコマンドのメインルーチン / Perform the basic "disarm" command [詳細]
 
bool do_cmd_disarm_aux (int y, int x, int dir)
 箱のトラップを解除するコマンドのサブルーチン / Perform the basic "disarm" command [詳細]
 
void do_cmd_disarm (void)
 箱、床のトラップ解除処理双方の統合メインルーチン / Disarms a trap, or chest [詳細]
 
static bool do_cmd_bash_aux (int y, int x, int dir)
 「打ち破る」動作コマンドのサブルーチン / Perform the basic "bash" command [詳細]
 
void do_cmd_bash (void)
 「打ち破る」動作コマンドのメインルーチン / Bash open a door, success based on character strength [詳細]
 
void do_cmd_alter (void)
 特定のマスに影響を及ぼすための汎用的コマンド [詳細]
 
static bool get_spike (int *ip)
 「くさびを打つ」ために必要なオブジェクトがあるかどうかの判定を返す / Find the index of some "spikes", if possible. [詳細]
 
void do_cmd_spike (void)
 「くさびを打つ」動作コマンドのメインルーチン / Jam a closed door with a spike [詳細]
 
void do_cmd_walk (bool pickup)
 「歩く」動作コマンドのメインルーチン / Support code for the "Walk" and "Jump" commands [詳細]
 
void do_cmd_run (void)
 「走る」動作コマンドのメインルーチン / Start running. [詳細]
 
void do_cmd_stay (bool pickup)
 「留まる」動作コマンドのメインルーチン / Stay still. [詳細]
 
void do_cmd_rest (void)
 「休む」動作コマンドのメインルーチン / Resting allows a player to safely restore his hp -RAK- [詳細]
 
static int breakage_chance (object_type *o_ptr)
 矢弾を射撃した場合の破損確率を返す / Determines the odds of an object breaking when thrown at a monster [詳細]
 
static s16b tot_dam_aux_shot (object_type *o_ptr, int tdam, monster_type *m_ptr)
 矢弾を射撃した際のスレイ倍率をかけた結果を返す / Determines the odds of an object breaking when thrown at a monster [詳細]
 
void do_cmd_fire_aux (int item, object_type *j_ptr)
 射撃処理のサブルーチン / Fire an object from the pack or floor. [詳細]
 
void do_cmd_fire (void)
 射撃処理のメインルーチン [詳細]
 
static bool item_tester_hook_boomerang (object_type *o_ptr)
 オブジェクトが投射可能な武器かどうかを返す。 [詳細]
 
bool do_cmd_throw_aux (int mult, bool boomerang, int shuriken)
 投射処理のサブルーチン / Throw an object from the pack or floor. [詳細]
 
void do_cmd_throw (void)
 投射処理のメインルーチン / Throw an object from the pack or floor. [詳細]
 

説明

プレイヤーのコマンド処理2 / Movement commands (part 2)

日付
2014/01/02
作者
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

関数

static int breakage_chance ( object_type o_ptr)
static

矢弾を射撃した場合の破損確率を返す / Determines the odds of an object breaking when thrown at a monster

引数
o_ptr矢弾のオブジェクト構造体参照ポインタ
戻り値
破損確率(%)

Note that artifacts never break, see the "drop_near()" function.

呼出しグラフ:

static s16b chest_check ( int  y,
int  x,
bool  trapped 
)
static

該当のマスに存在している箱のオブジェクトIDを返す。

引数
y走査対象にしたいマスのY座標
x走査対象にしたいマスのX座標
trappedTRUEならばトラップが存在する箱のみ、FALSEならば空でない箱全てを対象にする
戻り値
箱が存在する場合そのオブジェクトID、存在しない場合0を返す。

呼出しグラフ:

static void chest_death ( bool  scatter,
int  y,
int  x,
s16b  o_idx 
)
static

箱からアイテムを引き出す / Allocates objects upon opening a chest -BEN-

引数
scatterTRUEならばトラップによるアイテムの拡散処理
y箱の存在するマスのY座標
x箱の存在するマスのX座標
o_idx箱のオブジェクトID
戻り値
なし
Disperse treasures from the given chest, centered at (x,y).
Small chests often contain "gold", while Large chests always contain
items.  Wooden chests contain 2 items, Iron chests contain 4 items,
and Steel chests contain 6 items.  The "value" of the items in a
chest is based on the "power" of the chest, which is in turn based
on the level on which the chest is generated.

関数の呼び出しグラフ:

呼出しグラフ:

static void chest_trap ( int  y,
int  x,
s16b  o_idx 
)
static

箱のトラップ処理 / Chests have traps too.

引数
y箱の存在するマスのY座標
x箱の存在するマスのX座標
o_idx箱のオブジェクトID
戻り値
なし
Exploding chest destroys contents (and traps).
Note that the chest itself is never destroyed.

関数の呼び出しグラフ:

呼出しグラフ:

bool confirm_leave_level ( bool  down_stair)

フロア脱出時に出戻りが不可能だった場合に警告を加える処理

引数
down_stairTRUEならば階段を降りる処理、FALSEなら階段を昇る処理による内容
戻り値
フロア移動を実際に行うならTRUE、キャンセルする場合はFALSE

関数の呼び出しグラフ:

呼出しグラフ:

static int coords_to_dir ( int  y,
int  x 
)
static

プレイヤーから指定の座標がどの方角にあるかを返す / Convert an adjacent location to a direction.

引数
y方角を確認したY座標
x方角を確認したX座標
戻り値
方向ID

呼出しグラフ:

static int count_chests ( int *  y,
int *  x,
bool  trapped 
)
static

プレイヤーの周辺9マスに箱のあるマスがいくつあるかを返す / Return the number of chests around (or under) the character.

引数
y該当するマスの中から1つのY座標を返す参照ポインタ
x該当するマスの中から1つのX座標を返す参照ポインタ
trappedTRUEならばトラップの存在が判明している箱のみ対象にする
戻り値
該当する地形の数

If requested, count only trapped chests.

関数の呼び出しグラフ:

呼出しグラフ:

static int count_dt ( int *  y,
int *  x,
bool(*)(int feat)  test,
bool  under 
)
static

プレイヤーの周辺9マスに該当する地形がいくつあるかを返す / Attempt to open the given chest at the given location

引数
y該当する地形の中から1つのY座標を返す参照ポインタ
x該当する地形の中から1つのX座標を返す参照ポインタ
test地形条件を判定するための関数ポインタ
underTRUEならばプレイヤーの直下の座標も走査対象にする
戻り値
該当する地形の数

Return the number of features around (or under) the character. Usually look for doors and floor traps.

呼出しグラフ:

void do_cmd_alter ( void  )

特定のマスに影響を及ぼすための汎用的コマンド

戻り値
なし
Manipulate an adjacent grid in some way
Attack monsters, tunnel through walls, disarm traps, open doors.
Consider confusion XXX XXX XXX
This command must always take a turn, to prevent free detection
of invisible monsters.

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_bash ( void  )

「打ち破る」動作コマンドのメインルーチン / Bash open a door, success based on character strength

戻り値
なし
For a closed door, pval is positive if locked; negative if stuck.
For an open door, pval is positive for a broken door.
A closed door can be opened - harder if locked. Any door might be
bashed open (and thereby broken). Bashing a door is (potentially)
faster! You move into the door way. To open a stuck door, it must
be bashed. A closed door can be jammed (see do_cmd_spike()).
Creatures can also open or bash doors, see elsewhere.

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_bash_aux ( int  y,
int  x,
int  dir 
)
static

「打ち破る」動作コマンドのサブルーチン / Perform the basic "bash" command

引数
y対象を行うマスのY座標
x対象を行うマスのX座標
dirプレイヤーから見たターゲットの方角ID
戻り値
実際に処理が行われた場合TRUEを返す。
Assume destination is a closed/locked/jammed door
Assume there is no monster blocking the destination
Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_close ( void  )

「閉じる」コマンドのメインルーチン / Close an open door.

戻り値
なし

Unlocking a locked door/chest is worth one experience point.

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_close_aux ( int  y,
int  x 
)
static

「閉じる」動作コマンドのサブルーチン / Perform the basic "close" command

引数
y対象を行うマスのY座標
x対象を行うマスのX座標
戻り値
実際に処理が行われた場合TRUEを返す。

Assume destination is an open/broken door Assume there is no monster blocking the destination Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_disarm ( void  )

箱、床のトラップ解除処理双方の統合メインルーチン / Disarms a trap, or chest

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

bool do_cmd_disarm_aux ( int  y,
int  x,
int  dir 
)

箱のトラップを解除するコマンドのサブルーチン / Perform the basic "disarm" command

引数
y解除を行うマスのY座標
x解除を行うマスのX座標
dirプレイヤーからみた方向ID
戻り値
ターンを消費する処理が行われた場合TRUEを返す
Assume destination is a visible trap
Assume there is no monster blocking the destination
Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_disarm_chest ( int  y,
int  x,
s16b  o_idx 
)
static

箱のトラップを解除するコマンドのメインルーチン / Perform the basic "disarm" command

引数
y解除を行うマスのY座標
x解除を行うマスのX座標
o_idx箱のオブジェクトID
戻り値
ターンを消費する処理が行われた場合TRUEを返す
Assume destination is a visible trap
Assume there is no monster blocking the destination
Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_fire ( void  )

射撃処理のメインルーチン

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_fire_aux ( int  item,
object_type j_ptr 
)

射撃処理のサブルーチン / Fire an object from the pack or floor.

引数
item射撃するオブジェクトの所持ID
j_ptr射撃武器のオブジェクト参照ポインタ
戻り値
なし
You may only fire items that "match" your missile launcher.
You must use slings + pebbles/shots, bows + arrows, xbows + bolts.
See "calc_bonuses()" for more calculations and such.
Note that "firing" a missile is MUCH better than "throwing" it.
Note: "unseen" monsters are very hard to hit.
Objects are more likely to break if they "attempt" to hit a monster.
Rangers (with Bows) and Anyone (with "Extra Shots") get extra shots.
The "extra shot" code works by decreasing the amount of energy
required to make each shot, spreading the shots out over time.
Note that when firing missiles, the launcher multiplier is applied
after all the bonuses are added in, making multipliers very useful.
Note that Bows of "Extra Might" get extra range and an extra bonus
for the damage multiplier.
Note that Bows of "Extra Shots" give an extra shot.

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_go_down ( void  )

階段を使って階層を降りる処理 / Go down one level

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_go_up ( void  )

階段を使って階層を昇る処理 / Go up one level

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_open ( void  )

「開ける」コマンドのメインルーチン / Open a closed/locked/jammed door or a closed/locked chest.

戻り値
なし

Unlocking a locked door/chest is worth one experience point.

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_open_aux ( int  y,
int  x 
)
static

「開ける」動作コマンドのサブルーチン / Perform the basic "open" command on doors

引数
y対象を行うマスのY座標
x対象を行うマスのX座標
戻り値
実際に処理が行われた場合TRUEを返す。

Assume destination is a closed/locked/jammed door Assume there is no monster blocking the destination Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_open_chest ( int  y,
int  x,
s16b  o_idx 
)
static

箱を開けるコマンドのメインルーチン / Attempt to open the given chest at the given location

引数
y箱の存在するマスのY座標
x箱の存在するマスのX座標
o_idx箱のオブジェクトID
戻り値
箱が開かなかった場合TRUE / Returns TRUE if repeated commands may continue

Assume there is no monster blocking the destination

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_rest ( void  )

「休む」動作コマンドのメインルーチン / Resting allows a player to safely restore his hp -RAK-

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_run ( void  )

「走る」動作コマンドのメインルーチン / Start running.

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_search ( void  )

探索コマンドのメインルーチン / Simple command to "search" for one turn

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_spike ( void  )

「くさびを打つ」動作コマンドのメインルーチン / Jam a closed door with a spike

戻り値
なし
This command may NOT be repeated

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_stay ( bool  pickup)

「留まる」動作コマンドのメインルーチン / Stay still.

Search. Enter stores. Pick up treasure if "pickup" is true.

引数
pickupアイテムの自動拾いを行うならTRUE
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_throw ( void  )

投射処理のメインルーチン / Throw an object from the pack or floor.

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

bool do_cmd_throw_aux ( int  mult,
bool  boomerang,
int  shuriken 
)

投射処理のサブルーチン / Throw an object from the pack or floor.

引数
mult威力の倍率
boomerangブーメラン処理ならばTRUE
shuriken忍者の手裏剣処理ならばTRUE
戻り値
ターンを消費した場合TRUEを返す
Note: "unseen" monsters are very hard to hit.
Should throwing a weapon do full damage?  Should it allow the magic
to hit bonus of the weapon to have an effect?  Should it ever cause
the item to be destroyed?  Should it do any damage at all?

呼出しグラフ:

void do_cmd_tunnel ( void  )

「掘る」動作コマンドのメインルーチン / Tunnels through "walls" (including rubble and closed doors)

戻り値
なし
Note that you must tunnel in order to hit invisible monsters
in walls, though moving into walls still takes a turn anyway.
Digging is very difficult without a "digger" weapon, but can be
accomplished by strong players using heavy weapons.

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_tunnel_aux ( int  y,
int  x 
)
static

「掘る」動作コマンドのサブルーチン / Perform the basic "tunnel" command

引数
y対象を行うマスのY座標
x対象を行うマスのX座標
戻り値
実際に処理が行われた場合TRUEを返す。

Assumes that no monster is blocking the destination Do not use twall anymore Returns TRUE if repeated commands may continue

関数の呼び出しグラフ:

呼出しグラフ:

static bool do_cmd_tunnel_test ( int  y,
int  x 
)
static

「掘る」コマンドを該当のマスに行えるかの判定と結果メッセージの表示 / Determine if a given grid may be "tunneled"

引数
y対象を行うマスのY座標
x対象を行うマスのX座標
戻り値

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_walk ( bool  pickup)

「歩く」動作コマンドのメインルーチン / Support code for the "Walk" and "Jump" commands

引数
pickupアイテムの自動拾いを行うならTRUE
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

bool easy_open_door ( int  y,
int  x 
)

移動処理による簡易な「開く」処理 / easy_open_door –

戻り値
開く処理が実際に試みられた場合TRUEを返す
 If there is a jammed/closed/locked door at the given location,
 then attempt to unlock/open it. Return TRUE if an attempt was
 made (successful or not), otherwise return FALSE.
 The code here should be nearly identical to that in
 do_cmd_open_test() and do_cmd_open_aux().

関数の呼び出しグラフ:

呼出しグラフ:

static bool get_spike ( int *  ip)
static

「くさびを打つ」ために必要なオブジェクトがあるかどうかの判定を返す / Find the index of some "spikes", if possible.

引数
ipくさびとして打てるオブジェクトのID
戻り値
オブジェクトがある場合TRUEを返す
XXX XXX XXX Let user choose a pile of spikes, perhaps?

呼出しグラフ:

static bool is_open ( int  feat)
static

地形は開くものであって、かつ開かれているかを返す / Attempt to open the given chest at the given location

引数
feat地形ID
戻り値
開いた地形である場合TRUEを返す / Return TRUE if the given feature is an open door

関数の呼び出しグラフ:

呼出しグラフ:

static bool item_tester_hook_boomerang ( object_type o_ptr)
static

オブジェクトが投射可能な武器かどうかを返す。

引数
o_ptr判定するオブジェクトの構造体参照ポインタ
戻り値
投射可能な武器ならばTRUE

呼出しグラフ:

static s16b tot_dam_aux_shot ( object_type o_ptr,
int  tdam,
monster_type m_ptr 
)
static

矢弾を射撃した際のスレイ倍率をかけた結果を返す / Determines the odds of an object breaking when thrown at a monster

引数
o_ptr矢弾のオブジェクト構造体参照ポインタ
tdam計算途中のダメージ量
m_ptr目標モンスターの構造体参照ポインタ
戻り値
スレイ倍率をかけたダメージ量

関数の呼び出しグラフ:

呼出しグラフ: