#include "monster-race/monster-race.h"
#include "object-enchant/object-ego.h"
#include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object/object-mark-types.h"
#include "object-enchant/object-ego.h"
#include "object-enchant/special-object-flags.h"
#include "object-hook/hook-bow.h"
+#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-bow.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
#include "object/object-stack.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
#include "monster/smart-learn-types.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-weapon.h"
#include "pet/pet-util.h"
#include "player/player-class.h"
#include "player/player-damage.h"
#include "mutation/mutation.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-bow.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "player/avatar.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
#include "object-hook/hook-armor.h"
+#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flags.h" // todo 相互参照している.
#include "object/object-flavor.h"
#include "inventory/inventory-object.h"
#include "floor/floor-object.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flavor.h"
#include "object/object-generator.h"
-#include "object/object-hook.h"
#include "object/object-mark-types.h"
#include "object/object-stack.h"
#include "object/object-value.h"
#include "io-dump/dump-util.h"
#include "object-enchant/special-object-flags.h"
#include "object-enchant/tr-types.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object-enchant/trg-types.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-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-weapon.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object-hook/hook-perception.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-hook.h"
#include "perception/object-perception.h"
#include "system/object-type-definition.h"
#include "object-hook/hook-weapon.h"
+#include "object-enchant/tr-types.h"
+#include "object-hook/hook-armor.h"
+#include "object/object-flags.h"
+#include "player/player-skill.h"
#include "sv-definition/sv-weapon-types.h"
#include "system/object-type-definition.h"
+#include "util/bit-flags-calculator.h"
/*!
* @brief 武器匠の「武器」鑑定対象になるかを判定する。/ Hook to specify "weapon"
return FALSE;
}
+
+/*!
+ * @brief オブジェクトがプレイヤーの職業に応じた適正武器か否かを返す / Favorite weapons
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return オブジェクトが適正武器ならばTRUEを返す
+ */
+bool object_is_favorite(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Only melee weapons match */
+ if (!(o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)) {
+ return FALSE;
+ }
+
+ /* Favorite weapons are varied depend on the class */
+ switch (player_ptr->pclass) {
+ case CLASS_PRIEST: {
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ object_flags_known(player_ptr, o_ptr, flgs);
+
+ if (!have_flag(flgs, TR_BLESSED) && !(o_ptr->tval == TV_HAFTED))
+ return FALSE;
+ break;
+ }
+
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ /* Icky to wield? */
+ if (!(s_info[player_ptr->pclass].w_max[o_ptr->tval - TV_WEAPON_BEGIN][o_ptr->sval]))
+ return FALSE;
+ break;
+
+ case CLASS_BEASTMASTER:
+ case CLASS_CAVALRY: {
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ object_flags_known(player_ptr, o_ptr, flgs);
+
+ /* Is it known to be suitable to using while riding? */
+ if (!(have_flag(flgs, TR_RIDING)))
+ return FALSE;
+
+ break;
+ }
+
+ case CLASS_NINJA:
+ /* Icky to wield? */
+ if (s_info[player_ptr->pclass].w_max[o_ptr->tval - TV_WEAPON_BEGIN][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
+ return FALSE;
+ break;
+
+ default:
+ /* All weapons are okay for non-special classes */
+ return TRUE;
+ }
+
+ return TRUE;
+}
+
+/*!
+ * @brief オブジェクトが武器として装備できるかどうかを返す / Check if an object is weapon (including bows and ammo)
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 武器として使えるならばTRUEを返す
+ */
+bool object_is_weapon(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if (TV_WEAPON_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが武器や矢弾として使用できるかを返す / Check if an object is weapon (including bows and ammo)
+ * Rare weapons/aromors including Blade of Chaos, Dragon armors, etc.
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 武器や矢弾として使えるならばTRUEを返す
+ */
+bool object_is_weapon_ammo(object_type *o_ptr)
+{
+ if (TV_MISSILE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが武器、防具、矢弾として使用できるかを返す / Check if an object is weapon, armour or ammo
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 武器、防具、矢弾として使えるならばTRUEを返す
+ */
+bool object_is_weapon_armour_ammo(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if (object_is_weapon_ammo(o_ptr) || object_is_armour(player_ptr, o_ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが近接武器として装備できるかを返す / Melee weapons
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 近接武器として使えるならばTRUEを返す
+ */
+bool object_is_melee_weapon(object_type *o_ptr)
+{
+ if (TV_DIGGING <= o_ptr->tval && o_ptr->tval <= TV_SWORD)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが装備可能であるかを返す / Wearable including all weapon, all armour, bow, light source, amulet, and ring
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 装備可能ならばTRUEを返す
+ */
+bool object_is_wearable(object_type *o_ptr)
+{
+ if (TV_WEARABLE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEARABLE_END)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが装備品であるかを返す(object_is_wearableに矢弾を含む) / Equipment including all wearable objects and ammo
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 装備品ならばTRUEを返す
+ */
+bool object_is_equipment(object_type *o_ptr)
+{
+ if (TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが強化不能武器であるかを返す / Poison needle can not be enchanted
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化不能ならばTRUEを返す
+ */
+bool object_refuse_enchant_weapon(object_type *o_ptr)
+{
+ if (o_ptr->tval == TV_SWORD && o_ptr->sval == SV_POISON_NEEDLE)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが強化可能武器であるかを返す /
+ * Check if an object is weapon (including bows and ammo) and allows enchantment
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化可能ならばTRUEを返す
+ */
+bool object_allow_enchant_weapon(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if (object_is_weapon_ammo(o_ptr) && !object_refuse_enchant_weapon(o_ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが強化可能な近接武器であるかを返す /
+ * Check if an object is melee weapon and allows enchantment
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化可能な近接武器ならばTRUEを返す
+ */
+bool object_allow_enchant_melee_weapon(player_type *player_ptr, object_type *o_ptr)
+{
+ /* Unused */
+ (void)player_ptr;
+
+ if (object_is_melee_weapon(o_ptr) && !object_refuse_enchant_weapon(o_ptr))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*!
+ * @brief オブジェクトが両手持ち可能な武器かを返す /
+ * Check if an object is melee weapon and allows wielding with two-hands
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 両手持ち可能ならばTRUEを返す
+ */
+bool object_allow_two_hands_wielding(object_type *o_ptr)
+{
+ if (object_is_melee_weapon(o_ptr) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)))
+ return TRUE;
+
+ return FALSE;
+}
bool item_tester_hook_broken_weapon(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_boomerang(player_type *player_ptr, object_type *o_ptr);
bool item_tester_hook_mochikae(player_type *player_ptr, object_type *o_ptr);
+bool object_is_favorite(player_type *player_ptr, object_type *o_ptr);
+bool object_is_weapon(player_type *player_ptr, object_type *o_ptr);
+bool object_is_weapon_ammo(object_type *o_ptr);
+bool object_is_weapon_armour_ammo(player_type *player_ptr, object_type *o_ptr);
+bool object_is_melee_weapon(object_type *o_ptr);
+bool object_is_wearable(object_type *o_ptr);
+bool object_is_equipment(object_type *o_ptr);
+bool object_refuse_enchant_weapon(object_type *o_ptr);
+bool object_allow_enchant_weapon(player_type *player_ptr, object_type *o_ptr);
+bool object_allow_enchant_melee_weapon(player_type *player_ptr, object_type *o_ptr);
+bool object_allow_two_hands_wielding(object_type *o_ptr);
#include "object-enchant/trg-types.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
#include "object/object-info.h"
#include "object/object-kind.h"
#include "player/mimic-info-table.h"
#include "player/player-class.h"
#include "player/player-race-types.h"
-#include "player/player-skill.h"
#include "realm/realm-names-table.h"
#include "sv-definition/sv-armor-types.h"
#include "sv-definition/sv-lite-types.h"
}
/*!
- * @brief オブジェクトがプレイヤーの職業に応じた適正武器か否かを返す / Favorite weapons
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return オブジェクトが適正武器ならばTRUEを返す
- */
-bool object_is_favorite(player_type *player_ptr, object_type *o_ptr)
-{
- /* Only melee weapons match */
- if (!(o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)) {
- return FALSE;
- }
-
- /* Favorite weapons are varied depend on the class */
- switch (player_ptr->pclass) {
- case CLASS_PRIEST: {
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- object_flags_known(player_ptr, o_ptr, flgs);
-
- if (!have_flag(flgs, TR_BLESSED) && !(o_ptr->tval == TV_HAFTED))
- return FALSE;
- break;
- }
-
- case CLASS_MONK:
- case CLASS_FORCETRAINER:
- /* Icky to wield? */
- if (!(s_info[player_ptr->pclass].w_max[o_ptr->tval - TV_WEAPON_BEGIN][o_ptr->sval]))
- return FALSE;
- break;
-
- case CLASS_BEASTMASTER:
- case CLASS_CAVALRY: {
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- object_flags_known(player_ptr, o_ptr, flgs);
-
- /* Is it known to be suitable to using while riding? */
- if (!(have_flag(flgs, TR_RIDING)))
- return FALSE;
-
- break;
- }
-
- case CLASS_NINJA:
- /* Icky to wield? */
- if (s_info[player_ptr->pclass].w_max[o_ptr->tval - TV_WEAPON_BEGIN][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
- return FALSE;
- break;
-
- default:
- /* All weapons are okay for non-special classes */
- return TRUE;
- }
-
- return TRUE;
-}
-
-/*!
* @brief オブジェクトがレアアイテムかどうかを返す /
* Rare weapons/aromors including Blade of Chaos, Dragon armors, etc.
* @param o_ptr 対象のオブジェクト構造体ポインタ
}
/*!
- * @brief オブジェクトが武器として装備できるかどうかを返す / Check if an object is weapon (including bows and ammo)
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 武器として使えるならばTRUEを返す
- */
-bool object_is_weapon(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- if (TV_WEAPON_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが武器や矢弾として使用できるかを返す / Check if an object is weapon (including bows and ammo)
- * Rare weapons/aromors including Blade of Chaos, Dragon armors, etc.
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 武器や矢弾として使えるならばTRUEを返す
- */
-bool object_is_weapon_ammo(object_type *o_ptr)
-{
- if (TV_MISSILE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEAPON_END)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが武器、防具、矢弾として使用できるかを返す / Check if an object is weapon, armour or ammo
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 武器、防具、矢弾として使えるならばTRUEを返す
- */
-bool object_is_weapon_armour_ammo(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- if (object_is_weapon_ammo(o_ptr) || object_is_armour(player_ptr, o_ptr))
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが近接武器として装備できるかを返す / Melee weapons
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 近接武器として使えるならばTRUEを返す
- */
-bool object_is_melee_weapon(object_type *o_ptr)
-{
- if (TV_DIGGING <= o_ptr->tval && o_ptr->tval <= TV_SWORD)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが装備可能であるかを返す / Wearable including all weapon, all armour, bow, light source, amulet, and ring
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 装備可能ならばTRUEを返す
- */
-bool object_is_wearable(object_type *o_ptr)
-{
- if (TV_WEARABLE_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_WEARABLE_END)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが装備品であるかを返す(object_is_wearableに矢弾を含む) / Equipment including all wearable objects and ammo
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 装備品ならばTRUEを返す
- */
-bool object_is_equipment(object_type *o_ptr)
-{
- if (TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが強化不能武器であるかを返す / Poison needle can not be enchanted
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 強化不能ならばTRUEを返す
- */
-bool object_refuse_enchant_weapon(object_type *o_ptr)
-{
- if (o_ptr->tval == TV_SWORD && o_ptr->sval == SV_POISON_NEEDLE)
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが強化可能武器であるかを返す /
- * Check if an object is weapon (including bows and ammo) and allows enchantment
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 強化可能ならばTRUEを返す
- */
-bool object_allow_enchant_weapon(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- if (object_is_weapon_ammo(o_ptr) && !object_refuse_enchant_weapon(o_ptr))
- return TRUE;
-
- return FALSE;
-}
-
-/*!
- * @brief オブジェクトが強化可能な近接武器であるかを返す /
- * Check if an object is melee weapon and allows enchantment
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 強化可能な近接武器ならばTRUEを返す
- */
-bool object_allow_enchant_melee_weapon(player_type *player_ptr, object_type *o_ptr)
-{
- /* Unused */
- (void)player_ptr;
-
- if (object_is_melee_weapon(o_ptr) && !object_refuse_enchant_weapon(o_ptr))
- return TRUE;
-
- return FALSE;
-}
-
-/*!
* @brief オブジェクトが鍛冶師のエッセンス付加済みかを返す /
* Check if an object is made by a smith's special ability
* @param o_ptr 対象のオブジェクト構造体ポインタ
}
/*!
- * @brief オブジェクトが両手持ち可能な武器かを返す /
- * Check if an object is melee weapon and allows wielding with two-hands
- * @param o_ptr 対象のオブジェクト構造体ポインタ
- * @return 両手持ち可能ならばTRUEを返す
- */
-bool object_allow_two_hands_wielding(object_type *o_ptr)
-{
- if (object_is_melee_weapon(o_ptr) && ((o_ptr->weight > 99) || (o_ptr->tval == TV_POLEARM)))
- return TRUE;
-
- return FALSE;
-}
-
-/*!
* @brief オブジェクトが松明に束ねられるかどうかを判定する
* An "item_tester_hook" for refilling torches
* @param 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_favorite(player_type *player_ptr, object_type *o_ptr);
bool object_is_rare(object_type *o_ptr);
-bool object_is_weapon(player_type *player_ptr, object_type *o_ptr);
-bool object_is_weapon_ammo(object_type *o_ptr);
-bool object_is_weapon_armour_ammo(player_type *player_ptr, object_type *o_ptr);
-bool object_is_melee_weapon(object_type *o_ptr);
-bool object_is_wearable(object_type *o_ptr);
-bool object_is_equipment(object_type *o_ptr);
-bool object_refuse_enchant_weapon(object_type *o_ptr);
-bool object_allow_enchant_weapon(player_type *player_ptr, object_type *o_ptr);
-bool object_allow_enchant_melee_weapon(player_type *player_ptr, 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_allow_two_hands_wielding(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);
#include "object-enchant/object-ego.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
+#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
-#include "object-hook/hook-checker.h"
-#include "object/object-hook.h"
-#include "object/object-kind.h"
#include "object/object-info.h"
+#include "object/object-kind.h"
#include "sv-definition/sv-amulet-types.h"
#include "sv-definition/sv-other-types.h"
#include "sv-definition/sv-ring-types.h"
#include "monster/monster-info.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/vorpal-weapon.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
-#include "object/object-hook.h"
#include "player-attack/attack-chaos-effect.h"
#include "player-attack/blood-sucking-processor.h"
#include "player-attack/player-attack-util.h"
#include "object-enchant/special-object-flags.h"
#include "object-enchant/trg-types.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-generator.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
#include "object-enchant/trc-types.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/object-flags.h"
-#include "object/object-hook.h"
#include "object/object-mark-types.h"
#include "object/object-info.h"
#include "perception/object-perception.h"
#include "io/write-diary.h"
#include "object-enchant/special-object-flags.h"
#include "object-hook/hook-perception.h"
+#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object-hook/hook-armor.h"
#include "object-hook/hook-bow.h"
#include "object-hook/hook-checker.h"
+#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flags.h"
#include "object/object-flavor.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
#include "object-hook/hook-perception.h"
+#include "object-hook/hook-weapon.h"
#include "object/item-use-flags.h"
#include "object/object-flavor.h"
#include "object/object-generator.h"