}
strcat(desc, _("のブレス(250)", " (250)"));
- return (desc);
+ return desc;
}
/*!
{
auto flgs = object_flags(o_ptr);
if (flgs.has_not(TR_ACTIVATE))
- return (_("なし", "nothing"));
+ return _("なし", "nothing");
if (activation_index(o_ptr) > RandomArtActType::NONE) {
return item_activation_aux(o_ptr);
* @return 対応するアルファベット
* @details Note that the label does NOT distinguish inven/equip.
*/
-char index_to_label(int i) { return (i < INVEN_MAIN_HAND) ? (I2A(i)) : (I2A(i - INVEN_MAIN_HAND)); }
+char index_to_label(int i) { return i < INVEN_MAIN_HAND ? I2A(i) : I2A(i - INVEN_MAIN_HAND); }
/*!
* @brief オブジェクトの該当装備部位IDを返す /
case ItemKindType::POLEARM:
case ItemKindType::SWORD: {
if (!player_ptr->inventory_list[INVEN_MAIN_HAND].k_idx)
- return (INVEN_MAIN_HAND);
+ return INVEN_MAIN_HAND;
if (player_ptr->inventory_list[INVEN_SUB_HAND].k_idx)
- return (INVEN_MAIN_HAND);
- return (INVEN_SUB_HAND);
+ return INVEN_MAIN_HAND;
+ return INVEN_SUB_HAND;
}
case ItemKindType::CAPTURE:
case ItemKindType::CARD:
case ItemKindType::SHIELD: {
if (!player_ptr->inventory_list[INVEN_SUB_HAND].k_idx)
- return (INVEN_SUB_HAND);
+ return INVEN_SUB_HAND;
if (player_ptr->inventory_list[INVEN_MAIN_HAND].k_idx)
- return (INVEN_SUB_HAND);
- return (INVEN_MAIN_HAND);
+ return INVEN_SUB_HAND;
+ return INVEN_MAIN_HAND;
}
case ItemKindType::BOW: {
- return (INVEN_BOW);
+ return INVEN_BOW;
}
case ItemKindType::RING: {
if (!player_ptr->inventory_list[INVEN_MAIN_RING].k_idx)
- return (INVEN_MAIN_RING);
+ return INVEN_MAIN_RING;
- return (INVEN_SUB_RING);
+ return INVEN_SUB_RING;
}
case ItemKindType::AMULET:
case ItemKindType::WHISTLE: {
- return (INVEN_NECK);
+ return INVEN_NECK;
}
case ItemKindType::LITE: {
- return (INVEN_LITE);
+ return INVEN_LITE;
}
case ItemKindType::DRAG_ARMOR:
case ItemKindType::HARD_ARMOR:
case ItemKindType::SOFT_ARMOR: {
- return (INVEN_BODY);
+ return INVEN_BODY;
}
case ItemKindType::CLOAK: {
- return (INVEN_OUTER);
+ return INVEN_OUTER;
}
case ItemKindType::CROWN:
case ItemKindType::HELM: {
- return (INVEN_HEAD);
+ return INVEN_HEAD;
}
case ItemKindType::GLOVES: {
- return (INVEN_ARMS);
+ return INVEN_ARMS;
}
case ItemKindType::BOOTS: {
- return (INVEN_FEET);
+ return INVEN_FEET;
}
default:
static PRICE object_value_base(const ObjectType *o_ptr)
{
if (o_ptr->is_aware())
- return (k_info[o_ptr->k_idx].cost);
+ return k_info[o_ptr->k_idx].cost;
switch (o_ptr->tval) {
case ItemKindType::FOOD:
- return (5L);
+ return 5;
case ItemKindType::POTION:
- return (20L);
+ return 20;
case ItemKindType::SCROLL:
- return (20L);
+ return 20;
case ItemKindType::STAFF:
- return (70L);
+ return 70;
case ItemKindType::WAND:
- return (50L);
+ return 50;
case ItemKindType::ROD:
- return (90L);
+ return 90;
case ItemKindType::RING:
- return (45L);
+ return 45;
case ItemKindType::AMULET:
- return (45L);
+ return 45;
case ItemKindType::FIGURINE: {
DEPTH level = r_info[o_ptr->pval].level;
if (level < 20)
return level * 50L;
else if (level < 30)
- return 1000 + (level - 20) * 150L;
+ return 1000 + (level - 20) * 150;
else if (level < 40)
- return 2500 + (level - 30) * 350L;
+ return 2500 + (level - 30) * 350;
else if (level < 50)
- return 6000 + (level - 40) * 800L;
+ return 6000 + (level - 40) * 800;
else
- return 14000 + (level - 50) * 2000L;
+ return 14000 + (level - 50) * 2000;
}
case ItemKindType::CAPTURE:
if (!o_ptr->pval)
- return 1000L;
+ return 1000;
else
- return ((r_info[o_ptr->pval].level) * 50L + 1000);
+ return (r_info[o_ptr->pval].level) * 50 + 1000;
default:
break;
}
- return (0L);
+ return 0;
}
/*!
if (o_ptr->is_known()) {
if (o_ptr->is_broken())
- return (0L);
+ return 0;
if (o_ptr->is_cursed())
- return (0L);
+ return 0;
value = object_value_real(o_ptr);
} else {
if ((o_ptr->ident & (IDENT_SENSE)) && o_ptr->is_broken())
- return (0L);
+ return 0;
if ((o_ptr->ident & (IDENT_SENSE)) && o_ptr->is_cursed())
- return (0L);
+ return 0;
value = object_value_base(o_ptr);
}
if (o_ptr->discount)
value -= (value * o_ptr->discount / 100L);
- return (value);
+ return value;
}
/*!
auto *k_ptr = &k_info[o_ptr->k_idx];
if (!k_info[o_ptr->k_idx].cost)
- return (0L);
+ return 0;
PRICE value = k_info[o_ptr->k_idx].cost;
auto flgs = object_flags(o_ptr);
if (o_ptr->is_fixed_artifact()) {
auto *a_ptr = &a_info[o_ptr->name1];
if (!a_ptr->cost)
- return (0L);
+ return 0;
value = a_ptr->cost;
value += flag_cost(o_ptr, o_ptr->pval);
- return (value);
+ return value;
} else if (o_ptr->is_ego()) {
ego_item_type *e_ptr = &e_info[o_ptr->name2];
if (!e_ptr->cost)
- return (0L);
+ return 0;
value += e_ptr->cost;
value += flag_cost(o_ptr, o_ptr->pval);
if (!o_ptr->pval)
break;
if (o_ptr->pval < 0)
- return (0L);
+ return 0;
if (flgs.has(TR_STR))
value += (o_ptr->pval * 200L);
case ItemKindType::RING:
case ItemKindType::AMULET: {
if (o_ptr->to_h + o_ptr->to_d + o_ptr->to_a < 0)
- return (0L);
+ return 0;
value += ((o_ptr->to_h + o_ptr->to_d + o_ptr->to_a) * 200L);
break;
case ItemKindType::HARD_ARMOR:
case ItemKindType::DRAG_ARMOR: {
if (o_ptr->to_a < 0)
- return (0L);
+ return 0;
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 ItemKindType::SWORD:
case ItemKindType::POLEARM: {
if (o_ptr->to_h + o_ptr->to_d < 0)
- return (0L);
+ return 0;
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;
case ItemKindType::ARROW:
case ItemKindType::BOLT: {
if (o_ptr->to_h + o_ptr->to_d < 0)
- return (0L);
+ return 0;
value += ((o_ptr->to_h + o_ptr->to_d) * 5L);
value += (o_ptr->dd - k_ptr->dd) * o_ptr->ds * 5L;
if (value < 0)
return 0L;
- return (value);
+ return value;
}