OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[hengband/hengband.git] / src / obj_kind.c
index 49d965f..1db11bf 100644 (file)
@@ -1,14 +1,29 @@
-/* File: obj_kind.c */
+/*!
+ * @file obj_kind.c
+ * @brief ベースアイテムの実装
+ * @date 2014/01/10
+ * @author
+ * 2014 Deskull rearranged comment for Doxygen.
+ */
 
 #include "angband.h"
 
-
+/*!
+ * @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を返す
+ */
 bool object_is_shoukinkubi(object_type *o_ptr)
 {
        int i;
@@ -20,7 +35,7 @@ bool object_is_shoukinkubi(object_type *o_ptr)
        if (vanilla_town) return FALSE;
 
        /* Today's wanted */
-       if (p_ptr->today_mon > 0 && o_ptr->pval == p_ptr->today_mon) return TRUE;
+       if (p_ptr->today_mon > 0 && (streq(r_name + r_info[o_ptr->pval].name, r_name + r_info[today_mon].name))) return TRUE;
 
        /* Tsuchinoko */
        if (o_ptr->pval == MON_TSUCHINOKO) return TRUE;
@@ -34,9 +49,10 @@ bool object_is_shoukinkubi(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
- * Favorite weapons
+/*!
+ * @brief オブジェクトがプレイヤーの職業に応じた適正武器か否かを返す / Favorite weapons
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return オブジェクトが適正武器ならばTRUEを返す
  */
 bool object_is_favorite(object_type *o_ptr)
 {
@@ -54,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) && 
@@ -73,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? */
@@ -98,9 +114,11 @@ bool object_is_favorite(object_type *o_ptr)
 }
 
 
-/*
- * Rare weapons/aromors
- * including Blade of Chaos, Dragon armors, etc.
+/*!
+ * @brief オブジェクトがレアアイテムかどうかを返す /
+ * Rare weapons/aromors including Blade of Chaos, Dragon armors, etc.
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return レアアイテムならばTRUEを返す
  */
 bool object_is_rare(object_type *o_ptr)
 {
@@ -163,8 +181,10 @@ bool object_is_rare(object_type *o_ptr)
 }
 
 
-/*
- * Check if an object is weapon (including bows and ammo)
+/*!
+ * @brief オブジェクトが武器として装備できるかどうかを返す / Check if an object is weapon (including bows and ammo)
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 武器として使えるならばTRUEを返す
  */
 bool object_is_weapon(object_type *o_ptr)
 {
@@ -174,8 +194,11 @@ bool object_is_weapon(object_type *o_ptr)
 }
 
 
-/*
- * 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を返す
  */
 bool object_is_weapon_ammo(object_type *o_ptr)
 {
@@ -184,9 +207,10 @@ bool object_is_weapon_ammo(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
- * Check if an object is ammo
+/*!
+ * @brief オブジェクトが矢弾として使用できるかどうかを返す / Check if an object is ammo
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 矢弾として使えるならばTRUEを返す
  */
 bool object_is_ammo(object_type *o_ptr)
 {
@@ -195,9 +219,10 @@ bool object_is_ammo(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
- * Check if an object is armour
+/*!
+ * @brief オブジェクトが防具として装備できるかどうかを返す / Check if an object is armour
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 矢弾として使えるならばTRUEを返す
  */
 bool object_is_armour(object_type *o_ptr)
 {
@@ -206,9 +231,10 @@ bool object_is_armour(object_type *o_ptr)
        return FALSE;
 }
 
-
-/*
- * Check if an object is weapon, armour or ammo
+/*!
+ * @brief オブジェクトが武器、防具、矢弾として使用できるかを返す / Check if an object is weapon, armour or ammo
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 武器、防具、矢弾として使えるならばTRUEを返す
  */
 bool object_is_weapon_armour_ammo(object_type *o_ptr)
 {
@@ -218,8 +244,10 @@ bool object_is_weapon_armour_ammo(object_type *o_ptr)
 }
 
 
-/*
- * Melee weapons
+/*!
+ * @brief オブジェクトが近接武器として装備できるかを返す / Melee weapons
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 近接武器として使えるならばTRUEを返す
  */
 bool object_is_melee_weapon(object_type *o_ptr)
 {
@@ -229,8 +257,10 @@ bool object_is_melee_weapon(object_type *o_ptr)
 }
 
 
-/*
- * Wearable including all weapon, all armour, bow, light source, amulet, and ring
+/*!
+ * @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)
 {
@@ -240,8 +270,10 @@ bool object_is_wearable(object_type *o_ptr)
 }
 
 
-/*
- * Equipment including all wearable objects and ammo
+/*!
+ * @brief オブジェクトが装備品であるかを返す(object_is_wearableに矢弾を含む) / Equipment including all wearable objects and ammo
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 装備品ならばTRUEを返す
  */
 bool object_is_equipment(object_type *o_ptr)
 {
@@ -251,8 +283,10 @@ bool object_is_equipment(object_type *o_ptr)
 }
 
 
-/*
- * Poison needle can not be enchanted
+/*!
+ * @brief オブジェクトが強化不能武器であるかを返す / Poison needle can not be enchanted
+ * @param o_ptr 対象のオブジェクト構造体ポインタ
+ * @return 強化不能ならばTRUEを返す
  */
 bool object_refuse_enchant_weapon(object_type *o_ptr)
 {
@@ -262,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)
 {
@@ -273,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)
 {
@@ -284,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)
 {
@@ -294,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)
 {
@@ -306,8 +351,24 @@ 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)
+{
+       if (object_is_artifact(o_ptr) && !object_is_fixed_artifact(o_ptr)) return TRUE;
+
+       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)
 {
@@ -318,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)
 {