diff --git a/VisualStudio/Hengband/Hengband.vcxproj b/VisualStudio/Hengband/Hengband.vcxproj
index cee37b3259..58d618c114 100644
--- a/VisualStudio/Hengband/Hengband.vcxproj
+++ b/VisualStudio/Hengband/Hengband.vcxproj
@@ -325,6 +325,8 @@
+
+
@@ -929,7 +931,7 @@
-
+
@@ -1429,6 +1431,8 @@
+
+
@@ -1993,7 +1997,7 @@
-
+
diff --git a/VisualStudio/Hengband/Hengband.vcxproj.filters b/VisualStudio/Hengband/Hengband.vcxproj.filters
index 7eefb0dd70..75bacac43b 100644
--- a/VisualStudio/Hengband/Hengband.vcxproj.filters
+++ b/VisualStudio/Hengband/Hengband.vcxproj.filters
@@ -2436,9 +2436,6 @@
system
-
- system
-
system
@@ -2529,6 +2526,15 @@
system
+
+ system\baseitem
+
+
+ system\baseitem
+
+
+ system\baseitem
+
@@ -5361,9 +5367,6 @@
timed-effect
-
- system
-
system
@@ -5478,6 +5481,15 @@
system\enums
+
+ system\baseitem
+
+
+ system\baseitem
+
+
+ system\baseitem
+
@@ -5751,6 +5763,9 @@
{123780c8-0bf5-47ac-aabd-c9f3dbe74855}
+
+ {b1f45c00-0add-4e05-8c05-bac1f29550c6}
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 3944654707..b39497b26f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -922,7 +922,6 @@ hengband_SOURCES = \
system/angband-system.h system/angband-system.cpp \
system/angband-version.cpp system/angband-version.h \
system/artifact-type-definition.cpp system/artifact-type-definition.h \
- system/baseitem-info.cpp system/baseitem-info.h \
system/building-type-definition.cpp system/building-type-definition.h \
system/dungeon-data-definition.cpp system/dungeon-data-definition.h \
system/dungeon-info.cpp system/dungeon-info.h \
@@ -941,6 +940,10 @@ hengband_SOURCES = \
system/terrain-type-definition.cpp system/terrain-type-definition.h \
system/gamevalue.h \
\
+ system/baseitem/baseitem-definition.cpp system/baseitem/baseitem-definition.h \
+ system/baseitem/baseitem-key.cpp system/baseitem/baseitem-key.h \
+ system/baseitem/baseitem-list.cpp system/baseitem/baseitem-list.h \
+ \
system/enums/game-option-page.h \
system/enums/grid-flow.h \
system/enums/monrace/monrace-id.h \
diff --git a/src/action/activation-execution.cpp b/src/action/activation-execution.cpp
index 7196aeeea1..302564b07c 100644
--- a/src/action/activation-execution.cpp
+++ b/src/action/activation-execution.cpp
@@ -35,7 +35,7 @@
#include "sv-definition/sv-lite-types.h"
#include "sv-definition/sv-ring-types.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/monster-entity.h"
diff --git a/src/action/tunnel-execution.cpp b/src/action/tunnel-execution.cpp
index 80d8c8410e..c54f31bb40 100644
--- a/src/action/tunnel-execution.cpp
+++ b/src/action/tunnel-execution.cpp
@@ -118,7 +118,7 @@ bool exe_tunnel(PlayerType *player_ptr, POSITION y, POSITION x)
}
}
- if (is_hidden_door(player_ptr, grid) && one_in_(4)) {
+ if (grid.is_hidden_door() && one_in_(4)) {
search(player_ptr);
}
diff --git a/src/artifact/random-art-generator.cpp b/src/artifact/random-art-generator.cpp
index 52aec5429c..6fb775692d 100644
--- a/src/artifact/random-art-generator.cpp
+++ b/src/artifact/random-art-generator.cpp
@@ -29,7 +29,7 @@
#include "perception/identification.h"
#include "perception/object-perception.h"
#include "sv-definition/sv-weapon-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
diff --git a/src/autopick/autopick-entry.cpp b/src/autopick/autopick-entry.cpp
index 1d6de3dc6e..eabe36c9e0 100644
--- a/src/autopick/autopick-entry.cpp
+++ b/src/autopick/autopick-entry.cpp
@@ -17,7 +17,7 @@
#include "perception/object-perception.h"
#include "player-base/player-class.h"
#include "player/player-realm.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
diff --git a/src/autopick/autopick-matcher.cpp b/src/autopick/autopick-matcher.cpp
index 49cd80e183..802aeb6e49 100644
--- a/src/autopick/autopick-matcher.cpp
+++ b/src/autopick/autopick-matcher.cpp
@@ -20,7 +20,7 @@
#include "perception/object-perception.h"
#include "player-base/player-class.h"
#include "player/player-realm.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/monster-race-info.h"
diff --git a/src/birth/game-play-initializer.cpp b/src/birth/game-play-initializer.cpp
index 4d6354d61b..0f85c3c253 100644
--- a/src/birth/game-play-initializer.cpp
+++ b/src/birth/game-play-initializer.cpp
@@ -15,7 +15,8 @@
#include "player/digestion-processor.h"
#include "player/player-spell-status.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/building-type-definition.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
diff --git a/src/birth/inventory-initializer.cpp b/src/birth/inventory-initializer.cpp
index 00230f6134..d28b9bece5 100644
--- a/src/birth/inventory-initializer.cpp
+++ b/src/birth/inventory-initializer.cpp
@@ -29,6 +29,8 @@
#include "sv-definition/sv-staff-types.h"
#include "sv-definition/sv-wand-types.h"
#include "sv-definition/sv-weapon-types.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/enum-converter.h"
diff --git a/src/cmd-action/cmd-spell.cpp b/src/cmd-action/cmd-spell.cpp
index 48a8e4536c..bbdff32236 100644
--- a/src/cmd-action/cmd-spell.cpp
+++ b/src/cmd-action/cmd-spell.cpp
@@ -56,7 +56,7 @@
#include "status/bad-status-setter.h"
#include "status/base-status.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
diff --git a/src/cmd-item/cmd-destroy.cpp b/src/cmd-item/cmd-destroy.cpp
index 0e5eaeecec..030309d455 100644
--- a/src/cmd-item/cmd-destroy.cpp
+++ b/src/cmd-item/cmd-destroy.cpp
@@ -30,7 +30,7 @@
#include "racial/racial-android.h"
#include "status/action-setter.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
diff --git a/src/cmd-item/cmd-eat.cpp b/src/cmd-item/cmd-eat.cpp
index 2aadd8e4d2..6218648523 100644
--- a/src/cmd-item/cmd-eat.cpp
+++ b/src/cmd-item/cmd-eat.cpp
@@ -227,7 +227,7 @@ void exe_eat_food(PlayerType *player_ptr, INVENTORY_IDX i_idx)
sound(SOUND_EAT);
PlayerEnergy(player_ptr).set_player_turn_energy(100);
- const auto lev = o_ptr->get_baseitem().level;
+ const auto level = o_ptr->get_baseitem_level();
/* Identity not known yet */
const auto &bi_key = o_ptr->bi_key;
@@ -263,7 +263,7 @@ void exe_eat_food(PlayerType *player_ptr, INVENTORY_IDX i_idx)
/* The player is now aware of the object */
if (ident && !o_ptr->is_aware()) {
object_aware(player_ptr, o_ptr);
- gain_exp(player_ptr, (lev + (player_ptr->lev >> 1)) / player_ptr->lev);
+ gain_exp(player_ptr, (level + (player_ptr->lev >> 1)) / player_ptr->lev);
}
static constexpr auto flags_swrf = {
diff --git a/src/cmd-item/cmd-magiceat.cpp b/src/cmd-item/cmd-magiceat.cpp
index 376e7b296f..c9bc04dea3 100644
--- a/src/cmd-item/cmd-magiceat.cpp
+++ b/src/cmd-item/cmd-magiceat.cpp
@@ -71,7 +71,8 @@
#include "player-status/player-energy.h"
#include "player/player-status-table.h"
#include "spell/spell-info.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
#include "term/screen-processor.h"
diff --git a/src/cmd-item/cmd-zapwand.cpp b/src/cmd-item/cmd-zapwand.cpp
index fa24bf7574..8874facd64 100644
--- a/src/cmd-item/cmd-zapwand.cpp
+++ b/src/cmd-item/cmd-zapwand.cpp
@@ -32,7 +32,7 @@
#include "status/action-setter.h"
#include "status/experience.h"
#include "sv-definition/sv-wand-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
diff --git a/src/cmd-visual/cmd-visuals.cpp b/src/cmd-visual/cmd-visuals.cpp
index 76e588e502..4cad915d16 100644
--- a/src/cmd-visual/cmd-visuals.cpp
+++ b/src/cmd-visual/cmd-visuals.cpp
@@ -14,6 +14,8 @@
#include "knowledge/knowledge-monsters.h"
#include "knowledge/lighting-level-table.h"
#include "main/sound-of-music.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
diff --git a/src/combat/shoot.cpp b/src/combat/shoot.cpp
index a57515ce46..bb863d6167 100644
--- a/src/combat/shoot.cpp
+++ b/src/combat/shoot.cpp
@@ -47,7 +47,7 @@
#include "player/player-status-table.h"
#include "sv-definition/sv-bow-types.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/enums/monrace/monrace-id.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
diff --git a/src/core/object-compressor.cpp b/src/core/object-compressor.cpp
index 3879037416..fda13d1032 100644
--- a/src/core/object-compressor.cpp
+++ b/src/core/object-compressor.cpp
@@ -3,7 +3,6 @@
#include "floor/floor-object.h"
#include "floor/geometry.h"
#include "grid/grid.h"
-#include "system/baseitem-info.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/monster-entity.h"
@@ -72,7 +71,7 @@ void compact_objects(PlayerType *player_ptr, int size)
for (OBJECT_IDX i = 1; i < floor_ptr->o_max; i++) {
o_ptr = &floor_ptr->o_list[i];
- if (!o_ptr->is_valid() || (o_ptr->get_baseitem().level > cur_lev)) {
+ if (!o_ptr->is_valid() || (o_ptr->get_baseitem_level() > cur_lev)) {
continue;
}
diff --git a/src/core/visuals-reseter.cpp b/src/core/visuals-reseter.cpp
index 2a42f7f0b6..c7edab9722 100644
--- a/src/core/visuals-reseter.cpp
+++ b/src/core/visuals-reseter.cpp
@@ -1,7 +1,8 @@
#include "core/visuals-reseter.h"
#include "game-option/special-options.h"
#include "io/read-pref-file.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
diff --git a/src/effect/effect-feature.cpp b/src/effect/effect-feature.cpp
index 1fc7248156..f95114c865 100644
--- a/src/effect/effect-feature.cpp
+++ b/src/effect/effect-feature.cpp
@@ -171,7 +171,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POS
break;
}
case AttributeType::KILL_TRAP: {
- if (is_hidden_door(player_ptr, grid)) {
+ if (grid.is_hidden_door()) {
disclose_grid(player_ptr, y, x);
if (known) {
obvious = true;
diff --git a/src/flavor/flavor-describer.cpp b/src/flavor/flavor-describer.cpp
index c08978c4be..9ef2c0c433 100644
--- a/src/flavor/flavor-describer.cpp
+++ b/src/flavor/flavor-describer.cpp
@@ -29,7 +29,7 @@
#include "sv-definition/sv-lite-types.h"
#include "sv-definition/sv-ring-types.h"
#include "sv-definition/sv-weapon-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
@@ -345,7 +345,7 @@ static std::string describe_charges_rod(const ItemEntity &item)
return _("(充填中)", " (charging)");
}
- const auto timeout_per_one = item.get_baseitem().pval;
+ const auto timeout_per_one = item.get_baseitem_pval();
auto num_of_charging = (item.timeout + (timeout_per_one - 1)) / timeout_per_one;
if (num_of_charging > item.number) {
num_of_charging = item.number;
diff --git a/src/flavor/flavor-util.cpp b/src/flavor/flavor-util.cpp
index 6522316ce9..2eda4171b6 100644
--- a/src/flavor/flavor-util.cpp
+++ b/src/flavor/flavor-util.cpp
@@ -5,6 +5,7 @@
#include "object/tval-types.h"
#include "sv-definition/sv-food-types.h"
#include "system/artifact-type-definition.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "util/string-processor.h"
#include
diff --git a/src/flavor/named-item-describer.cpp b/src/flavor/named-item-describer.cpp
index fd050f95d2..f5a331cd59 100644
--- a/src/flavor/named-item-describer.cpp
+++ b/src/flavor/named-item-describer.cpp
@@ -11,6 +11,7 @@
#include "object-enchant/tr-types.h"
#include "perception/object-perception.h"
#include "system/artifact-type-definition.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/flavor/object-flavor.cpp b/src/flavor/object-flavor.cpp
index 40f1a00ada..36581dc2bd 100644
--- a/src/flavor/object-flavor.cpp
+++ b/src/flavor/object-flavor.cpp
@@ -32,7 +32,7 @@
#include "player/player-status.h"
#include "sv-definition/sv-food-types.h"
#include "sv-definition/sv-lite-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "util/bit-flags-calculator.h"
#include
#include
diff --git a/src/flavor/tval-description-switcher.cpp b/src/flavor/tval-description-switcher.cpp
index 2a063b8966..31479cc0d5 100644
--- a/src/flavor/tval-description-switcher.cpp
+++ b/src/flavor/tval-description-switcher.cpp
@@ -10,7 +10,8 @@
#include "locale/english.h"
#include "object-enchant/trg-types.h"
#include "object/tval-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/monster-race-info.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/floor/fixed-map-generator.cpp b/src/floor/fixed-map-generator.cpp
index fc0005384c..0c3babf840 100644
--- a/src/floor/fixed-map-generator.cpp
+++ b/src/floor/fixed-map-generator.cpp
@@ -25,6 +25,8 @@
#include "room/rooms-vault.h"
#include "sv-definition/sv-scroll-types.h"
#include "system/artifact-type-definition.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
diff --git a/src/floor/floor-events.cpp b/src/floor/floor-events.cpp
index 21ea5d7111..132da3fb1e 100644
--- a/src/floor/floor-events.cpp
+++ b/src/floor/floor-events.cpp
@@ -28,7 +28,6 @@
#include "sv-definition/sv-protector-types.h"
#include "sv-definition/sv-ring-types.h"
#include "system/angband-system.h"
-#include "system/baseitem-info.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
@@ -231,9 +230,9 @@ static byte get_dungeon_feeling(PlayerType *player_ptr)
delta += 15 * base;
}
- const auto &baseitem = o_ptr->get_baseitem();
- if (!o_ptr->is_cursed() && !o_ptr->is_broken() && baseitem.level > floor_ptr->dun_level) {
- delta += (baseitem.level - floor_ptr->dun_level) * base;
+ const auto item_level = o_ptr->get_baseitem_level();
+ if (!o_ptr->is_cursed() && !o_ptr->is_broken() && item_level > floor_ptr->dun_level) {
+ delta += (item_level - floor_ptr->dun_level) * base;
}
rating += rating_boost(delta);
diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp
index af1ba78a52..a5980dac73 100644
--- a/src/grid/grid.cpp
+++ b/src/grid/grid.cpp
@@ -145,18 +145,6 @@ bool new_player_spot(PlayerType *player_ptr)
return true;
}
-/*!
- * @brief マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door
- * @param player_ptr プレイヤーへの参照ポインタ
- * @param grid マス構造体の参照ポインタ
- * @return 隠されたドアがあるならTRUEを返す。
- */
-bool is_hidden_door(PlayerType *player_ptr, const Grid &grid)
-{
- (void)player_ptr; // 後でリファクタリングする.
- return (grid.mimic || grid.cave_has_flag(TerrainCharacteristics::SECRET)) && grid.get_terrain().is_closed_door();
-}
-
/*!
* @brief 指定された座標のマスが現在照らされているかを返す。 / Check for "local" illumination
* @param y y座標
diff --git a/src/grid/grid.h b/src/grid/grid.h
index 0d6501cf73..9ca06a4ef0 100644
--- a/src/grid/grid.h
+++ b/src/grid/grid.h
@@ -67,7 +67,6 @@ class MonraceDefinition;
enum class GridCountKind;
enum class TerrainCharacteristics;
bool new_player_spot(PlayerType *player_ptr);
-bool is_hidden_door(PlayerType *player_ptr, const Grid &grid);
bool player_can_enter(PlayerType *player_ptr, FEAT_IDX feature, BIT_FLAGS16 mode);
bool feat_uses_special(FEAT_IDX f_idx);
void update_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x);
diff --git a/src/info-reader/baseitem-reader.cpp b/src/info-reader/baseitem-reader.cpp
index bcc158cdda..344d578fc1 100644
--- a/src/info-reader/baseitem-reader.cpp
+++ b/src/info-reader/baseitem-reader.cpp
@@ -14,7 +14,8 @@
#include "main/angband-headers.h"
#include "object-enchant/tr-types.h"
#include "object/tval-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "term/gameterm.h"
#include "util/bit-flags-calculator.h"
#include "util/enum-converter.h"
@@ -27,7 +28,7 @@
* @param what 参照元の文字列
* @return 見つけたらtrue
*/
-static bool grab_one_baseitem_flag(BaseitemInfo &baseitem, std::string_view what)
+static bool grab_one_baseitem_flag(BaseitemDefinition &baseitem, std::string_view what)
{
if (TrFlags::grab_one_flag(baseitem.flags, baseitem_flags, what)) {
return true;
@@ -47,7 +48,7 @@ static bool grab_one_baseitem_flag(BaseitemInfo &baseitem, std::string_view what
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_symbol(const nlohmann::json &symbol_data, BaseitemInfo &baseitem)
+static errr set_baseitem_symbol(const nlohmann::json &symbol_data, BaseitemDefinition &baseitem)
{
if (symbol_data.is_null()) {
return PARSE_ERROR_TOO_FEW_ARGUMENTS;
@@ -81,7 +82,7 @@ static errr set_baseitem_symbol(const nlohmann::json &symbol_data, BaseitemInfo
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_kind(nlohmann::json &baseitem_data, BaseitemInfo &baseitem)
+static errr set_baseitem_kind(nlohmann::json &baseitem_data, BaseitemDefinition &baseitem)
{
if (baseitem_data.is_null()) {
return PARSE_ERROR_TOO_FEW_ARGUMENTS;
@@ -106,7 +107,7 @@ static errr set_baseitem_kind(nlohmann::json &baseitem_data, BaseitemInfo &basei
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_parameter_value(const nlohmann::json &pval_data, BaseitemInfo &baseitem)
+static errr set_baseitem_parameter_value(const nlohmann::json &pval_data, BaseitemDefinition &baseitem)
{
if (auto err = info_set_integer(pval_data, baseitem.pval, false, Range(-9999, 9999))) {
return err;
@@ -124,7 +125,7 @@ static errr set_baseitem_parameter_value(const nlohmann::json &pval_data, Baseit
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_allocations(nlohmann::json &allocations_data, BaseitemInfo &baseitem)
+static errr set_baseitem_allocations(nlohmann::json &allocations_data, BaseitemDefinition &baseitem)
{
if (allocations_data.is_null()) {
return PARSE_ERROR_NONE;
@@ -153,7 +154,7 @@ static errr set_baseitem_allocations(nlohmann::json &allocations_data, BaseitemI
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_activate(const nlohmann::json &act_data, BaseitemInfo &baseitem)
+static errr set_baseitem_activate(const nlohmann::json &act_data, BaseitemDefinition &baseitem)
{
if (!act_data.is_string()) {
return PARSE_ERROR_NONE;
@@ -175,7 +176,7 @@ static errr set_baseitem_activate(const nlohmann::json &act_data, BaseitemInfo &
* @param baseitem 保管先のベースアイテム情報インスタンス
* @return エラーコード
*/
-static errr set_baseitem_flags(const nlohmann::json &flag_data, BaseitemInfo &baseitem)
+static errr set_baseitem_flags(const nlohmann::json &flag_data, BaseitemDefinition &baseitem)
{
if (flag_data.is_null()) {
return PARSE_ERROR_NONE;
diff --git a/src/info-reader/general-parser.cpp b/src/info-reader/general-parser.cpp
index 2a0342e077..c172bfbc7b 100644
--- a/src/info-reader/general-parser.cpp
+++ b/src/info-reader/general-parser.cpp
@@ -12,7 +12,8 @@
#include "player-info/race-types.h"
#include "realm/realm-types.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/building-type-definition.h"
#include "system/floor-type-definition.h"
#include "system/system-variables.h"
diff --git a/src/inventory/recharge-processor.cpp b/src/inventory/recharge-processor.cpp
index dd7ac060b4..0f451c16ed 100644
--- a/src/inventory/recharge-processor.cpp
+++ b/src/inventory/recharge-processor.cpp
@@ -6,7 +6,6 @@
#include "hpmp/hp-mp-regenerator.h"
#include "inventory/inventory-slot-types.h"
#include "object/tval-types.h"
-#include "system/baseitem-info.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
@@ -84,28 +83,30 @@ void recharge_magic_items(PlayerType *player_ptr)
*/
for (changed = false, i = 0; i < INVEN_PACK; i++) {
auto &item = player_ptr->inventory_list[i];
- const auto &baseitem = item.get_baseitem();
if (!item.is_valid()) {
continue;
}
- if ((item.bi_key.tval() == ItemKindType::ROD) && (item.timeout)) {
- TIME_EFFECT temp = (item.timeout + (baseitem.pval - 1)) / baseitem.pval;
- if (temp > item.number) {
- temp = (TIME_EFFECT)item.number;
- }
+ if ((item.bi_key.tval() != ItemKindType::ROD) || (item.timeout == 0)) {
+ continue;
+ }
- item.timeout -= temp;
- if (item.timeout < 0) {
- item.timeout = 0;
- }
+ const auto base_pval = item.get_baseitem_pval();
+ short temp = (item.timeout + (base_pval - 1)) / base_pval;
+ if (temp > item.number) {
+ temp = static_cast(item.number);
+ }
- if (!(item.timeout)) {
- recharged_notice(player_ptr, item);
- changed = true;
- } else if (item.timeout % baseitem.pval) {
- changed = true;
- }
+ item.timeout -= temp;
+ if (item.timeout < 0) {
+ item.timeout = 0;
+ }
+
+ if (!(item.timeout)) {
+ recharged_notice(player_ptr, item);
+ changed = true;
+ } else if (item.timeout % base_pval) {
+ changed = true;
}
}
diff --git a/src/io-dump/special-class-dump.cpp b/src/io-dump/special-class-dump.cpp
index 8e19f954eb..5af1cca9c7 100644
--- a/src/io-dump/special-class-dump.cpp
+++ b/src/io-dump/special-class-dump.cpp
@@ -10,11 +10,13 @@
#include "mind/mind-blue-mage.h"
#include "monster-race/race-ability-flags.h"
#include "mspell/monster-power-table.h"
+#include "object/tval-types.h"
#include "player-base/player-class.h"
#include "player-info/bluemage-data-type.h"
#include "player-info/magic-eater-data-type.h"
#include "smith/object-smith.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/player-type-definition.h"
#include "util/enum-converter.h"
#include "util/flag-group.h"
diff --git a/src/io/interpret-pref-file.cpp b/src/io/interpret-pref-file.cpp
index ce81c0c5eb..946ad8066c 100644
--- a/src/io/interpret-pref-file.cpp
+++ b/src/io/interpret-pref-file.cpp
@@ -13,7 +13,8 @@
#include "io/gf-descriptions.h"
#include "io/input-key-requester.h"
#include "io/tokenizer.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/enums/game-option-page.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
diff --git a/src/item-info/flavor-initializer.cpp b/src/item-info/flavor-initializer.cpp
index f63b81088c..af75e99a8e 100644
--- a/src/item-info/flavor-initializer.cpp
+++ b/src/item-info/flavor-initializer.cpp
@@ -7,7 +7,8 @@
#include "item-info/flavor-initializer.h"
#include "object/tval-types.h"
#include "system/angband-system.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
/*!
* @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン
@@ -35,7 +36,7 @@ void initialize_items_flavor()
}
if (!baseitem.flavor) {
- baseitem.mark_as_aware();
+ baseitem.mark_awareness(true);
}
baseitem.decide_easy_know();
diff --git a/src/knowledge/knowledge-experiences.cpp b/src/knowledge/knowledge-experiences.cpp
index 521a3651a4..78b74b0ebc 100644
--- a/src/knowledge/knowledge-experiences.cpp
+++ b/src/knowledge/knowledge-experiences.cpp
@@ -16,7 +16,8 @@
#include "spell/spells-execution.h"
#include "spell/technic-info-table.h"
#include "sv-definition/sv-bow-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/player-type-definition.h"
#include "util/angband-files.h"
diff --git a/src/knowledge/knowledge-items.cpp b/src/knowledge/knowledge-items.cpp
index 81902d5c91..efceb28cbb 100644
--- a/src/knowledge/knowledge-items.cpp
+++ b/src/knowledge/knowledge-items.cpp
@@ -19,6 +19,8 @@
#include "perception/identification.h"
#include "perception/object-perception.h"
#include "system/artifact-type-definition.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/item-entity.h"
@@ -120,7 +122,7 @@ void do_cmd_knowledge_artifacts(PlayerType *player_ptr)
* @param baseitem ベースアイテムへの参照
* @return collect_objects() の処理を続行するか否か
*/
-static bool check_baseitem_chance(const BIT_FLAGS8 mode, const BaseitemInfo &baseitem)
+static bool check_baseitem_chance(const BIT_FLAGS8 mode, const BaseitemDefinition &baseitem)
{
if (mode & 0x02) {
return true;
diff --git a/src/load/item/item-loader-base.cpp b/src/load/item/item-loader-base.cpp
index 0452b2a0c0..8b983f0718 100644
--- a/src/load/item/item-loader-base.cpp
+++ b/src/load/item/item-loader-base.cpp
@@ -3,7 +3,8 @@
#include "load/angband-version-comparer.h"
#include "load/load-util.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "util/bit-flags-calculator.h"
#include "util/enum-converter.h"
@@ -13,7 +14,7 @@
void ItemLoaderBase::load_item()
{
auto loading_max_k_idx = rd_u16b();
- BaseitemInfo dummy;
+ BaseitemDefinition dummy;
auto &baseitems = BaseitemList::get_instance();
for (uint16_t i = 0; i < loading_max_k_idx; i++) {
auto &baseitem = i < baseitems.size() ? baseitems.get_baseitem(i) : dummy;
diff --git a/src/load/old/item-loader-savefile50.cpp b/src/load/old/item-loader-savefile50.cpp
index 11266b7e6d..da606c5c06 100644
--- a/src/load/old/item-loader-savefile50.cpp
+++ b/src/load/old/item-loader-savefile50.cpp
@@ -11,7 +11,7 @@
#include "object/tval-types.h"
#include "sv-definition/sv-lite-types.h"
#include "system/angband.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/load/old/load-v1-5-0.cpp b/src/load/old/load-v1-5-0.cpp
index d6b1ff8f50..aa90ee900f 100644
--- a/src/load/old/load-v1-5-0.cpp
+++ b/src/load/old/load-v1-5-0.cpp
@@ -35,7 +35,8 @@
#include "sv-definition/sv-lite-types.h"
#include "system/angband-exceptions.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/dungeon-info.h"
#include "system/enums/monrace/monrace-id.h"
#include "system/floor-type-definition.h"
diff --git a/src/main/game-data-initializer.cpp b/src/main/game-data-initializer.cpp
index 1677fea3bb..77506b5ccc 100644
--- a/src/main/game-data-initializer.cpp
+++ b/src/main/game-data-initializer.cpp
@@ -12,7 +12,8 @@
#include "game-option/option-flags.h"
#include "game-option/option-types-table.h"
#include "system/alloc-entries.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
diff --git a/src/main/info-initializer.cpp b/src/main/info-initializer.cpp
index c7d6f8fe22..ad95cbaed2 100644
--- a/src/main/info-initializer.cpp
+++ b/src/main/info-initializer.cpp
@@ -28,7 +28,8 @@
#include "room/rooms-vault.h"
#include "system/angband-version.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/dungeon-info.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
diff --git a/src/market/arena-entry.cpp b/src/market/arena-entry.cpp
index c6e0bfd15f..2364e32a82 100644
--- a/src/market/arena-entry.cpp
+++ b/src/market/arena-entry.cpp
@@ -8,7 +8,7 @@
#include "sv-definition/sv-scroll-types.h"
#include "sv-definition/sv-staff-types.h"
#include "sv-definition/sv-wand-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/enums/monrace/monrace-id.h"
#include "system/monster-race-info.h"
#ifndef JP
diff --git a/src/market/bounty-prize-table.cpp b/src/market/bounty-prize-table.cpp
index 5e16b21d1d..3a89f310dc 100644
--- a/src/market/bounty-prize-table.cpp
+++ b/src/market/bounty-prize-table.cpp
@@ -2,7 +2,7 @@
#include "object/tval-types.h"
#include "sv-definition/sv-potion-types.h"
#include "sv-definition/sv-scroll-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
const std::vector prize_list = {
{ ItemKindType::POTION, SV_POTION_CURING },
diff --git a/src/market/building-craft-fix.cpp b/src/market/building-craft-fix.cpp
index 8e8ef62190..e90953903f 100644
--- a/src/market/building-craft-fix.cpp
+++ b/src/market/building-craft-fix.cpp
@@ -19,7 +19,8 @@
#include "spell-realm/spells-hex.h"
#include "sv-definition/sv-other-types.h"
#include "sv-definition/sv-weapon-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
diff --git a/src/market/building-initializer.cpp b/src/market/building-initializer.cpp
index 37d0cd4ce5..a2c8658621 100644
--- a/src/market/building-initializer.cpp
+++ b/src/market/building-initializer.cpp
@@ -8,7 +8,8 @@
#include "store/store-util.h"
#include "store/store.h"
#include "system/angband.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/building-type-definition.h"
#include "system/item-entity.h"
#include "util/angband-files.h"
diff --git a/src/market/building-recharger.cpp b/src/market/building-recharger.cpp
index 23e90d35a9..139ca07f62 100644
--- a/src/market/building-recharger.cpp
+++ b/src/market/building-recharger.cpp
@@ -13,7 +13,6 @@
#include "object/item-use-flags.h"
#include "perception/object-perception.h"
#include "spell-kind/spells-perception.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -63,14 +62,15 @@ void building_recharge(PlayerType *player_ptr)
return;
}
- const auto &baseitem = o_ptr->get_baseitem();
- const auto lev = baseitem.level;
+ const auto item_level = o_ptr->get_baseitem_level();
const auto tval = o_ptr->bi_key.tval();
+ const auto base_pval = o_ptr->get_baseitem_pval();
+ const auto base_cost = o_ptr->get_baseitem_cost();
int price;
switch (tval) {
case ItemKindType::ROD:
if (o_ptr->timeout > 0) {
- price = (lev * 50 * o_ptr->timeout) / baseitem.pval;
+ price = (item_level * 50 * o_ptr->timeout) / base_pval;
break;
}
@@ -78,16 +78,16 @@ void building_recharge(PlayerType *player_ptr)
msg_format(_("それは再充填する必要はありません。", "That doesn't need to be recharged."));
return;
case ItemKindType::STAFF:
- price = (baseitem.cost / 10) * o_ptr->number;
+ price = (base_cost / 10) * o_ptr->number;
price = std::max(10, price);
break;
default:
- price = baseitem.cost / 10;
+ price = base_cost / 10;
price = std::max(10, price);
break;
}
- if ((tval == ItemKindType::WAND) && (o_ptr->pval / o_ptr->number >= baseitem.pval)) {
+ if ((tval == ItemKindType::WAND) && (o_ptr->pval / o_ptr->number >= base_pval)) {
if (o_ptr->number > 1) {
msg_print(_("この魔法棒はもう充分に充填されています。", "These wands are already fully charged."));
} else {
@@ -95,7 +95,7 @@ void building_recharge(PlayerType *player_ptr)
}
return;
- } else if ((tval == ItemKindType::STAFF) && o_ptr->pval >= baseitem.pval) {
+ } else if ((tval == ItemKindType::STAFF) && o_ptr->pval >= base_pval) {
if (o_ptr->number > 1) {
msg_print(_("この杖はもう充分に充填されています。", "These staffs are already fully charged."));
} else {
@@ -130,9 +130,9 @@ void building_recharge(PlayerType *player_ptr)
} else {
int max_charges;
if (tval == ItemKindType::STAFF) {
- max_charges = baseitem.pval - o_ptr->pval;
+ max_charges = base_pval - o_ptr->pval;
} else {
- max_charges = o_ptr->number * baseitem.pval - o_ptr->pval;
+ max_charges = o_ptr->number * base_pval - o_ptr->pval;
}
const auto mes = _("一回分$%d で何回分充填しますか?", "Add how many charges for %d gold apiece? ");
@@ -191,21 +191,22 @@ void building_recharge_all(PlayerType *player_ptr)
total_cost += 50;
}
- const auto &baseitem = item.get_baseitem();
- const auto lev = baseitem.level;
+ const auto item_level = item.get_baseitem_level();
+ const auto base_pval = item.get_baseitem_pval();
+ const auto base_cost = item.get_baseitem_cost();
switch (item.bi_key.tval()) {
case ItemKindType::ROD:
- price = (lev * 50 * item.timeout) / baseitem.pval;
+ price = (item_level * 50 * item.timeout) / base_pval;
break;
case ItemKindType::STAFF:
- price = (baseitem.cost / 10) * item.number;
+ price = (base_cost / 10) * item.number;
price = std::max(10, price);
- price = (baseitem.pval - item.pval) * price;
+ price = (base_pval - item.pval) * price;
break;
case ItemKindType::WAND:
- price = (baseitem.cost / 10);
+ price = (base_cost / 10);
price = std::max(10, price);
- price = (item.number * baseitem.pval - item.pval) * price;
+ price = (item.number * base_pval - item.pval) * price;
break;
default:
break;
@@ -234,7 +235,6 @@ void building_recharge_all(PlayerType *player_ptr)
for (short i = 0; i < INVEN_PACK; i++) {
auto *o_ptr = &player_ptr->inventory_list[i];
- const auto &baseitem = o_ptr->get_baseitem();
if (!o_ptr->can_recharge()) {
continue;
}
@@ -244,20 +244,21 @@ void building_recharge_all(PlayerType *player_ptr)
autopick_alter_item(player_ptr, i, false);
}
+ const auto base_pval = o_ptr->get_baseitem_pval();
switch (o_ptr->bi_key.tval()) {
case ItemKindType::ROD:
o_ptr->timeout = 0;
break;
case ItemKindType::STAFF:
- if (o_ptr->pval < baseitem.pval) {
- o_ptr->pval = baseitem.pval;
+ if (o_ptr->pval < base_pval) {
+ o_ptr->pval = base_pval;
}
o_ptr->ident &= ~(IDENT_EMPTY);
break;
case ItemKindType::WAND:
- if (o_ptr->pval < o_ptr->number * baseitem.pval) {
- o_ptr->pval = o_ptr->number * baseitem.pval;
+ if (o_ptr->pval < o_ptr->number * base_pval) {
+ o_ptr->pval = o_ptr->number * base_pval;
}
o_ptr->ident &= ~(IDENT_EMPTY);
diff --git a/src/mind/mind-mage.cpp b/src/mind/mind-mage.cpp
index 01bc448ea9..e00d05ce57 100644
--- a/src/mind/mind-mage.cpp
+++ b/src/mind/mind-mage.cpp
@@ -15,7 +15,6 @@
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
#include "player-base/player-class.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "view/display-messages.h"
@@ -37,25 +36,25 @@ bool eat_magic(PlayerType *player_ptr, int power)
return false;
}
- const auto &baseitem = o_ptr->get_baseitem();
- const auto lev = baseitem.level;
+ const auto base_pval = o_ptr->get_baseitem_pval();
+ const auto item_level = o_ptr->get_baseitem_level();
const auto tval = o_ptr->bi_key.tval();
auto recharge_strength = 0;
auto is_eating_successful = true;
if (tval == ItemKindType::ROD) {
- recharge_strength = ((power > lev / 2) ? (power - lev / 2) : 0) / 5;
+ recharge_strength = ((power > item_level / 2) ? (power - item_level / 2) : 0) / 5;
if (one_in_(recharge_strength)) {
is_eating_successful = false;
} else {
- if (o_ptr->timeout > (o_ptr->number - 1) * baseitem.pval) {
+ if (o_ptr->timeout > (o_ptr->number - 1) * base_pval) {
msg_print(_("充填中のロッドから魔力を吸収することはできません。", "You can't absorb energy from a discharged rod."));
} else {
- player_ptr->csp += lev;
- o_ptr->timeout += baseitem.pval;
+ player_ptr->csp += item_level;
+ o_ptr->timeout += base_pval;
}
}
} else {
- recharge_strength = (100 + power - lev) / 15;
+ recharge_strength = (100 + power - item_level) / 15;
if (recharge_strength < 0) {
recharge_strength = 0;
}
@@ -64,7 +63,7 @@ bool eat_magic(PlayerType *player_ptr, int power)
is_eating_successful = false;
} else {
if (o_ptr->pval > 0) {
- player_ptr->csp += lev / 2;
+ player_ptr->csp += item_level / 2;
o_ptr->pval--;
if ((tval == ItemKindType::STAFF) && (i_idx >= 0) && (o_ptr->number > 1)) {
@@ -98,7 +97,7 @@ bool eat_magic(PlayerType *player_ptr, int power)
const auto item_name = describe_flavor(player_ptr, *o_ptr, OD_NAME_ONLY);
msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), item_name.data());
if (tval == ItemKindType::ROD) {
- o_ptr->timeout = baseitem.pval * o_ptr->number;
+ o_ptr->timeout = base_pval * o_ptr->number;
} else if (o_ptr->is_wand_staff()) {
o_ptr->pval = 0;
}
@@ -163,7 +162,7 @@ bool eat_magic(PlayerType *player_ptr, int power)
if (fail_type == 1) {
if (tval == ItemKindType::ROD) {
msg_print(_("ロッドは破損を免れたが、魔力は全て失なわれた。", "You save your rod from destruction, but all charges are lost."));
- o_ptr->timeout = baseitem.pval * o_ptr->number;
+ o_ptr->timeout = base_pval * o_ptr->number;
} else if (tval == ItemKindType::WAND) {
constexpr auto mes = _("%sは破損を免れたが、魔力が全て失われた。", "You save your %s from destruction, but all charges are lost.");
msg_format(mes, item_name.data());
@@ -176,7 +175,7 @@ bool eat_magic(PlayerType *player_ptr, int power)
msg_format(_("乱暴な魔法のために%sが一本壊れた!", "Wild magic consumes one of your %s!"), item_name.data());
/* Reduce rod stack maximum timeout, drain wands. */
if (tval == ItemKindType::ROD) {
- o_ptr->timeout = std::min(o_ptr->timeout, baseitem.pval * (o_ptr->number - 1));
+ o_ptr->timeout = std::min(o_ptr->timeout, base_pval * (o_ptr->number - 1));
} else if (tval == ItemKindType::WAND) {
o_ptr->pval = o_ptr->pval * (o_ptr->number - 1) / o_ptr->number;
}
diff --git a/src/monster-attack/monster-eating.cpp b/src/monster-attack/monster-eating.cpp
index 50629617dc..fa66b4fe11 100644
--- a/src/monster-attack/monster-eating.cpp
+++ b/src/monster-attack/monster-eating.cpp
@@ -22,7 +22,6 @@
#include "player/player-status-flags.h"
#include "player/player-status-table.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "system/monster-entity.h"
@@ -227,10 +226,9 @@ bool process_un_power(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
}
const auto is_magic_mastery = has_magic_mastery(player_ptr) != 0;
- const auto &baseitem = monap_ptr->o_ptr->get_baseitem();
- const auto pval = baseitem.pval;
+ const auto base_pval = monap_ptr->o_ptr->get_baseitem_pval();
const auto level = monap_ptr->rlev;
- auto drain = is_magic_mastery ? std::min(pval, pval * level / 400 + pval * randint1(level) / 400) : pval;
+ auto drain = is_magic_mastery ? std::min(base_pval, base_pval * level / 400 + base_pval * randint1(level) / 400) : base_pval;
drain = std::min(drain, monap_ptr->o_ptr->pval);
if (drain <= 0) {
return false;
@@ -242,7 +240,7 @@ bool process_un_power(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
}
monap_ptr->obvious = true;
- auto recovery = drain * baseitem.level;
+ auto recovery = drain * monap_ptr->o_ptr->get_baseitem_level();
const auto tval = monap_ptr->o_ptr->bi_key.tval();
if (tval == ItemKindType::STAFF) {
recovery *= monap_ptr->o_ptr->number;
diff --git a/src/monster-floor/monster-death.cpp b/src/monster-floor/monster-death.cpp
index 4da3bc0cd0..501ec12983 100644
--- a/src/monster-floor/monster-death.cpp
+++ b/src/monster-floor/monster-death.cpp
@@ -30,6 +30,8 @@
#include "sv-definition/sv-scroll-types.h"
#include "system/angband-system.h"
#include "system/artifact-type-definition.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/building-type-definition.h"
#include "system/dungeon-info.h"
#include "system/enums/monrace/monrace-id.h"
diff --git a/src/object-activation/activation-util.cpp b/src/object-activation/activation-util.cpp
index febe74fb39..480705b0d9 100644
--- a/src/object-activation/activation-util.cpp
+++ b/src/object-activation/activation-util.cpp
@@ -1,12 +1,11 @@
#include "object-activation/activation-util.h"
#include "object/object-info.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
ae_type *initialize_ae_type(PlayerType *player_ptr, ae_type *ae_ptr, const INVENTORY_IDX i_idx)
{
ae_ptr->o_ptr = ref_item(player_ptr, i_idx);
- ae_ptr->lev = ae_ptr->o_ptr->get_baseitem().level;
+ ae_ptr->lev = ae_ptr->o_ptr->get_baseitem_level();
return ae_ptr;
}
diff --git a/src/object-enchant/item-magic-applier.cpp b/src/object-enchant/item-magic-applier.cpp
index e01a208917..fbb0c11929 100644
--- a/src/object-enchant/item-magic-applier.cpp
+++ b/src/object-enchant/item-magic-applier.cpp
@@ -13,7 +13,7 @@
#include "object-enchant/special-object-flags.h"
#include "player/player-status-flags.h"
#include "system/artifact-type-definition.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
@@ -204,11 +204,11 @@ void ItemMagicApplier::apply_cursed()
return;
}
- const auto &baseitem = this->o_ptr->get_baseitem();
- if (!baseitem.cost) {
+ if (this->o_ptr->is_worthless()) {
set_bits(this->o_ptr->ident, IDENT_BROKEN);
}
+ const auto &baseitem = this->o_ptr->get_baseitem();
if (baseitem.gen_flags.has(ItemGenerationTraitType::CURSED)) {
this->o_ptr->curse_flags.set(CurseTraitType::CURSED);
}
diff --git a/src/object-enchant/object-boost.cpp b/src/object-enchant/object-boost.cpp
index 0d20a2f112..1ac723a86c 100644
--- a/src/object-enchant/object-boost.cpp
+++ b/src/object-enchant/object-boost.cpp
@@ -2,7 +2,7 @@
#include "artifact/random-art-effects.h"
#include "object-enchant/tr-types.h"
#include "player-ability/player-ability-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/object-enchant/others/apply-magic-amulet.cpp b/src/object-enchant/others/apply-magic-amulet.cpp
index 7208ae22c3..0b0eda3a89 100644
--- a/src/object-enchant/others/apply-magic-amulet.cpp
+++ b/src/object-enchant/others/apply-magic-amulet.cpp
@@ -11,7 +11,7 @@
#include "object-enchant/special-object-flags.h"
#include "object-enchant/trc-types.h"
#include "sv-definition/sv-amulet-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/object-enchant/others/apply-magic-others.cpp b/src/object-enchant/others/apply-magic-others.cpp
index 4428ec53c0..acd795e20d 100644
--- a/src/object-enchant/others/apply-magic-others.cpp
+++ b/src/object-enchant/others/apply-magic-others.cpp
@@ -20,7 +20,6 @@
#include "perception/object-perception.h"
#include "sv-definition/sv-lite-types.h"
#include "sv-definition/sv-other-types.h"
-#include "system/baseitem-info.h"
#include "system/enums/monrace/monrace-id.h"
#include "system/floor-type-definition.h"
#include "system/item-entity.h"
@@ -60,7 +59,7 @@ void OtherItemsEnchanter::apply_magic()
this->enchant_wand_staff();
break;
case ItemKindType::ROD:
- this->o_ptr->pval = this->o_ptr->get_baseitem().pval;
+ this->o_ptr->pval = this->o_ptr->get_baseitem_pval();
break;
case ItemKindType::CAPTURE:
this->o_ptr->pval = 0;
@@ -91,8 +90,8 @@ void OtherItemsEnchanter::apply_magic()
*/
void OtherItemsEnchanter::enchant_wand_staff()
{
- const auto &baseitem = this->o_ptr->get_baseitem();
- this->o_ptr->pval = baseitem.pval / 2 + randint1((baseitem.pval + 1) / 2);
+ const auto base_pval = this->o_ptr->get_baseitem_pval();
+ this->o_ptr->pval = base_pval / 2 + randint1((base_pval + 1) / 2);
}
/*
@@ -198,12 +197,12 @@ void OtherItemsEnchanter::generate_statue()
*/
void OtherItemsEnchanter::generate_chest()
{
- auto obj_level = this->o_ptr->get_baseitem().level;
- if (obj_level <= 0) {
+ const auto item_level = this->o_ptr->get_baseitem_level();
+ if (item_level <= 0) {
return;
}
- this->o_ptr->pval = randnum1(obj_level);
+ this->o_ptr->pval = randnum1(item_level);
if (this->o_ptr->bi_key.sval() == SV_CHEST_KANDUME) {
this->o_ptr->pval = 6;
}
diff --git a/src/object-enchant/others/apply-magic-ring.cpp b/src/object-enchant/others/apply-magic-ring.cpp
index 1d0718081e..7e2f6f7583 100644
--- a/src/object-enchant/others/apply-magic-ring.cpp
+++ b/src/object-enchant/others/apply-magic-ring.cpp
@@ -11,7 +11,7 @@
#include "object-enchant/special-object-flags.h"
#include "object-enchant/trc-types.h"
#include "sv-definition/sv-ring-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/object-enchant/protector/apply-magic-soft-armor.cpp b/src/object-enchant/protector/apply-magic-soft-armor.cpp
index 2704563387..ae0940583b 100644
--- a/src/object-enchant/protector/apply-magic-soft-armor.cpp
+++ b/src/object-enchant/protector/apply-magic-soft-armor.cpp
@@ -7,7 +7,8 @@
#include "object-enchant/protector/apply-magic-soft-armor.h"
#include "object/tval-types.h"
#include "sv-definition/sv-armor-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
diff --git a/src/object-hook/hook-expendable.cpp b/src/object-hook/hook-expendable.cpp
index 78707525f7..3bbb88a30c 100644
--- a/src/object-hook/hook-expendable.cpp
+++ b/src/object-hook/hook-expendable.cpp
@@ -9,7 +9,7 @@
#include "player-info/mimic-info-table.h"
#include "sv-definition/sv-lite-types.h"
#include "sv-definition/sv-other-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/item-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
diff --git a/src/object-hook/hook-magic.cpp b/src/object-hook/hook-magic.cpp
index ce257cf245..e04b3c2d94 100644
--- a/src/object-hook/hook-magic.cpp
+++ b/src/object-hook/hook-magic.cpp
@@ -5,7 +5,7 @@
#include "player-base/player-class.h"
#include "player-info/class-info.h"
#include "player/player-realm.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-key.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/object-use/quaff/quaff-execution.cpp b/src/object-use/quaff/quaff-execution.cpp
index 3c4e2865f4..c52e684929 100644
--- a/src/object-use/quaff/quaff-execution.cpp
+++ b/src/object-use/quaff/quaff-execution.cpp
@@ -23,7 +23,6 @@
#include "spell-realm/spells-hex.h"
#include "spell-realm/spells-song.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -71,7 +70,7 @@ void ObjectQuaffEntity::execute(INVENTORY_IDX i_idx)
item.mark_as_tried();
if (ident && !item.is_aware()) {
object_aware(this->player_ptr, &item);
- gain_exp(this->player_ptr, (item.get_baseitem().level + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
+ gain_exp(this->player_ptr, (item.get_baseitem_level() + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
}
static constexpr auto flags = {
@@ -124,7 +123,7 @@ bool ObjectQuaffEntity::can_quaff()
ItemEntity ObjectQuaffEntity::copy_object(const INVENTORY_IDX i_idx)
{
auto *tmp_o_ptr = ref_item(this->player_ptr, i_idx);
- auto o_val = *tmp_o_ptr;
+ ItemEntity o_val = *tmp_o_ptr;
o_val.number = 1;
return o_val;
}
diff --git a/src/object-use/read/read-execution.cpp b/src/object-use/read/read-execution.cpp
index 8ff4fdd03f..c16f985435 100644
--- a/src/object-use/read/read-execution.cpp
+++ b/src/object-use/read/read-execution.cpp
@@ -20,7 +20,6 @@
#include "spell-realm/spells-hex.h"
#include "spell-realm/spells-song.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -119,6 +118,6 @@ void ObjectReadEntity::gain_exp_from_item_use(ItemEntity *o_ptr, bool is_identif
}
object_aware(this->player_ptr, o_ptr);
- auto lev = o_ptr->get_baseitem().level;
- gain_exp(this->player_ptr, (lev + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
+ const auto item_level = o_ptr->get_baseitem_level();
+ gain_exp(this->player_ptr, (item_level + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
}
diff --git a/src/object-use/throw-execution.cpp b/src/object-use/throw-execution.cpp
index cca0fec99d..b2353daea8 100644
--- a/src/object-use/throw-execution.cpp
+++ b/src/object-use/throw-execution.cpp
@@ -51,7 +51,6 @@
#include "player/player-status-table.h"
#include "racial/racial-android.h"
#include "specific-object/torch.h"
-#include "system/baseitem-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/item-entity.h"
@@ -66,6 +65,7 @@
#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
#include "view/display-messages.h"
+#include "view/display-symbol.h"
#include "view/object-describer.h"
#include "wizard/wizard-messages.h"
diff --git a/src/object-use/use-execution.cpp b/src/object-use/use-execution.cpp
index 5fdb0d2a18..4e5b5add84 100644
--- a/src/object-use/use-execution.cpp
+++ b/src/object-use/use-execution.cpp
@@ -20,7 +20,6 @@
#include "player-base/player-class.h"
#include "player-status/player-energy.h"
#include "status/experience.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -58,9 +57,9 @@ void ObjectUseEntity::execute()
return;
}
- auto lev = o_ptr->get_baseitem().level;
- if (lev > 50) {
- lev = 50 + (lev - 50) / 2;
+ auto item_level = o_ptr->get_baseitem_level();
+ if (item_level > 50) {
+ item_level = 50 + (item_level - 50) / 2;
}
auto chance = this->player_ptr->skill_dev;
@@ -68,7 +67,7 @@ void ObjectUseEntity::execute()
chance = chance / 2;
}
- chance = chance - lev;
+ chance = chance - item_level;
if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1)) {
chance = USE_DEVICE;
}
@@ -119,7 +118,7 @@ void ObjectUseEntity::execute()
o_ptr->mark_as_tried();
if (ident && !o_ptr->is_aware()) {
object_aware(this->player_ptr, o_ptr);
- gain_exp(this->player_ptr, (lev + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
+ gain_exp(this->player_ptr, (item_level + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
}
static constexpr auto flags_swrf = {
diff --git a/src/object-use/zaprod-execution.cpp b/src/object-use/zaprod-execution.cpp
index 8c0b07ec81..c26644c8cd 100644
--- a/src/object-use/zaprod-execution.cpp
+++ b/src/object-use/zaprod-execution.cpp
@@ -19,7 +19,6 @@
#include "status/experience.h"
#include "sv-definition/sv-other-types.h"
#include "sv-definition/sv-rod-types.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -63,13 +62,13 @@ void ObjectZapRodEntity::execute(INVENTORY_IDX i_idx)
return;
}
- auto lev = o_ptr->get_baseitem().level;
+ const auto item_level = o_ptr->get_baseitem_level();
auto chance = this->player_ptr->skill_dev;
if (this->player_ptr->effects()->confusion().is_confused()) {
chance = chance / 2;
}
- auto fail = lev + 5;
+ auto fail = item_level + 5;
if (chance > fail) {
fail -= (chance - fail) * 2;
} else {
@@ -103,7 +102,7 @@ void ObjectZapRodEntity::execute(INVENTORY_IDX i_idx)
return;
}
- const auto &baseitem = o_ptr->get_baseitem();
+ const auto base_pval = o_ptr->get_baseitem_pval();
if ((o_ptr->number == 1) && (o_ptr->timeout)) {
if (flush_failure) {
flush();
@@ -111,7 +110,7 @@ void ObjectZapRodEntity::execute(INVENTORY_IDX i_idx)
msg_print(_("このロッドはまだ魔力を充填している最中だ。", "The rod is still charging."));
return;
- } else if ((o_ptr->number > 1) && (o_ptr->timeout > baseitem.pval * (o_ptr->number - 1))) {
+ } else if ((o_ptr->number > 1) && (o_ptr->timeout > base_pval * (o_ptr->number - 1))) {
if (flush_failure) {
flush();
}
@@ -123,7 +122,7 @@ void ObjectZapRodEntity::execute(INVENTORY_IDX i_idx)
sound(SOUND_ZAP);
auto ident = rod_effect(this->player_ptr, *o_ptr->bi_key.sval(), dir, &use_charge, false);
if (use_charge) {
- o_ptr->timeout += baseitem.pval;
+ o_ptr->timeout += base_pval;
}
auto &rfu = RedrawingFlagsUpdater::get_instance();
@@ -141,7 +140,7 @@ void ObjectZapRodEntity::execute(INVENTORY_IDX i_idx)
o_ptr->mark_as_tried();
if ((ident != 0) && !o_ptr->is_aware()) {
object_aware(this->player_ptr, o_ptr);
- gain_exp(this->player_ptr, (lev + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
+ gain_exp(this->player_ptr, (item_level + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
}
static constexpr auto flags_swrf = {
diff --git a/src/object-use/zapwand-execution.cpp b/src/object-use/zapwand-execution.cpp
index f9680dd714..47b8a2b611 100644
--- a/src/object-use/zapwand-execution.cpp
+++ b/src/object-use/zapwand-execution.cpp
@@ -16,7 +16,6 @@
#include "player-status/player-energy.h"
#include "status/experience.h"
#include "sv-definition/sv-wand-types.h"
-#include "system/baseitem-info.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
@@ -62,9 +61,9 @@ void ObjectZapWandEntity::execute(INVENTORY_IDX i_idx)
return;
}
- auto lev = o_ptr->get_baseitem().level;
- if (lev > 50) {
- lev = 50 + (lev - 50) / 2;
+ auto item_level = o_ptr->get_baseitem_level();
+ if (item_level > 50) {
+ item_level = 50 + (item_level - 50) / 2;
}
auto chance = this->player_ptr->skill_dev;
@@ -72,7 +71,7 @@ void ObjectZapWandEntity::execute(INVENTORY_IDX i_idx)
chance = chance / 2;
}
- chance = chance - lev;
+ chance = chance - item_level;
if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1)) {
chance = USE_DEVICE;
}
@@ -122,7 +121,7 @@ void ObjectZapWandEntity::execute(INVENTORY_IDX i_idx)
o_ptr->mark_as_tried();
if (ident && !o_ptr->is_aware()) {
object_aware(this->player_ptr, o_ptr);
- gain_exp(this->player_ptr, (lev + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
+ gain_exp(this->player_ptr, (item_level + (this->player_ptr->lev >> 1)) / this->player_ptr->lev);
}
static constexpr auto flags_swrf = {
diff --git a/src/object/object-broken.cpp b/src/object/object-broken.cpp
index 6309173cae..17870f21ce 100644
--- a/src/object/object-broken.cpp
+++ b/src/object/object-broken.cpp
@@ -11,7 +11,8 @@
#include "object-enchant/tr-types.h"
#include "object/tval-types.h"
#include "sv-definition/sv-potion-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include "system/item-entity.h"
#include "system/player-type-definition.h"
#include "util/bit-flags-calculator.h"
diff --git a/src/object/object-kind-hook.cpp b/src/object/object-kind-hook.cpp
index c8179601fe..8f9b1b9fa3 100644
--- a/src/object/object-kind-hook.cpp
+++ b/src/object/object-kind-hook.cpp
@@ -9,7 +9,8 @@
#include "sv-definition/sv-amulet-types.h"
#include "sv-definition/sv-other-types.h"
#include "sv-definition/sv-ring-types.h"
-#include "system/baseitem-info.h"
+#include "system/baseitem/baseitem-definition.h"
+#include "system/baseitem/baseitem-list.h"
#include
#include