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

オブジェクトの実装 / Object code, part 1 [詳細]

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

関数

void reset_visuals (void)
 オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists [詳細]
 
void object_flags (object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 オブジェクトのフラグ類を配列に与える Obtain the "flags" for an item [詳細]
 
void object_flags_known (object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 オブジェクトの明示されているフラグ類を取得する Obtain the "flags" for an item which are known to the player [詳細]
 
static cptr item_activation_dragon_breath (object_type *o_ptr)
 オブジェクトの発動効果名称を返す(サブルーチン/ブレス) [詳細]
 
static cptr item_activation_aux (object_type *o_ptr)
 オブジェクトの発動効果名称を返す(サブルーチン/汎用) [詳細]
 
cptr item_activation (object_type *o_ptr)
 オブジェクトの発動効果名称を返す(メインルーチン) / Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation" [詳細]
 
bool screen_object (object_type *o_ptr, u32b mode)
 オブジェクトの*鑑定*内容を詳述して表示する / Describe a "fully identified" item [詳細]
 
char index_to_label (int i)
 オブジェクト選択時の選択アルファベットラベルを返す / Convert an inventory index into a one character label [詳細]
 
s16b label_to_inven (int c)
 選択アルファベットラベルからプレイヤーの所持オブジェクトIDを返す / Convert a label into the index of an item in the "inven" [詳細]
 
static bool is_ring_slot (int i)
 プレイヤーの所持/装備オブジェクトIDが指輪枠かを返す / [詳細]
 
s16b label_to_equip (int c)
 選択アルファベットラベルからプレイヤーの装備オブジェクトIDを返す / Convert a label into the index of a item in the "equip" [詳細]
 
s16b wield_slot (object_type *o_ptr)
 オブジェクトの該当装備部位IDを返す / Determine which equipment slot (if any) an item likes [詳細]
 
cptr mention_use (int i)
 所持/装備オブジェクトIDの部位表現を返す / Return a string mentioning how a given item is carried [詳細]
 
cptr describe_use (int i)
 所持/装備オブジェクトIDの現在の扱い方の状態表現を返す / Return a string describing how a given item is being worn. [詳細]
 
bool check_book_realm (const byte book_tval, const byte book_sval)
 tval/sval指定のベースアイテムがプレイヤーの使用可能な魔法書かどうかを返す / Hack: Check if a spellbook is one of the realms we can use. [詳細]
 
bool item_tester_okay (object_type *o_ptr)
 アイテムがitem_tester_hookグローバル関数ポインタの条件を満たしているかを返す汎用関数 Check an item against the item tester info [詳細]
 
void display_inven (void)
 所持アイテム一覧を表示する / Choice window "shadow" of the "show_inven()" function [詳細]
 
void display_equip (void)
 装備アイテム一覧を表示する / Choice window "shadow" of the "show_equip()" function [詳細]
 
static bool get_tag (int *cp, char tag, int mode)
 所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" inventory object with the given "tag". [詳細]
 
static bool get_tag_floor (int *cp, char tag, int floor_list[], int floor_num)
 床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" inventory object with the given "tag". [詳細]
 
static void prepare_label_string (char *label, int mode)
 タグIDにあわせてタグアルファベットのリストを返す / Move around label characters with correspond tags [詳細]
 
static void prepare_label_string_floor (char *label, int floor_list[], int floor_num)
 タグIDにあわせてタグアルファベットのリストを返す(床上アイテム用) / Move around label characters with correspond tags (floor version) [詳細]
 
int show_inven (int target_item)
 所持アイテムの表示を行う / Display the inventory. [詳細]
 
int show_equip (int target_item)
 装備アイテムの表示を行う / Display the equipment. [詳細]
 
void toggle_inven_equip (void)
 サブウィンドウに所持品、装備品リストの表示を行う / Flip "inven" and "equip" in any sub-windows [詳細]
 
static bool verify (cptr prompt, int item)
 選択したアイテムの確認処理の補助 / Verify the choice of an item. [詳細]
 
static bool get_item_allow (int item)
 選択したアイテムの確認処理のメインルーチン / [詳細]
 
static bool get_item_okay (int i)
 プレイヤーの所持/装備オブジェクトが正規のものかを返す / Auxiliary function for "get_item()" – test an index [詳細]
 
bool can_get_item (void)
 プレイヤーがオブジェクトを拾うことができる状態かを返す / Determine whether get_item() can get some item or not [詳細]
 
bool get_item (int *cp, cptr pmt, cptr str, int mode)
 オブジェクト選択の汎用関数 / Let the user select an item, save its "index" [詳細]
 
int scan_floor (int *items, int y, int x, int mode)
 床下に落ちているオブジェクトの数を返す / scan_floor [詳細]
 
int show_floor (int target_item, int y, int x, int *min_width)
 床下に落ちているアイテムの一覧を返す / Display a list of the items on the floor at the given location. [詳細]
 
bool get_item_floor (int *cp, cptr pmt, cptr str, int mode)
 オブジェクト選択の汎用関数(床上アイテム用) / Let the user select an item, save its "index" [詳細]
 
static bool py_pickup_floor_aux (void)
 床上のアイテムを拾う選択用サブルーチン [詳細]
 
void py_pickup_floor (bool pickup)
 床上のアイテムを拾うメイン処理 [詳細]
 

変数

bool select_ring_slot
 See cmd5.c. [詳細]
 

説明

オブジェクトの実装 / Object code, part 1

日付
2014/01/10
作者
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.
2014 Deskull rearranged comment for Doxygen.

関数

bool can_get_item ( void  )

プレイヤーがオブジェクトを拾うことができる状態かを返す / Determine whether get_item() can get some item or not

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

assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).

関数の呼び出しグラフ:

呼出しグラフ:

bool check_book_realm ( const byte  book_tval,
const byte  book_sval 
)

tval/sval指定のベースアイテムがプレイヤーの使用可能な魔法書かどうかを返す / Hack: Check if a spellbook is one of the realms we can use.

– TY

引数
book_tvalベースアイテムのtval
book_svalベースアイテムのsval
戻り値
使用可能な魔法書ならばTRUEを返す。

呼出しグラフ:

cptr 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 inventory.

呼出しグラフ:

void display_equip ( void  )

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

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void display_inven ( void  )

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

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

bool get_item ( int *  cp,
cptr  pmt,
cptr  str,
int  mode 
)

オブジェクト選択の汎用関数 / 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,
inventory, or floor, respectively, if the proper flag was given,
and there are any acceptable items in that location.

The equipment or inventory 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 inventory/equipment item,
and prompt for its use.

If a legal item is selected from the inventory, 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 inventory 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 inventory, 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.

関数の呼び出しグラフ:

static bool get_item_allow ( int  item)
static

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

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

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

関数の呼び出しグラフ:

呼出しグラフ:

bool get_item_floor ( int *  cp,
cptr  pmt,
cptr  str,
int  mode 
)

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

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

関数の呼び出しグラフ:

呼出しグラフ:

static bool get_item_okay ( int  i)
static

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

引数
i選択アイテムID
戻り値
正規のIDならばTRUEを返す。

関数の呼び出しグラフ:

呼出しグラフ:

static bool get_tag ( int *  cp,
char  tag,
int  mode 
)
static

所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" inventory 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.

関数の呼び出しグラフ:

呼出しグラフ:

static bool get_tag_floor ( int *  cp,
char  tag,
int  floor_list[],
int  floor_num 
)
static

床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す / Find the "first" inventory 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.

関数の呼び出しグラフ:

呼出しグラフ:

char index_to_label ( int  i)

オブジェクト選択時の選択アルファベットラベルを返す / Convert an inventory index into a one character label

引数
iプレイヤーの所持/装備オブジェクトID
戻り値
対応するアルファベット

Note that the label does NOT distinguish inven/equip.

呼出しグラフ:

static bool is_ring_slot ( int  i)
static

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

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

呼出しグラフ:

cptr item_activation ( object_type o_ptr)

オブジェクトの発動効果名称を返す(メインルーチン) / Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation"

引数
o_ptr名称を取得する元のオブジェクト構造体参照ポインタ
戻り値
cptr 発動名称を返す文字列ポインタ

関数の呼び出しグラフ:

呼出しグラフ:

static cptr item_activation_aux ( object_type o_ptr)
static

オブジェクトの発動効果名称を返す(サブルーチン/汎用)

引数
o_ptr名称を取得する元のオブジェクト構造体参照ポインタ
戻り値
cptr 発動名称を返す文字列ポインタ

関数の呼び出しグラフ:

呼出しグラフ:

static cptr item_activation_dragon_breath ( object_type o_ptr)
static

オブジェクトの発動効果名称を返す(サブルーチン/ブレス)

引数
o_ptr名称を取得する元のオブジェクト構造体参照ポインタ
戻り値
cptr 発動名称を返す文字列ポインタ

関数の呼び出しグラフ:

呼出しグラフ:

bool item_tester_okay ( object_type o_ptr)

アイテムがitem_tester_hookグローバル関数ポインタの条件を満たしているかを返す汎用関数 Check an item against the item tester info

引数
o_ptr判定を行いたいオブジェクト構造体参照ポインタ
戻り値
item_tester_hookの参照先、その他いくつかの例外に応じてTRUE/FALSEを返す。

関数の呼び出しグラフ:

呼出しグラフ:

s16b label_to_equip ( int  c)

選択アルファベットラベルからプレイヤーの装備オブジェクト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

関数の呼び出しグラフ:

呼出しグラフ:

s16b label_to_inven ( int  c)

選択アルファベットラベルからプレイヤーの所持オブジェクト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.

呼出しグラフ:

cptr mention_use ( int  i)

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

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

呼出しグラフ:

void object_flags ( object_type o_ptr,
u32b  flgs[TR_FLAG_SIZE] 
)

オブジェクトのフラグ類を配列に与える Obtain the "flags" for an item

引数
o_ptrフラグ取得元のオブジェクト構造体ポインタ
flgsフラグ情報を受け取る配列
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

void object_flags_known ( object_type o_ptr,
u32b  flgs[TR_FLAG_SIZE] 
)

オブジェクトの明示されているフラグ類を取得する Obtain the "flags" for an item which are known to the player

引数
o_ptrフラグ取得元のオブジェクト構造体ポインタ
flgsフラグ情報を受け取る配列
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void prepare_label_string ( char *  label,
int  mode 
)
static

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

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

関数の呼び出しグラフ:

呼出しグラフ:

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

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

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

関数の呼び出しグラフ:

呼出しグラフ:

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.

関数の呼び出しグラフ:

呼出しグラフ:

static bool py_pickup_floor_aux ( void  )
static

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

戻り値
プレイヤーによりアイテムが選択されたならTRUEを返す。

関数の呼び出しグラフ:

呼出しグラフ:

void reset_visuals ( void  )

オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists

戻り値
なし This involves resetting various things to their "default" state.

If the "prefs" flag is TRUE, then we will also load the appropriate
"user pref file" based on the current setting of the "use_graphics"
flag. This is useful for switching "graphics" on/off.

The features, objects, and monsters, should all be encoded in the
relevant "font.pref" and/or "graf.prf" files. XXX XXX XXX

The "prefs" parameter is no longer meaningful. XXX XXX XXX

関数の呼び出しグラフ:

呼出しグラフ:

int scan_floor ( int *  items,
int  y,
int  x,
int  mode 
)

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

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

Return a list of o_list[] indexes of items at the given cave location. Valid flags are:

mode & 0x01 -- Item tester
mode & 0x02 -- Marked items only
mode & 0x04 -- Stop after first

関数の呼び出しグラフ:

呼出しグラフ:

bool screen_object ( object_type o_ptr,
u32b  mode 
)

オブジェクトの*鑑定*内容を詳述して表示する / Describe a "fully identified" item

引数
o_ptr*鑑定*情報を取得する元のオブジェクト構造体参照ポインタ
mode表示オプション
戻り値
特筆すべき情報が一つでもあった場合TRUE、一つもなく表示がキャンセルされた場合FALSEを返す。

関数の呼び出しグラフ:

呼出しグラフ:

int show_equip ( int  target_item)

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

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

関数の呼び出しグラフ:

呼出しグラフ:

int show_floor ( int  target_item,
int  y,
int  x,
int *  min_width 
)

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

引数
target_itemカーソルの初期値
y走査するフロアのY座標
x走査するフロアのX座標
min_width表示の長さ
戻り値
選択したアイテムのID

関数の呼び出しグラフ:

呼出しグラフ:

int show_inven ( int  target_item)

所持アイテムの表示を行う / Display the inventory.

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

Hack – do not display "trailing" empty slots

関数の呼び出しグラフ:

呼出しグラフ:

void toggle_inven_equip ( void  )

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

戻り値
なし

呼出しグラフ:

static bool verify ( cptr  prompt,
int  item 
)
static

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

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

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

関数の呼び出しグラフ:

呼出しグラフ:

s16b wield_slot ( object_type o_ptr)

オブジェクトの該当装備部位IDを返す / Determine which equipment slot (if any) an item likes

引数
o_ptr名称を取得する元のオブジェクト構造体参照ポインタ
戻り値
対応する装備部位ID

呼出しグラフ:

変数

bool select_ring_slot

See cmd5.c.