<ClCompile Include="..\..\src\mind\stances-table.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-bow.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-checker.c" />\r
+ <ClCompile Include="..\..\src\object-hook\hook-expendable.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-perception.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-weapon.c" />\r
<ClCompile Include="..\..\src\object-hook\hook-armor.c" />\r
<ClInclude Include="..\..\src\object-hook\hook-armor.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-bow.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-checker.h" />\r
+ <ClInclude Include="..\..\src\object-hook\hook-expendable.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-perception.h" />\r
<ClInclude Include="..\..\src\object-hook\hook-weapon.h" />\r
<ClInclude Include="..\..\src\player\bad-status-setter.h" />\r
<ClCompile Include="..\..\src\object-hook\hook-checker.c">
<Filter>object-hook</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\object-hook\hook-expendable.c">
+ <Filter>object-hook</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\object-hook\hook-checker.h">
<Filter>object-hook</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\object-hook\hook-expendable.h">
+ <Filter>object-hook</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
object-hook/hook-armor.c object-hook/hook-armor.h \
object-hook/hook-bow.c object-hook/hook-bow.h \
object-hook/hook-checker.c object-hook/hook-checker.h \
+ object-hook/hook-expendable.c object-hook/hook-expendable.h \
object-hook/hook-perception.c object-hook/hook-perception.h \
object-hook/hook-weapon.c object-hook/hook-weapon.h \
\
#include "monster-race/monster-race.h"
#include "object-enchant/object-ego.h"
#include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-expendable.h"
#include "object-hook/hook-weapon.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "main/sound-of-music.h"
#include "monster-race/monster-race.h"
#include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-expendable.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "object/object-generator.h"
#include "object-enchant/trc-types.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-expendable.h"
#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
#include "mutation/mutation.h"
+#include "object-hook/hook-expendable.h"
#include "object/item-use-flags.h"
-#include "perception/object-perception.h"
#include "object/object-broken.h"
#include "object/object-generator.h"
#include "object/object-hook.h"
-#include "object/object-kind.h"
#include "object/object-info.h"
-#include "sv-definition/sv-potion-types.h"
+#include "object/object-kind.h"
+#include "perception/object-perception.h"
#include "player/avatar.h"
#include "player/bad-status-setter.h"
#include "player/eldritch-horror.h"
#include "spell-realm/spells-hex.h"
#include "spell/spells-status.h"
#include "spell/spells3.h"
+#include "sv-definition/sv-potion-types.h"
#include "term/screen-processor.h"
#include "view/display-messages.h"
#include "main/sound-of-music.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
+#include "object-hook/hook-expendable.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object-enchant/special-object-flags.h"
#include "object-enchant/tr-types.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-expendable.h"
#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-broken.h"
#include "monster/monster-info.h"
#include "object-enchant/tr-types.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-expendable.h"
#include "object/object-broken.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
#include "floor/floor.h"
#include "inventory/inventory-object.h"
#include "mind/mind-mirror-master.h"
+#include "object-hook/hook-expendable.h"
#include "object/object-broken.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
--- /dev/null
+#include "object-hook/hook-expendable.h"
+#include "art-definition/art-accessory-types.h"
+#include "art-definition/art-armor-types.h"
+#include "monster-race/monster-race.h"
+#include "object-enchant/item-feeling.h"
+#include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
+#include "object/object-hook.h"
+#include "object/object-kind.h"
+#include "perception/object-perception.h"
+#include "player/mimic-info-table.h"
+#include "sv-definition/sv-lite-types.h"
+#include "sv-definition/sv-other-types.h"
+#include "system/object-type-definition.h"
+#include "util/string-processor.h"
+
+/*!
+ * @brief オブジェクトをプレイヤーが食べることができるかを判定する /
+ * Hook to determine if an object is eatable
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return 食べることが可能ならばTRUEを返す
+ */
+bool item_tester_hook_eatable(player_type *player_ptr, object_type *o_ptr)
+{
+ if (o_ptr->tval == TV_FOOD)
+ return TRUE;
+
+ if (is_specific_player_race(player_ptr, RACE_SKELETON) || is_specific_player_race(player_ptr, RACE_GOLEM)
+ || is_specific_player_race(player_ptr, RACE_ZOMBIE) || is_specific_player_race(player_ptr, RACE_SPECTRE)) {
+ if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
+ return TRUE;
+ } else if (is_specific_player_race(player_ptr, RACE_BALROG) || (mimic_info[player_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) {
+ if (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE && angband_strchr("pht", r_info[o_ptr->pval].d_char))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトをプレイヤーが飲むことができるかを判定する /
+ * Hook to determine if an object can be quaffed
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return 飲むことが可能ならばTRUEを返す
+ */
+bool item_tester_hook_quaff(player_type *player_ptr, object_type *o_ptr)
+{
+ if (o_ptr->tval == TV_POTION)
+ return TRUE;
+
+ if (is_specific_player_race(player_ptr, RACE_ANDROID) && (o_ptr->tval == TV_FLASK) && (o_ptr->sval == SV_FLASK_OIL))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトをプレイヤーが読むことができるかを判定する /
+ * Hook to determine if an object is readable
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return 読むことが可能ならばTRUEを返す
+ */
+bool item_tester_hook_readable(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if ((o_ptr->tval == TV_SCROLL) || (o_ptr->tval == TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトがランタンの燃料になるかどうかを判定する
+ * An "item_tester_hook" for refilling lanterns
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトがランタンの燃料になるならばTRUEを返す
+ */
+bool item_tester_refill_lantern(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if ((o_ptr->tval == TV_FLASK) || ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN)))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが松明に束ねられるかどうかを判定する
+ * An "item_tester_hook" for refilling torches
+ * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが松明に束ねられるならばTRUEを返す
+ */
+bool object_can_refill_torch(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief 破壊可能なアイテムかを返す /
+ * Determines whether an object can be destroyed, and makes fake inscription.
+ * @param o_ptr 破壊可能かを確認したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトが破壊可能ならばTRUEを返す
+ */
+bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Artifacts cannot be destroyed */
+ if (!object_is_artifact(o_ptr))
+ return TRUE;
+
+ if (!object_is_known(o_ptr)) {
+ byte feel = FEEL_SPECIAL;
+ if (object_is_cursed(o_ptr) || object_is_broken(o_ptr))
+ feel = FEEL_TERRIBLE;
+
+ o_ptr->feeling = feel;
+ o_ptr->ident |= IDENT_SENSE;
+ player_ptr->update |= (PU_COMBINE);
+ player_ptr->window |= (PW_INVEN | PW_EQUIP);
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが薬であるかを返す
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return オブジェクトが薬ならばTRUEを返す
+ */
+bool object_is_potion(object_type *o_ptr) { return (k_info[o_ptr->k_idx].tval == TV_POTION); }
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool item_tester_hook_eatable(player_type *player_ptr, object_type *o_ptr);
+bool item_tester_hook_quaff(player_type *player_ptr, object_type *o_ptr);
+bool item_tester_hook_readable(player_type *player_ptr, object_type *o_ptr);
+bool item_tester_refill_lantern(player_type *player_ptr, object_type *o_ptr);
+bool object_can_refill_torch(player_type *player_ptr, object_type *o_ptr);
+bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr);
+bool object_is_potion(object_type *o_ptr);
bool (*item_tester_hook)(player_type *, object_type *);
/*!
- * @brief オブジェクトをプレイヤーが食べることができるかを判定する /
- * Hook to determine if an object is eatable
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return 食べることが可能ならばTRUEを返す
- */
-bool item_tester_hook_eatable(player_type *player_ptr, object_type *o_ptr)
-{
- if (o_ptr->tval == TV_FOOD)
- return TRUE;
-
- if (is_specific_player_race(player_ptr, RACE_SKELETON) || is_specific_player_race(player_ptr, RACE_GOLEM) || is_specific_player_race(player_ptr, RACE_ZOMBIE)
- || is_specific_player_race(player_ptr, RACE_SPECTRE)) {
- if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
- return TRUE;
- } else if (is_specific_player_race(player_ptr, RACE_BALROG) || (mimic_info[player_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) {
- if (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE && angband_strchr("pht", r_info[o_ptr->pval].d_char))
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*!
* @brief オブジェクトをプレイヤーが魔道具として発動できるかを判定する /
* Hook to determine if an object is activatable
* @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
}
/*!
- * @brief オブジェクトをプレイヤーが飲むことができるかを判定する /
- * Hook to determine if an object can be quaffed
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return 飲むことが可能ならばTRUEを返す
- */
-bool item_tester_hook_quaff(player_type *player_ptr, object_type *o_ptr)
-{
- if (o_ptr->tval == TV_POTION)
- return TRUE;
-
- if (is_specific_player_race(player_ptr, RACE_ANDROID)) {
- if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
- return TRUE;
- }
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトをプレイヤーが読むことができるかを判定する /
- * Hook to determine if an object is readable
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return 読むことが可能ならばTRUEを返す
- */
-bool item_tester_hook_readable(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- if ((o_ptr->tval == TV_SCROLL) || (o_ptr->tval == TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER))
- return TRUE;
-
- return FALSE;
-}
-
-/*!
* @brief エッセンスの付加可能な武器や矢弾かを返す
* @param o_ptr チェックしたいオブジェクトの構造体参照ポインタ
* @return エッセンスの付加可能な武器か矢弾ならばTRUEを返す。
}
/*!
- * @brief オブジェクトがランタンの燃料になるかどうかを判定する
- * An "item_tester_hook" for refilling lanterns
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトがランタンの燃料になるならばTRUEを返す
- */
-bool item_tester_refill_lantern(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- /* Flasks of oil are okay */
- if (o_ptr->tval == TV_FLASK)
- return TRUE;
-
- /* Laterns are okay */
- if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
- return TRUE;
-
- /* Assume not okay */
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが薬であるかを返す
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return オブジェクトが薬ならばTRUEを返す
- */
-bool object_is_potion(object_type *o_ptr) { return (k_info[o_ptr->k_idx].tval == TV_POTION); }
-
-/*!
* @brief オブジェクトが賞金首の報酬対象になるかを返す
* @param o_ptr 対象のオブジェクト構造体ポインタ
* @return オブジェクトが報酬対象になるならTRUEを返す
}
/*!
- * @brief オブジェクトが松明に束ねられるかどうかを判定する
- * An "item_tester_hook" for refilling torches
- * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトが松明に束ねられるならばTRUEを返す
- */
-bool object_can_refill_torch(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- /* Torches are okay */
- if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
- return TRUE;
-
- /* Assume not okay */
- return FALSE;
-}
-
-/*!
- * @brief 破壊可能なアイテムかを返す /
- * Determines whether an object can be destroyed, and makes fake inscription.
- * @param o_ptr 破壊可能かを確認したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトが破壊可能ならばTRUEを返す
- */
-bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr)
-{
- /* Artifacts cannot be destroyed */
- if (!object_is_artifact(o_ptr))
- return TRUE;
-
- /* If object is unidentified, makes fake inscription */
- if (!object_is_known(o_ptr)) {
- byte feel = FEEL_SPECIAL;
-
- /* Hack -- Handle icky artifacts */
- if (object_is_cursed(o_ptr) || object_is_broken(o_ptr))
- feel = FEEL_TERRIBLE;
-
- /* Hack -- inscribe the artifact */
- o_ptr->feeling = feel;
-
- /* We have "felt" it (again) */
- o_ptr->ident |= (IDENT_SENSE);
- player_ptr->update |= (PU_COMBINE);
- player_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- return FALSE;
- }
-
- /* Identified artifact -- Nothing to do */
- return FALSE;
-}
-
-/*!
* @brief オブジェクトがクエストの達成目的か否かを返す。
* @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
* @return 現在クエスト達成目的のアイテムならばTRUEを返す。
extern bool (*item_tester_hook)(player_type *, object_type *o_ptr);
bool item_tester_hook_recharge(player_type *player_ptr, object_type *o_ptr);
-bool item_tester_hook_eatable(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_activate(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_use(player_type *player_ptr, object_type *o_ptr);
-bool item_tester_hook_quaff(player_type *player_ptr, object_type *o_ptr);
-bool item_tester_hook_readable(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_melee_ammo(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_weapon_except_bow(player_type *player_ptr, object_type *o_ptr);
bool item_tester_learn_spell(player_type *player_ptr, object_type *o_ptr);
bool item_tester_high_level_book(object_type *o_ptr);
-bool item_tester_refill_lantern(player_type *player_ptr, object_type *o_ptr);
-bool object_is_potion(object_type *o_ptr);
bool object_is_bounty(player_type *player_ptr, object_type *o_ptr);
bool object_is_rare(object_type *o_ptr);
bool object_is_smith(player_type *player_ptr, object_type *o_ptr);
bool object_is_artifact(object_type *o_ptr);
bool object_is_random_artifact(object_type *o_ptr);
bool object_is_nameless(player_type *player_ptr, object_type *o_ptr);
-bool object_can_refill_torch(player_type *player_ptr, object_type *o_ptr);
-bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr);
bool object_is_quest_target(player_type *player_ptr, object_type *o_ptr);
bool item_tester_okay(player_type *player_ptr, object_type *o_ptr, tval_type tval);
bool object_is_fixed_artifact(object_type *o_ptr);
#include "object-enchant/special-object-flags.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
+#include "object-hook/hook-expendable.h"
#include "object-hook/hook-perception.h"
#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"