}
if (leave_worth) {
- if (o_ptr->object_value() > 0) {
+ if (o_ptr->get_price() > 0) {
return false;
}
}
}
}
- if (IS_FLG(FLG_WORTHLESS) && (o_ptr->object_value() > 0)) {
+ if (IS_FLG(FLG_WORTHLESS) && (o_ptr->get_price() > 0)) {
return false;
}
static bool check_destory_item(PlayerType *player_ptr, destroy_type *destroy_ptr)
{
- if (destroy_ptr->force || (!confirm_destroy && (destroy_ptr->o_ptr->object_value() <= 0))) {
+ if (destroy_ptr->force || (!confirm_destroy && (destroy_ptr->o_ptr->get_price() <= 0))) {
return true;
}
continue;
}
- o_value = o_ptr->object_value();
+ o_value = o_ptr->get_price();
for (j = 0; j < INVEN_PACK; j++) {
if (object_sort_comp(player_ptr, o_ptr, o_value, &player_ptr->inventory_list[j])) {
break;
i = j;
if (i < INVEN_PACK) {
- const auto o_value = o_ptr->object_value();
+ const auto o_value = o_ptr->get_price();
for (j = 0; j < INVEN_PACK; j++) {
if (object_sort_comp(player_ptr, o_ptr, o_value, &player_ptr->inventory_list[j])) {
break;
return;
}
- const auto value = o_ptr->object_value();
+ const auto value = o_ptr->get_price();
int slot;
for (slot = 0; slot < store_ptr->stock_num; slot++) {
if (object_sort_comp(player_ptr, o_ptr, value, &store_ptr->stock[slot])) {
o_ptr->number = old_number;
if (!force) {
- if (confirm_destroy || (o_ptr->object_value() > 0)) {
+ if (confirm_destroy || (o_ptr->get_price() > 0)) {
char out_val[MAX_NLEN + 40];
sprintf(out_val, _("本当に%sを金に変えますか?", "Really turn %s to gold? "), o_name);
if (!get_check(out_val)) {
}
}
- const auto value = o_ptr->object_value();
+ const auto value = o_ptr->get_price();
int slot;
for (slot = 0; slot < st_ptr->stock_num; slot++) {
if (object_sort_comp(player_ptr, o_ptr, value, &st_ptr->stock[slot])) {
continue;
}
- const auto o_value = o_ptr->object_value();
+ const auto o_value = o_ptr->get_price();
int j;
for (j = 0; j < st_ptr->stock_num; j++) {
if (object_sort_comp(player_ptr, o_ptr, o_value, &st_ptr->stock[j])) {
*/
PRICE price_item(PlayerType *player_ptr, ObjectType *o_ptr, int greed, bool flip, StoreSaleType store_num)
{
- auto price = o_ptr->object_value();
+ auto price = o_ptr->get_price();
if (price <= 0) {
return 0L;
}
player_ptr->au += price;
store_prt_gold(player_ptr);
- const auto dummy = q_ptr->object_value() * q_ptr->number;
+ const auto dummy = q_ptr->get_price() * q_ptr->number;
identify_item(player_ptr, o_ptr);
q_ptr = &forge;
q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
}
- const auto value = q_ptr->object_value() * q_ptr->number;
+ const auto value = q_ptr->get_price() * q_ptr->number;
describe_flavor(player_ptr, o_name, q_ptr, 0);
msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, static_cast<long>(price));
return false;
}
- return o_ptr->object_value() > 0;
+ return o_ptr->get_price() > 0;
}
static int mass_lite_produce(const PRICE cost)
*/
void mass_produce(PlayerType *, ObjectType *o_ptr, StoreSaleType store_num)
{
- const auto cost = o_ptr->object_value();
+ const auto cost = o_ptr->get_price();
int size = switch_mass_production(o_ptr, cost, store_num);
auto discount = decide_discount_rate(cost);
if (o_ptr->art_name) {
*/
int store_carry(ObjectType *o_ptr)
{
- const auto value = o_ptr->object_value();
+ const auto value = o_ptr->get_price();
if (value <= 0) {
return -1;
}
}
}
- auto j_value = j_ptr->object_value();
+ auto j_value = j_ptr->get_price();
if (value > j_value) {
break;
}
}
if (store_num == StoreSaleType::BLACK) {
- if (black_market_crap(player_ptr, q_ptr) || (q_ptr->object_value() < 10)) {
+ if (black_market_crap(player_ptr, q_ptr) || (q_ptr->get_price() < 10)) {
continue;
}
} else {
- if (q_ptr->object_value() <= 0) {
+ if (q_ptr->get_price() <= 0) {
continue;
}
}
* @file object-type-definition.h
* @brief アイテム定義の構造体とエンティティ処理実装
* @author Hourier
- * @date 2021/05/02
+ * @date 2022/10/09
*/
#include "system/object-type-definition.h"
* @brief オブジェクト価格算出のメインルーチン
* @return オブジェクトの判明している現価格
*/
-int ObjectType::object_value() const
+int ObjectType::get_price() const
{
int value;
const auto is_worthless = this->is_broken() || this->is_cursed();
return 0;
}
- value = this->object_value_base();
+ value = this->get_baseitem_price();
}
if (this->discount) {
* @brief 未鑑定なベースアイテムの基本価格を返す
* @return オブジェクトの未鑑定価格
*/
-int ObjectType::object_value_base() const
+int ObjectType::get_baseitem_price() const
{
if (this->is_aware()) {
return k_info[this->k_idx].cost;
bool can_pile(const ObjectType *j_ptr) const;
TERM_COLOR get_color() const;
char get_symbol() const;
- int object_value() const;
+ int get_price() const;
private:
- int object_value_base() const;
+ int get_baseitem_price() const;
int calc_figurine_value() const;
int calc_capture_value() const;
};
break;
}
- return o_value > j_ptr->object_value();
+ return o_value > j_ptr->get_price();
}
q_ptr->to_h = 0;
q_ptr->to_d = 0;
*lev = k_info[q_ptr->k_idx].level;
- *val = q_ptr->object_value();
+ *val = q_ptr->get_price();
if (!buf || !dam || !chance || !wgt) {
return;
}