Hengband  2.2.1
関数 | 変数
player-inventory.c ファイル
#include "angband.h"
#include "core.h"
#include "util.h"
#include "player-inventory.h"
#include "term.h"
#include "object.h"
#include "objectkind.h"
#include "object-flavor.h"
#include "object-hook.h"
#include "floor.h"
#include "player-move.h"
#include "view-mainwindow.h"
player-inventory.c の依存先関係図:

関数

bool is_ring_slot (int i)
 プレイヤーの所持/装備オブジェクトIDが指輪枠かを返す / [詳解]
 
static INVENTORY_IDX label_to_equip (int c)
 選択アルファベットラベルからプレイヤーの装備オブジェクトIDを返す / Convert a label into the index of a item in the "equip" [詳解]
 
static INVENTORY_IDX label_to_inven (int c)
 選択アルファベットラベルからプレイヤーの所持オブジェクトIDを返す / Convert a label into the index of an item in the "inven" [詳解]
 
static concptr mention_use (player_type *creature_ptr, int i)
 所持/装備オブジェクトIDの部位表現を返す / Return a string mentioning how a given item is carried [詳解]
 
void display_equip (OBJECT_TYPE_VALUE tval)
 装備アイテム一覧を表示する / Choice window "shadow" of the "show_equip()" function [詳解]
 
void toggle_inven_equip (player_type *creature_ptr)
 サブウィンドウに所持品、装備品リストの表示を行う / Flip "inven" and "equip" in any sub-windows [詳解]
 
bool get_item_okay (OBJECT_IDX i)
 プレイヤーの所持/装備オブジェクトが正規のものかを返す / Auxiliary function for "get_item()" – test an index [詳解]
 
bool can_get_item (OBJECT_TYPE_VALUE tval)
 規定の処理にできるアイテムがプレイヤーの利用可能範囲内にあるかどうかを返す / Determine whether get_item() can get some item or not [詳解]
 
