2 * @brief オブジェクトに関する汎用判定処理
7 #include "object/item-tester-hooker.h"
8 #include "object/object-info.h"
9 #include "system/object-type-definition.h"
10 #include "system/player-type-definition.h"
11 #include "target/target-describer.h"
14 * Used during calls to "get_item()" and "show_inven()" and "show_equip()", and the choice window routines.
16 bool (*item_tester_hook)(player_type *, object_type *);
19 * @brief アイテムがitem_tester_hookグローバル関数ポインタの条件を満たしているかを返す汎用関数
20 * Check an item against the item tester info
21 * @param o_ptr 判定を行いたいオブジェクト構造体参照ポインタ
22 * @return item_tester_hookの参照先が特にないならTRUE、その他いくつかの例外に応じてTRUE/FALSEを返す。
24 bool item_tester_okay(player_type *player_ptr, object_type *o_ptr, tval_type tval)
29 if (o_ptr->tval == TV_GOLD) {
30 if (!show_gold_on_floor)
35 if ((tval <= TV_DEATH_BOOK) && (tval >= TV_LIFE_BOOK))
36 return check_book_realm(player_ptr, o_ptr->tval, o_ptr->sval);
37 else if (tval != o_ptr->tval)
41 if (item_tester_hook == NULL)
44 return (*item_tester_hook)(player_ptr, o_ptr);