OSDN Git Service

[Fix] #38921 施設の職業、魔法領域制限処理についても同様に対応。 / Fix a bug of class and realm limitation...
[hengband/hengband.git] / src / obj_kind.c
index c570150..1db11bf 100644 (file)
@@ -1,6 +1,6 @@
-/*!
+/*!
  * @file obj_kind.c
- * @brief ¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤Î¼ÂÁõ
+ * @brief ベースアイテムの実装
  * @date 2014/01/10
  * @author
  * 2014 Deskull rearranged comment for Doxygen.
@@ -9,9 +9,9 @@
 #include "angband.h"
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ìô¤Ç¤¢¤ë¤«¤òÊÖ¤¹
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ìô¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが薬であるかを返す
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return オブジェクトが薬ならばTRUEを返す
  */
 bool object_is_potion(object_type *o_ptr)
 {
@@ -20,9 +20,9 @@ bool object_is_potion(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¾Þ¶â¼ó¤ÎÊó½·Âоݤˤʤ뤫¤òÊÖ¤¹
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬Êó½·Âоݤˤʤë¤Ê¤éTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが賞金首の報酬対象になるかを返す
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return オブジェクトが報酬対象になるならTRUEを返す
  */
 bool object_is_shoukinkubi(object_type *o_ptr)
 {
@@ -50,9 +50,9 @@ bool object_is_shoukinkubi(object_type *o_ptr)
 }
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¥×¥ì¥¤¥ä¡¼¤Î¿¦¶È¤Ë±þ¤¸¤¿Å¬ÀµÉð´ï¤«Èݤ«¤òÊÖ¤¹ / Favorite weapons
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¥ª¥Ö¥¸¥§¥¯¥È¤¬Å¬ÀµÉð´ï¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトがプレイヤーの職業に応じた適正武器か否かを返す / Favorite weapons
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return オブジェクトが適正武器ならばTRUEを返す
  */
 bool object_is_favorite(object_type *o_ptr)
 {
@@ -70,7 +70,7 @@ bool object_is_favorite(object_type *o_ptr)
        {
        case CLASS_PRIEST:
        {
-               u32b flgs[TR_FLAG_SIZE];
+               BIT_FLAGS flgs[TR_FLAG_SIZE];
                object_flags_known(o_ptr, flgs);
 
                if (!have_flag(flgs, TR_BLESSED) && 
@@ -89,7 +89,7 @@ bool object_is_favorite(object_type *o_ptr)
        case CLASS_BEASTMASTER:
        case CLASS_CAVALRY:
        {
-               u32b flgs[TR_FLAG_SIZE];
+               BIT_FLAGS flgs[TR_FLAG_SIZE];
                object_flags_known(o_ptr, flgs);
 
                /* Is it known to be suitable to using while riding? */
@@ -115,10 +115,10 @@ bool object_is_favorite(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¥ì¥¢¥¢¥¤¥Æ¥à¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief オブジェクトがレアアイテムかどうかを返す /
  * Rare weapons/aromors including Blade of Chaos, Dragon armors, etc.
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¥ì¥¢¥¢¥¤¥Æ¥à¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return レアアイテムならばTRUEを返す
  */
 bool object_is_rare(object_type *o_ptr)
 {
@@ -182,9 +182,9 @@ bool object_is_rare(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬Éð´ï¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤«¤É¤¦¤«¤òÊÖ¤¹ / Check if an object is weapon (including bows and ammo)
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return Éð´ï¤È¤·¤Æ»È¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが武器として装備できるかどうかを返す / Check if an object is weapon (including bows and ammo)
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 武器として使えるならばTRUEを返す
  */
 bool object_is_weapon(object_type *o_ptr)
 {
@@ -195,10 +195,10 @@ bool object_is_weapon(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬Éð´ï¤äÌðÃƤȤ·¤Æ»ÈÍѤǤ­¤ë¤«¤òÊÖ¤¹ / Check if an object is weapon (including bows and ammo)
+ * @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¤òÊÖ¤¹
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 武器や矢弾として使えるならばTRUEを返す
  */
 bool object_is_weapon_ammo(object_type *o_ptr)
 {
@@ -208,9 +208,9 @@ bool object_is_weapon_ammo(object_type *o_ptr)
 }
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬ÌðÃƤȤ·¤Æ»ÈÍѤǤ­¤ë¤«¤É¤¦¤«¤òÊÖ¤¹ / Check if an object is ammo
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ÌðÃƤȤ·¤Æ»È¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが矢弾として使用できるかどうかを返す / Check if an object is ammo
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 矢弾として使えるならばTRUEを返す
  */
 bool object_is_ammo(object_type *o_ptr)
 {
@@ -220,9 +220,9 @@ bool object_is_ammo(object_type *o_ptr)
 }
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬Ëɶñ¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤«¤É¤¦¤«¤òÊÖ¤¹ / Check if an object is armour
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ÌðÃƤȤ·¤Æ»È¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが防具として装備できるかどうかを返す / Check if an object is armour
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 矢弾として使えるならばTRUEを返す
  */
 bool object_is_armour(object_type *o_ptr)
 {
@@ -232,9 +232,9 @@ bool object_is_armour(object_type *o_ptr)
 }
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬Éð´ï¡¢Ëɶñ¡¢ÌðÃƤȤ·¤Æ»ÈÍѤǤ­¤ë¤«¤òÊÖ¤¹ / Check if an object is weapon, armour or ammo
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return Éð´ï¡¢Ëɶñ¡¢ÌðÃƤȤ·¤Æ»È¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが武器、防具、矢弾として使用できるかを返す / Check if an object is weapon, armour or ammo
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 武器、防具、矢弾として使えるならばTRUEを返す
  */
 bool object_is_weapon_armour_ammo(object_type *o_ptr)
 {
@@ -245,9 +245,9 @@ bool object_is_weapon_armour_ammo(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¶áÀÜÉð´ï¤È¤·¤ÆÁõÈ÷¤Ç¤­¤ë¤«¤òÊÖ¤¹ / Melee weapons
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¶áÀÜÉð´ï¤È¤·¤Æ»È¤¨¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが近接武器として装備できるかを返す / Melee weapons
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 近接武器として使えるならばTRUEを返す
  */
 bool object_is_melee_weapon(object_type *o_ptr)
 {
@@ -258,9 +258,9 @@ bool object_is_melee_weapon(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬ÁõÈ÷²Äǽ¤Ç¤¢¤ë¤«¤òÊÖ¤¹ / Wearable including all weapon, all armour, bow, light source, amulet, and ring
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ÁõÈ÷²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが装備可能であるかを返す / Wearable including all weapon, all armour, bow, light source, amulet, and ring
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 装備可能ならばTRUEを返す
  */
 bool object_is_wearable(object_type *o_ptr)
 {
@@ -271,9 +271,9 @@ bool object_is_wearable(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬ÁõÈ÷ÉʤǤ¢¤ë¤«¤òÊÖ¤¹(object_is_wearable¤ËÌðÃƤò´Þ¤à) / Equipment including all wearable objects and ammo
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ÁõÈ÷Éʤʤé¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが装備品であるかを返す(object_is_wearableに矢弾を含む) / Equipment including all wearable objects and ammo
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 装備品ならばTRUEを返す
  */
 bool object_is_equipment(object_type *o_ptr)
 {
@@ -284,9 +284,9 @@ bool object_is_equipment(object_type *o_ptr)
 
 
 /*!
- * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬¶¯²½ÉÔǽÉð´ï¤Ç¤¢¤ë¤«¤òÊÖ¤¹ / Poison needle can not be enchanted
- * @param o_ptr ÂоݤΥª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΥݥ¤¥ó¥¿
- * @return ¶¯²½ÉÔǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @brief オブジェクトが強化不能武器であるかを返す / Poison needle can not be enchanted
+ * @param o_ptr å¯¾è±¡ã\81®ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88æ§\8bé\80 ä½\93ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 強化不能ならばTRUEを返す
  */
 bool object_refuse_enchant_weapon(object_type *o_ptr)
 {
@@ -296,8 +296,11 @@ bool object_refuse_enchant_weapon(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief オブジェクトが強化可能武器であるかを返す /
  * Check if an object is weapon (including bows and ammo) and allows enchantment
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化可能ならばTRUEを返す
  */
 bool object_allow_enchant_weapon(object_type *o_ptr)
 {
@@ -307,8 +310,11 @@ bool object_allow_enchant_weapon(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief オブジェクトが強化可能な近接武器であるかを返す /
  * Check if an object is melee weapon and allows enchantment
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化可能な近接武器ならばTRUEを返す
  */
 bool object_allow_enchant_melee_weapon(object_type *o_ptr)
 {
@@ -318,8 +324,11 @@ bool object_allow_enchant_melee_weapon(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief オブジェクトが鍛冶師のエッセンス付加済みかを返す /
  * Check if an object is made by a smith's special ability
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return エッセンス付加済みならばTRUEを返す
  */
 bool object_is_smith(object_type *o_ptr)
 {
@@ -328,9 +337,11 @@ bool object_is_smith(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
+/*!
+ * @brief オブジェクトがアーティファクトかを返す /
  * Check if an object is artifact
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return アーティファクトならばTRUEを返す
  */
 bool object_is_artifact(object_type *o_ptr)
 {
@@ -340,8 +351,11 @@ bool object_is_artifact(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief オブジェクトがランダムアーティファクトかを返す /
  * Check if an object is random artifact
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return ランダムアーティファクトならばTRUEを返す
  */
 bool object_is_random_artifact(object_type *o_ptr)
 {
@@ -350,9 +364,11 @@ bool object_is_random_artifact(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
+/*!
+ * @brief オブジェクトが通常のアイテム(アーティファクト、エゴ、鍛冶師エッセンス付加いずれでもない)かを返す /
  * Check if an object is neither artifact, ego, nor 'smith' object
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 通常のアイテムならばTRUEを返す
  */
 bool object_is_nameless(object_type *o_ptr)
 {
@@ -363,8 +379,11 @@ bool object_is_nameless(object_type *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)
 {