<ClCompile Include="..\..\src\mind\samurai-slaying.c" />\r
<ClCompile Include="..\..\src\mind\surprise-attack.c" />\r
<ClCompile Include="..\..\src\object\object-appraiser.c" />\r
+ <ClCompile Include="..\..\src\object\object-value.c" />\r
<ClCompile Include="..\..\src\pet\pet-fall-off.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-floor.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-particularity.c" />\r
<ClInclude Include="..\..\src\mind\samurai-slaying.h" />\r
<ClInclude Include="..\..\src\mind\surprise-attack.h" />\r
<ClInclude Include="..\..\src\object\object-appraiser.h" />\r
+ <ClInclude Include="..\..\src\object\object-value.h" />\r
<ClInclude Include="..\..\src\pet\pet-fall-off.h" />\r
<ClInclude Include="..\..\src\pet\pet-util.h" />\r
<ClInclude Include="..\..\src\mspell\assign-monster-spell.h" />\r
<ClCompile Include="..\..\src\inventory\inventory-object.c">
<Filter>inventory</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\object\object-value.c">
+ <Filter>object</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\inventory\inventory-object.h">
<Filter>inventory</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\object\object-value.h">
+ <Filter>object</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
object/object-hook.c object/object-hook.h \
object/object-kind.c object/object-kind.h \
object/object-kind-hook.c object/object-kind-hook.h \
+ object/object-value.c object/object-value.h \
object/lite-processor.c object/lite-processor.h \
object/torch.c object/torch.h \
object/tr-types.h object/trc-types.h object/tval-type.h \
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object/object-mark-types.h"
-#include "object/object2.h"
+#include "object/object-value.h"
#include "object/special-object-flags.h"
#include "object/sv-other-types.h"
#include "object/sv-wand-types.h"
#include "object/object-appraiser.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/special-object-flags.h"
#include "object/sv-lite-types.h"
#include "object/trc-types.h"
+#include "object/object-value.h"
#include "player/avatar.h"
#include "player/player-class.h"
#include "player/player-effects.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
#include "object/object-mark-types.h"
-#include "object/object2.h"
+#include "object/object-value.h"
#include "object/special-object-flags.h"
#include "object/sv-amulet-types.h"
#include "object/sv-protector-types.h"
#include "inventory/inventory-object.h"
#include "object/object-flavor.h"
+#include "object/object-value.h"
#include "object/object2.h" // 暫定、相互参照している.
#include "player/player-effects.h" // 暫定、相互参照している.
#include "view/object-describer.h"
#include "object/object-mark-types.h"
#include "object/object2.h"
#include "object/old-ego-extra-values.h" // TODO v1.5.0以前のセーブファイルをロードする処理を分離する.
+#include "object/object-value.h"
#include "object/sv-armor-types.h"
#include "object/sv-lite-types.h"
#include "object/tr-types.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/sv-other-types.h"
--- /dev/null
+#include "object/object-value.h"
+#include "object/artifact.h"
+#include "object/object-appraiser.h"
+#include "object/object-broken.h"
+#include "object/object-curse.h"
+#include "object/object-ego.h"
+#include "object/object-hook.h"
+#include "object/object-kind.h"
+#include "object/object1.h"
+#include "object/object2.h" // 暫定、相互参照している.
+#include "object/special-object-flags.h"
+
+/*!
+ * @brief 未鑑定なベースアイテムの基本価格を返す /
+ * Return the "value" of an "unknown" item Make a guess at the value of non-aware items
+ * @param o_ptr 未鑑定価格を確認したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトの未鑑定価格
+ */
+static PRICE object_value_base(object_type *o_ptr)
+{
+ if (object_is_aware(o_ptr))
+ return (k_info[o_ptr->k_idx].cost);
+
+ switch (o_ptr->tval) {
+ case TV_FOOD:
+ return (5L);
+ case TV_POTION:
+ return (20L);
+ case TV_SCROLL:
+ return (20L);
+ case TV_STAFF:
+ return (70L);
+ case TV_WAND:
+ return (50L);
+ case TV_ROD:
+ return (90L);
+ case TV_RING:
+ return (45L);
+ case TV_AMULET:
+ return (45L);
+ case TV_FIGURINE: {
+ DEPTH level = r_info[o_ptr->pval].level;
+ if (level < 20)
+ return level * 50L;
+ else if (level < 30)
+ return 1000 + (level - 20) * 150L;
+ else if (level < 40)
+ return 2500 + (level - 30) * 350L;
+ else if (level < 50)
+ return 6000 + (level - 40) * 800L;
+ else
+ return 14000 + (level - 50) * 2000L;
+ }
+ case TV_CAPTURE:
+ if (!o_ptr->pval)
+ return 1000L;
+ else
+ return ((r_info[o_ptr->pval].level) * 50L + 1000);
+ }
+
+ return (0L);
+}
+
+/*!
+ * @brief オブジェクト価格算出のメインルーチン /
+ * Return the price of an item including plusses (and charges)
+ * @param o_ptr 判明している現価格を確認したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトの判明している現価格
+ * @details
+ * This function returns the "value" of the given item (qty one)\n
+ *\n
+ * Never notice "unknown" bonuses or properties, including "curses",\n
+ * since that would give the player information he did not have.\n
+ *\n
+ * Note that discounted items stay discounted forever, even if\n
+ * the discount is "forgotten" by the player via memory loss.\n
+ */
+PRICE object_value(object_type *o_ptr)
+{
+ PRICE value;
+
+ if (object_is_known(o_ptr)) {
+ if (object_is_broken(o_ptr))
+ return (0L);
+ if (object_is_cursed(o_ptr))
+ return (0L);
+
+ value = object_value_real(o_ptr);
+ } else {
+ if ((o_ptr->ident & (IDENT_SENSE)) && object_is_broken(o_ptr))
+ return (0L);
+ if ((o_ptr->ident & (IDENT_SENSE)) && object_is_cursed(o_ptr))
+ return (0L);
+
+ value = object_value_base(o_ptr);
+ }
+
+ if (o_ptr->discount)
+ value -= (value * o_ptr->discount / 100L);
+
+ return (value);
+}
+
+/*!
+ * @brief オブジェクトの真の価格を算出する /
+ * Return the value of the flags the object has...
+ * @param o_ptr 本価格を確認したいオブジェクトの構造体参照ポインタ
+ * @return オブジェクトの本価格
+ * @details
+ * Return the "real" price of a "known" item, not including discounts\n
+ *\n
+ * Wand and staffs get cost for each charge\n
+ *\n
+ * Armor is worth an extra 100 gold per bonus point to armor class.\n
+ *\n
+ * Weapons are worth an extra 100 gold per bonus point (AC,TH,TD).\n
+ *\n
+ * Missiles are only worth 5 gold per bonus point, since they\n
+ * usually appear in groups of 20, and we want the player to get\n
+ * the same amount of cash for any "equivalent" item. Note that\n
+ * missiles never have any of the "pval" flags, and in fact, they\n
+ * only have a few of the available flags, primarily of the "slay"\n
+ * and "brand" and "ignore" variety.\n
+ *\n
+ * Armor with a negative armor bonus is worthless.\n
+ * Weapons with negative hit+damage bonuses are worthless.\n
+ *\n
+ * Every wearable item with a "pval" bonus is worth extra (see below).\n
+ */
+PRICE object_value_real(object_type *o_ptr)
+{
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ object_kind *k_ptr = &k_info[o_ptr->k_idx];
+
+ if (!k_info[o_ptr->k_idx].cost)
+ return (0L);
+
+ PRICE value = k_info[o_ptr->k_idx].cost;
+ object_flags(o_ptr, flgs);
+ if (object_is_fixed_artifact(o_ptr)) {
+ artifact_type *a_ptr = &a_info[o_ptr->name1];
+ if (!a_ptr->cost)
+ return (0L);
+
+ value = a_ptr->cost;
+ value += flag_cost(o_ptr, o_ptr->pval);
+ return (value);
+ } else if (object_is_ego(o_ptr)) {
+ ego_item_type *e_ptr = &e_info[o_ptr->name2];
+ if (!e_ptr->cost)
+ return (0L);
+
+ value += e_ptr->cost;
+ value += flag_cost(o_ptr, o_ptr->pval);
+ } else {
+ bool flag = FALSE;
+ for (int i = 0; i < TR_FLAG_SIZE; i++)
+ if (o_ptr->art_flags[i])
+ flag = TRUE;
+
+ if (flag)
+ value += flag_cost(o_ptr, o_ptr->pval);
+ }
+
+ /* Analyze pval bonus for normal object */
+ switch (o_ptr->tval) {
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT:
+ case TV_BOW:
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_HELM:
+ case TV_CROWN:
+ case TV_SHIELD:
+ case TV_CLOAK:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ case TV_LITE:
+ case TV_AMULET:
+ case TV_RING:
+ if (!o_ptr->pval)
+ break;
+ if (o_ptr->pval < 0)
+ return (0L);
+
+ if (have_flag(flgs, TR_STR))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_INT))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_WIS))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_DEX))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_CON))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_CHR))
+ value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_MAGIC_MASTERY))
+ value += (o_ptr->pval * 100);
+ if (have_flag(flgs, TR_STEALTH))
+ value += (o_ptr->pval * 100L);
+ if (have_flag(flgs, TR_SEARCH))
+ value += (o_ptr->pval * 100L);
+ if (have_flag(flgs, TR_INFRA))
+ value += (o_ptr->pval * 50L);
+ if (have_flag(flgs, TR_TUNNEL))
+ value += (o_ptr->pval * 50L);
+ if (have_flag(flgs, TR_BLOWS))
+ value += (o_ptr->pval * 5000L);
+ if (have_flag(flgs, TR_SPEED))
+ value += (o_ptr->pval * 10000L);
+ break;
+ }
+
+ switch (o_ptr->tval) {
+ case TV_WAND: {
+ /* Pay extra for charges, depending on standard number of
+ * charges. Handle new-style wands correctly. -LM-
+ */
+ value += (value * o_ptr->pval / o_ptr->number / (k_ptr->pval * 2));
+ break;
+ }
+ case TV_STAFF: {
+ /* Pay extra for charges, depending on standard number of
+ * charges. -LM-
+ */
+ value += (value * o_ptr->pval / (k_ptr->pval * 2));
+ break;
+ }
+ case TV_RING:
+ case TV_AMULET: {
+ if (o_ptr->to_h + o_ptr->to_d + o_ptr->to_a < 0)
+ return (0L);
+
+ value += ((o_ptr->to_h + o_ptr->to_d + o_ptr->to_a) * 200L);
+ break;
+ }
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_CLOAK:
+ case TV_CROWN:
+ case TV_HELM:
+ case TV_SHIELD:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR: {
+ if (o_ptr->to_a < 0)
+ return (0L);
+
+ value += (((o_ptr->to_h - k_ptr->to_h) + (o_ptr->to_d - k_ptr->to_d)) * 200L + (o_ptr->to_a) * 100L);
+ break;
+ }
+ case TV_BOW:
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_SWORD:
+ case TV_POLEARM: {
+ if (o_ptr->to_h + o_ptr->to_d < 0)
+ return (0L);
+
+ value += ((o_ptr->to_h + o_ptr->to_d + o_ptr->to_a) * 100L);
+ value += (o_ptr->dd - k_ptr->dd) * o_ptr->ds * 250L;
+ value += (o_ptr->ds - k_ptr->ds) * o_ptr->dd * 250L;
+ break;
+ }
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT: {
+ if (o_ptr->to_h + o_ptr->to_d < 0)
+ return (0L);
+
+ value += ((o_ptr->to_h + o_ptr->to_d) * 5L);
+ value += (o_ptr->dd - k_ptr->dd) * o_ptr->ds * 5L;
+ value += (o_ptr->ds - k_ptr->ds) * o_ptr->dd * 5L;
+ break;
+ }
+ case TV_FIGURINE: {
+ DEPTH level = r_info[o_ptr->pval].level;
+ if (level < 20)
+ value = level * 50L;
+ else if (level < 30)
+ value = 1000 + (level - 20) * 150L;
+ else if (level < 40)
+ value = 2500 + (level - 30) * 350L;
+ else if (level < 50)
+ value = 6000 + (level - 40) * 800L;
+ else
+ value = 14000 + (level - 50) * 2000L;
+ break;
+ }
+ case TV_CAPTURE: {
+ if (!o_ptr->pval)
+ value = 1000L;
+ else
+ value = ((r_info[o_ptr->pval].level) * 50L + 1000);
+ break;
+ }
+ case TV_CHEST: {
+ if (!o_ptr->pval)
+ value = 0L;
+ break;
+ }
+ }
+
+ if (value < 0)
+ return 0L;
+
+ return (value);
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+PRICE object_value(object_type *o_ptr);
+PRICE object_value_real(object_type *o_ptr);
#include "object/object-hook.h"
#include "object/object-kind.h"
#include "object/object-mark-types.h"
+#include "object/object-value.h" // 暫定、相互参照している.
#include "object/special-object-flags.h"
#include "object/sv-amulet-types.h"
#include "object/sv-armor-types.h"
/*!
- * @brief 未鑑定なベースアイテムの基本価格を返す /
- * Return the "value" of an "unknown" item Make a guess at the value of non-aware items
- * @param o_ptr 未鑑定価格を確認したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトの未鑑定価格
- */
-static PRICE object_value_base(object_type *o_ptr)
-{
- if (object_is_aware(o_ptr))
- return (k_info[o_ptr->k_idx].cost);
-
- switch (o_ptr->tval)
- {
- case TV_FOOD: return (5L);
- case TV_POTION: return (20L);
- case TV_SCROLL: return (20L);
- case TV_STAFF: return (70L);
- case TV_WAND: return (50L);
- case TV_ROD: return (90L);
- case TV_RING: return (45L);
- case TV_AMULET: return (45L);
- case TV_FIGURINE:
- {
- DEPTH level = r_info[o_ptr->pval].level;
- if (level < 20) return level * 50L;
- else if (level < 30) return 1000 + (level - 20) * 150L;
- else if (level < 40) return 2500 + (level - 30) * 350L;
- else if (level < 50) return 6000 + (level - 40) * 800L;
- else return 14000 + (level - 50) * 2000L;
- }
- case TV_CAPTURE:
- if (!o_ptr->pval) return 1000L;
- else return ((r_info[o_ptr->pval].level) * 50L + 1000);
- }
-
- return (0L);
-}
-
-
-/*!
* @brief オブジェクトのフラグ類から価格を算出する /
* Return the value of the flags the object has...
* @param o_ptr フラグ価格を確認したいオブジェクトの構造体参照ポインタ
/*!
- * @brief オブジェクトの真の価格を算出する /
- * Return the value of the flags the object has...
- * @param o_ptr 本価格を確認したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトの本価格
- * @details
- * Return the "real" price of a "known" item, not including discounts\n
- *\n
- * Wand and staffs get cost for each charge\n
- *\n
- * Armor is worth an extra 100 gold per bonus point to armor class.\n
- *\n
- * Weapons are worth an extra 100 gold per bonus point (AC,TH,TD).\n
- *\n
- * Missiles are only worth 5 gold per bonus point, since they\n
- * usually appear in groups of 20, and we want the player to get\n
- * the same amount of cash for any "equivalent" item. Note that\n
- * missiles never have any of the "pval" flags, and in fact, they\n
- * only have a few of the available flags, primarily of the "slay"\n
- * and "brand" and "ignore" variety.\n
- *\n
- * Armor with a negative armor bonus is worthless.\n
- * Weapons with negative hit+damage bonuses are worthless.\n
- *\n
- * Every wearable item with a "pval" bonus is worth extra (see below).\n
- */
-PRICE object_value_real(object_type *o_ptr)
-{
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- object_kind *k_ptr = &k_info[o_ptr->k_idx];
-
- if (!k_info[o_ptr->k_idx].cost) return (0L);
-
- PRICE value = k_info[o_ptr->k_idx].cost;
- object_flags(o_ptr, flgs);
- if (object_is_fixed_artifact(o_ptr))
- {
- artifact_type *a_ptr = &a_info[o_ptr->name1];
- if (!a_ptr->cost) return (0L);
-
- value = a_ptr->cost;
- value += flag_cost(o_ptr, o_ptr->pval);
- return (value);
- }
- else if (object_is_ego(o_ptr))
- {
- ego_item_type *e_ptr = &e_info[o_ptr->name2];
- if (!e_ptr->cost) return (0L);
-
- value += e_ptr->cost;
- value += flag_cost(o_ptr, o_ptr->pval);
- }
- else
- {
- bool flag = FALSE;
- for (int i = 0; i < TR_FLAG_SIZE; i++)
- if (o_ptr->art_flags[i]) flag = TRUE;
-
- if (flag) value += flag_cost(o_ptr, o_ptr->pval);
- }
-
- /* Analyze pval bonus for normal object */
- switch (o_ptr->tval)
- {
- case TV_SHOT:
- case TV_ARROW:
- case TV_BOLT:
- case TV_BOW:
- case TV_DIGGING:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_SWORD:
- case TV_BOOTS:
- case TV_GLOVES:
- case TV_HELM:
- case TV_CROWN:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_SOFT_ARMOR:
- case TV_HARD_ARMOR:
- case TV_DRAG_ARMOR:
- case TV_LITE:
- case TV_AMULET:
- case TV_RING:
- if (!o_ptr->pval) break;
- if (o_ptr->pval < 0) return (0L);
-
- if (have_flag(flgs, TR_STR)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_INT)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_WIS)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_DEX)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_CON)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_CHR)) value += (o_ptr->pval * 200L);
- if (have_flag(flgs, TR_MAGIC_MASTERY)) value += (o_ptr->pval * 100);
- if (have_flag(flgs, TR_STEALTH)) value += (o_ptr->pval * 100L);
- if (have_flag(flgs, TR_SEARCH)) value += (o_ptr->pval * 100L);
- if (have_flag(flgs, TR_INFRA)) value += (o_ptr->pval * 50L);
- if (have_flag(flgs, TR_TUNNEL)) value += (o_ptr->pval * 50L);
- if (have_flag(flgs, TR_BLOWS)) value += (o_ptr->pval * 5000L);
- if (have_flag(flgs, TR_SPEED)) value += (o_ptr->pval * 10000L);
- break;
- }
-
- switch (o_ptr->tval)
- {
- case TV_WAND:
- {
- /* Pay extra for charges, depending on standard number of
- * charges. Handle new-style wands correctly. -LM-
- */
- value += (value * o_ptr->pval / o_ptr->number / (k_ptr->pval * 2));
- break;
- }
- case TV_STAFF:
- {
- /* Pay extra for charges, depending on standard number of
- * charges. -LM-
- */
- value += (value * o_ptr->pval / (k_ptr->pval * 2));
- break;
- }
- case TV_RING:
- case TV_AMULET:
- {
- if (o_ptr->to_h + o_ptr->to_d + o_ptr->to_a < 0) return (0L);
-
- value += ((o_ptr->to_h + o_ptr->to_d + o_ptr->to_a) * 200L);
- break;
- }
- case TV_BOOTS:
- case TV_GLOVES:
- case TV_CLOAK:
- case TV_CROWN:
- case TV_HELM:
- case TV_SHIELD:
- case TV_SOFT_ARMOR:
- case TV_HARD_ARMOR:
- case TV_DRAG_ARMOR:
- {
- if (o_ptr->to_a < 0) return (0L);
-
- value += (((o_ptr->to_h - k_ptr->to_h) + (o_ptr->to_d - k_ptr->to_d)) * 200L + (o_ptr->to_a) * 100L);
- break;
- }
- case TV_BOW:
- case TV_DIGGING:
- case TV_HAFTED:
- case TV_SWORD:
- case TV_POLEARM:
- {
- if (o_ptr->to_h + o_ptr->to_d < 0) return (0L);
-
- value += ((o_ptr->to_h + o_ptr->to_d + o_ptr->to_a) * 100L);
- value += (o_ptr->dd - k_ptr->dd) * o_ptr->ds * 250L;
- value += (o_ptr->ds - k_ptr->ds) * o_ptr->dd * 250L;
- break;
- }
- case TV_SHOT:
- case TV_ARROW:
- case TV_BOLT:
- {
- if (o_ptr->to_h + o_ptr->to_d < 0) return (0L);
-
- value += ((o_ptr->to_h + o_ptr->to_d) * 5L);
- value += (o_ptr->dd - k_ptr->dd) * o_ptr->ds * 5L;
- value += (o_ptr->ds - k_ptr->ds) * o_ptr->dd * 5L;
- break;
- }
- case TV_FIGURINE:
- {
- DEPTH level = r_info[o_ptr->pval].level;
- if (level < 20) value = level * 50L;
- else if (level < 30) value = 1000 + (level - 20) * 150L;
- else if (level < 40) value = 2500 + (level - 30) * 350L;
- else if (level < 50) value = 6000 + (level - 40) * 800L;
- else value = 14000 + (level - 50) * 2000L;
- break;
- }
- case TV_CAPTURE:
- {
- if (!o_ptr->pval) value = 1000L;
- else value = ((r_info[o_ptr->pval].level) * 50L + 1000);
- break;
- }
- case TV_CHEST:
- {
- if (!o_ptr->pval) value = 0L;
- break;
- }
- }
-
- if (value < 0) return 0L;
-
- return (value);
-}
-
-
-/*!
- * @brief オブジェクト価格算出のメインルーチン /
- * Return the price of an item including plusses (and charges)
- * @param o_ptr 判明している現価格を確認したいオブジェクトの構造体参照ポインタ
- * @return オブジェクトの判明している現価格
- * @details
- * This function returns the "value" of the given item (qty one)\n
- *\n
- * Never notice "unknown" bonuses or properties, including "curses",\n
- * since that would give the player information he did not have.\n
- *\n
- * Note that discounted items stay discounted forever, even if\n
- * the discount is "forgotten" by the player via memory loss.\n
- */
-PRICE object_value(object_type *o_ptr)
-{
- PRICE value;
-
- if (object_is_known(o_ptr))
- {
- if (object_is_broken(o_ptr)) return (0L);
- if (object_is_cursed(o_ptr)) return (0L);
-
- value = object_value_real(o_ptr);
- }
- else
- {
- if ((o_ptr->ident & (IDENT_SENSE)) && object_is_broken(o_ptr)) return (0L);
- if ((o_ptr->ident & (IDENT_SENSE)) && object_is_cursed(o_ptr)) return (0L);
-
- value = object_value_base(o_ptr);
- }
-
- if (o_ptr->discount) value -= (value * o_ptr->discount / 100L);
-
- return (value);
-}
-
-
-/*!
* @brief 魔法棒やロッドのスロット分割時に使用回数を分配する /
* Distribute charges of rods or wands.
* @param o_ptr 分割元オブジェクトの構造体参照ポインタ source item
byte value_check_aux1(object_type *o_ptr);
byte value_check_aux2(object_type *o_ptr);
-PRICE object_value(object_type *o_ptr);
-PRICE object_value_real(object_type *o_ptr);
void distribute_charges(object_type *o_ptr, object_type *q_ptr, int amt);
void reduce_charges(object_type *o_ptr, int amt);
int object_similar_part(object_type *o_ptr, object_type *j_ptr);
#include "object/object-ego.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/sv-armor-types.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
#include "object/object-mark-types.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/tr-types.h"
#include "object/object-appraiser.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/sv-lite-types.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "player/avatar.h"
#include "object/object-flavor.h"
#include "object/object-hook.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/trc-types.h"
#include "player/patron.h"
#include "object/object-ego.h"
#include "object/object-flavor.h"
#include "object/object-kind.h"
+#include "object/object-value.h"
#include "object/object2.h"
#include "object/special-object-flags.h"
#include "object/tr-types.h"