static bool get_tag_floor (COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" p_ptr->inventory_list object with the given "tag". [詳解]
 
static bool get_tag (COMMAND_CODE *cp, char tag, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" p_ptr->inventory_list object with the given "tag". [詳解]
 
void prepare_label_string (char *label, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 タグIDにあわせてタグアルファベットのリストを返す / Move around label characters with correspond tags [詳解]
 
static void prepare_label_string_floor (char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 タグIDにあわせてタグアルファベットのリストを返す(床上アイテム用) / Move around label characters with correspond tags (floor version) [詳解]
 
COMMAND_CODE show_inven (int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 所持アイテムの表示を行う / Display the p_ptr->inventory_list. [詳解]
 
static bool verify (concptr prompt, INVENTORY_IDX item)
 選択したアイテムの確認処理の補助 / Verify the choice of an item. [詳解]
 
static bool get_item_allow (INVENTORY_IDX item)
 選択したアイテムの確認処理のメインルーチン / [詳解]
 
bool get_item (OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 オブジェクト選択の汎用関数 / Let the user select an item, save its "index" [詳解]
 
object_typechoose_object (player_type *creature_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
 
ITEM_NUMBER scan_floor (OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode)
 床下に落ちているオブジェクトの数を返す / scan_floor [詳解]
 
COMMAND_CODE show_floor (int target_item, POSITION y, POSITION x, TERM_LEN *min_width)
 床下に落ちているアイテムの一覧を返す / Display a list of the items on the floor at the given location. [詳解]
 
bool get_item_floor (COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 オブジェクト選択の汎用関数(床上アイテム用) / Let the user select an item, save its "index" [詳解]
 
static bool py_pickup_floor_aux (void)
 床上のアイテムを拾う選択用サブルーチン [詳解]
 
void py_pickup_floor (bool pickup)
 床上のアイテムを拾うメイン処理 [詳解]
 
void display_inven (OBJECT_TYPE_VALUE tval)
 所持アイテム一覧を表示する / Choice window "shadow" of the "show_inven()" function [詳解]
 
COMMAND_CODE show_equip (int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
 装備アイテムの表示を行う / Display the equipment. [詳解]
 
concptr describe_use (int i)
 所持/装備オブジェクトIDの現在の扱い方の状態表現を返す / Return a string describing how a given item is being worn. [詳解]
 

変数

bool select_ring_slot
 

関数詳解

◆ can_get_item()

bool can_get_item ( OBJECT_TYPE_VALUE  tval)

規定の処理にできるアイテムがプレイヤーの利用可能範囲内にあるかどうかを返す / Determine whether get_item() can get some item or not

戻り値
アイテムを拾えるならばTRUEを返す。

assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).

呼び出し関係図:

◆ choose_object()

object_type* choose_object ( player_type creature_ptr,
OBJECT_IDX idx,
concptr  q,
concptr  s,
BIT_FLAGS  option,
OBJECT_TYPE_VALUE  tval 
)
呼び出し関係図:

◆ describe_use()

concptr describe_use ( int  i)

所持/装備オブジェクトIDの現在の扱い方の状態表現を返す / Return a string describing how a given item is being worn.

引数
i状態表現を求めるプレイヤーの所持/装備オブジェクトID
戻り値
状態表現内容の文字列ポインタ

Currently, only used for items in the equipment, not p_ptr->inventory_list.

◆ display_equip()

void display_equip ( OBJECT_TYPE_VALUE  tval)

装備アイテム一覧を表示する / Choice window "shadow" of the "show_equip()" function

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

◆ display_inven()

void display_inven ( OBJECT_TYPE_VALUE  tval)

所持アイテム一覧を表示する / Choice window "shadow" of the "show_inven()" function

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

◆ get_item()

bool get_item ( OBJECT_IDX cp,
concptr  pmt,
concptr  str,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)

オブジェクト選択の汎用関数 / Let the user select an item, save its "index"

引数
cp選択したオブジェクトのIDを返す。
pmt選択目的のメッセージ
str選択できるオブジェクトがない場合のキャンセルメッセージ
modeオプションフラグ
戻り値
プレイヤーによりアイテムが選択されたならTRUEを返す。/ Return TRUE only if an acceptable item was chosen by the user.

The selected item must satisfy the "item_tester_hook()" function,
if that hook is set, and the "item_tester_tval", if that value is set.

All "item_tester" restrictions are cleared before this function returns.

The user is allowed to choose acceptable items from the equipment,
p_ptr->inventory_list, or floor, respectively, if the proper flag was given,
and there are any acceptable items in that location.

The equipment or p_ptr->inventory_list are displayed (even if no acceptable
items are in that location) if the proper flag was given.

If there are no acceptable items available anywhere, and "str" is
not NULL, then it will be used as the text of a warning message
before the function returns.

Note that the user must press "-" to specify the item on the floor,
and there is no way to "examine" the item on the floor, while the
use of "capital" letters will "examine" an p_ptr->inventory_list/equipment item,
and prompt for its use.

If a legal item is selected from the p_ptr->inventory_list, we save it in "cp"
directly (0 to 35), and return TRUE.

If a legal item is selected from the floor, we save it in "cp" as
a negative (-1 to -511), and return TRUE.

If no item is available, we do nothing to "cp", and we display a
warning message, using "str" if available, and return FALSE.

If no item is selected, we do nothing to "cp", and return FALSE.

Global "p_ptr->command_new" is used when viewing the p_ptr->inventory_list or equipment
to allow the user to enter a command while viewing those screens, and
also to induce "auto-enter" of stores, and other such stuff.

Global "p_ptr->command_see" may be set before calling this function to start
out in "browse" mode. It is cleared before this function returns.

Global "p_ptr->command_wrk" is used to choose between equip/inven listings.
If it is TRUE then we are viewing p_ptr->inventory_list, else equipment.

We always erase the prompt when we are done, leaving a blank line,
or a warning message, if appropriate, if no items are available.

呼び出し関係図:

◆ get_item_allow()

static bool get_item_allow ( INVENTORY_IDX  item)
static

選択したアイテムの確認処理のメインルーチン /

引数
item選択アイテムID
戻り値
確認がYesならTRUEを返す。

The item can be negative to mean "item on floor". Hack – allow user to "prevent" certain choices

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

◆ get_item_floor()

bool get_item_floor ( COMMAND_CODE cp,
concptr  pmt,
concptr  str,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)

オブジェクト選択の汎用関数(床上アイテム用) / Let the user select an item, save its "index"

引数
cp選択したオブジェクトのIDを返す。
pmt選択目的のメッセージ
str選択できるオブジェクトがない場合のキャンセルメッセージ
modeオプションフラグ
戻り値
プレイヤーによりアイテムが選択されたならTRUEを返す。/
呼び出し関係図:

◆ get_item_okay()

bool get_item_okay ( OBJECT_IDX  i)

プレイヤーの所持/装備オブジェクトが正規のものかを返す / Auxiliary function for "get_item()" – test an index

引数
i選択アイテムID
戻り値
正規のIDならばTRUEを返す。
呼び出し関係図:

◆ get_tag()

static bool get_tag ( COMMAND_CODE cp,
char  tag,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)
static

所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" p_ptr->inventory_list object with the given "tag".

引数
cp対応するタグIDを与える参照ポインタ
tag該当するオブジェクトがあるかを調べたいタグ
mode所持、装備の切り替え
戻り値
タグに該当するオブジェクトがあるならTRUEを返す

A "tag" is a numeral "n" appearing as "@n" anywhere in the
inscription of an object. Alphabetical characters don't work as a
tag in this form.

Also, the tag "@xn" will work as well, where "n" is a any tag-char,
and "x" is the "current" command_cmd code.

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

◆ get_tag_floor()

static bool get_tag_floor ( COMMAND_CODE cp,
char  tag,
FLOOR_IDX  floor_list[],
ITEM_NUMBER  floor_num 
)
static

床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" p_ptr->inventory_list object with the given "tag".

引数
cp対応するタグIDを与える参照ポインタ
tag該当するオブジェクトがあるかを調べたいタグ
floor_list床上アイテムの配列
floor_num床上アイテムの配列ID
戻り値
タグに該当するオブジェクトがあるならTRUEを返す

A "tag" is a numeral "n" appearing as "@n" anywhere in the
inscription of an object. Alphabetical characters don't work as a
tag in this form.

Also, the tag "@xn" will work as well, where "n" is a any tag-char,
and "x" is the "current" command_cmd code.

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

◆ is_ring_slot()

bool is_ring_slot ( int  i)

プレイヤーの所持/装備オブジェクトIDが指輪枠かを返す /

引数
iプレイヤーの所持/装備オブジェクトID
戻り値
指輪枠ならばTRUEを返す。

◆ label_to_equip()

static INVENTORY_IDX label_to_equip ( int  c)
static

選択アルファベットラベルからプレイヤーの装備オブジェクトIDを返す / Convert a label into the index of a item in the "equip"

戻り値
対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item
呼び出し関係図:
被呼び出し関係図:

◆ label_to_inven()

static INVENTORY_IDX label_to_inven ( int  c)
static

選択アルファベットラベルからプレイヤーの所持オブジェクトIDを返す / Convert a label into the index of an item in the "inven"

戻り値
対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item

Note that the label does NOT distinguish inven/equip.

被呼び出し関係図:

◆ mention_use()

static concptr mention_use ( player_type creature_ptr,
int  i 
)
static

所持/装備オブジェクトIDの部位表現を返す / Return a string mentioning how a given item is carried

引数
i部位表現を求めるプレイヤーの所持/装備オブジェクトID
戻り値
部位表現の文字列ポインタ
被呼び出し関係図:

◆ prepare_label_string()

void prepare_label_string ( char *  label,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)

タグIDにあわせてタグアルファベットのリストを返す / Move around label characters with correspond tags

引数
labelラベルリストを取得する文字列参照ポインタ
mode所持品リストか装備品リストかの切り替え
戻り値
なし
呼び出し関係図:

◆ prepare_label_string_floor()

static void prepare_label_string_floor ( char *  label,
FLOOR_IDX  floor_list[],
ITEM_NUMBER  floor_num 
)
static

タグIDにあわせてタグアルファベットのリストを返す(床上アイテム用) / Move around label characters with correspond tags (floor version)

引数
labelラベルリストを取得する文字列参照ポインタ
floor_list床上アイテムの配列
floor_num床上アイテムの配列ID
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ py_pickup_floor()

void py_pickup_floor ( bool  pickup)

床上のアイテムを拾うメイン処理

引数
pickupFALSEなら金銭の自動拾いのみを行う/ FALSE then only gold will be picked up
戻り値
なし

This is called by py_pickup() when easy_floor is TRUE.

呼び出し関係図:

◆ py_pickup_floor_aux()

static bool py_pickup_floor_aux ( void  )
static

床上のアイテムを拾う選択用サブルーチン

戻り値
プレイヤーによりアイテムが選択されたならTRUEを返す。
呼び出し関係図:
被呼び出し関係図:

◆ scan_floor()

ITEM_NUMBER scan_floor ( OBJECT_IDX items,
POSITION  y,
POSITION  x,
BIT_FLAGS  mode 
)

床下に落ちているオブジェクトの数を返す / scan_floor

引数
itemsオブジェクトのIDリストを返すための配列参照ポインタ
y走査するフロアのY座標
x走査するフロアのX座標
modeオプションフラグ
戻り値
対象のマスに落ちているアイテム数

Return a list of o_list[] indexes of items at the given p_ptr->current_floor_ptr->grid_array location. Valid flags are:

mode & 0x01 -- Item tester
mode & 0x02 -- Marked items only
mode & 0x04 -- Stop after first
呼び出し関係図:

◆ show_equip()

COMMAND_CODE show_equip ( int  target_item,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)

装備アイテムの表示を行う / Display the equipment.

引数
target_itemアイテムの選択処理を行うか否か。
戻り値
選択したアイテムのタグ
呼び出し関係図:

◆ show_floor()

COMMAND_CODE show_floor ( int  target_item,
POSITION  y,
POSITION  x,
TERM_LEN min_width 
)

床下に落ちているアイテムの一覧を返す / Display a list of the items on the floor at the given location.

引数
target_itemカーソルの初期値
y走査するフロアのY座標
x走査するフロアのX座標
min_width表示の長さ
戻り値
選択したアイテムの添え字
呼び出し関係図:

◆ show_inven()

COMMAND_CODE show_inven ( int  target_item,
BIT_FLAGS  mode,
OBJECT_TYPE_VALUE  tval 
)

所持アイテムの表示を行う / Display the p_ptr->inventory_list.

引数
target_itemアイテムの選択処理を行うか否か。
戻り値
選択したアイテムのタグ

Hack – do not display "trailing" empty slots

呼び出し関係図:

◆ toggle_inven_equip()

void toggle_inven_equip ( player_type creature_ptr)

サブウィンドウに所持品、装備品リストの表示を行う / Flip "inven" and "equip" in any sub-windows

戻り値
なし

◆ verify()

static bool verify ( concptr  prompt,
INVENTORY_IDX  item 
)
static

選択したアイテムの確認処理の補助 / Verify the choice of an item.

引数
promptメッセージ表示の一部
item選択アイテムID
戻り値
確認がYesならTRUEを返す。

The item can be negative to mean "item on floor".

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

変数詳解

◆ select_ring_slot

bool select_ring_slot