const auto level = floor_ptr->is_in_underground() ? floor_ptr->dun_level : wild_level;
const auto r_idx = get_mon_num(player_ptr, 0, level, PM_NONE);
msg_print(nullptr);
- if (MonsterRace(r_idx).is_valid() && one_in_(2)) {
+ if (MonraceList::is_valid(r_idx) && one_in_(2)) {
const auto pos = player_ptr->get_neighbor(player_ptr->fishing_dir);
if (place_specific_monster(player_ptr, 0, pos.y, pos.x, r_idx, PM_NO_KAGE)) {
const auto m_name = monster_desc(player_ptr, &floor_ptr->m_list[floor_ptr->get_grid(pos).m_idx], 0);
static std::pair<std::string, std::string> describe_monster_ball(const ItemEntity &item, const describe_option_type &opt)
{
const auto &basename = item.get_baseitem().name;
- const auto r_idx = i2enum<MonsterRaceId>(item.pval);
- auto *r_ptr = &monraces_info[r_idx];
+ const auto monrace_id = i2enum<MonsterRaceId>(item.pval);
+ const auto &monrace = monraces_info[monrace_id];
if (!opt.known) {
return { basename, "" };
}
- if (!MonsterRace(r_idx).is_valid()) {
+ if (!MonsterRace(monrace_id).is_valid()) {
return { basename, _(" (空)", " (empty)") };
}
#ifdef JP
- const auto modstr = format(" (%s)", r_ptr->name.data());
+ const auto modstr = format(" (%s)", monrace.name.data());
#else
std::string modstr;
- if (r_ptr->kind_flags.has_not(MonsterKindType::UNIQUE)) {
- modstr = format(" (%s%s)", (is_a_vowel(r_ptr->name[0]) ? "an " : "a "), r_ptr->name.data());
+ if (monrace.kind_flags.has_not(MonsterKindType::UNIQUE)) {
+ modstr = format(" (%s%s)", (is_a_vowel(monrace.name[0]) ? "an " : "a "), monrace.name.data());
} else {
- modstr = format(" (%s)", r_ptr->name.data());
+ modstr = format(" (%s)", monrace.name.data());
}
#endif
return { basename, modstr };
static std::pair<std::string, std::string> describe_statue(const ItemEntity &item)
{
const auto &basename = item.get_baseitem().name;
- const auto r_idx = i2enum<MonsterRaceId>(item.pval);
- auto *r_ptr = &monraces_info[r_idx];
+ const auto monrace_id = i2enum<MonsterRaceId>(item.pval);
+ const auto &monrace = monraces_info[monrace_id];
#ifdef JP
- const auto &modstr = r_ptr->name;
+ const auto &modstr = monrace.name;
#else
std::string modstr;
- if (r_ptr->kind_flags.has_not(MonsterKindType::UNIQUE)) {
- modstr = format("%s%s", (is_a_vowel(r_ptr->name[0]) ? "an " : "a "), r_ptr->name.data());
+ if (monrace.kind_flags.has_not(MonsterKindType::UNIQUE)) {
+ modstr = format("%s%s", (is_a_vowel(monrace.name[0]) ? "an " : "a "), monrace.name.data());
} else {
- modstr = r_ptr->name;
+ modstr = monrace.name;
}
#endif
return { basename, modstr };
static std::pair<std::string, std::string> describe_corpse(const ItemEntity &item)
{
- const auto r_idx = i2enum<MonsterRaceId>(item.pval);
- auto *r_ptr = &monraces_info[r_idx];
- const auto &modstr = r_ptr->name;
+ const auto monrace_id = i2enum<MonsterRaceId>(item.pval);
+ const auto &monrace = monraces_info[monrace_id];
#ifdef JP
const auto basename = "#%";
#else
const auto basename =
- (r_ptr->kind_flags.has(MonsterKindType::UNIQUE))
+ (monrace.kind_flags.has(MonsterKindType::UNIQUE))
? "& % of #"
: "& # %";
#endif
- return { basename, modstr };
+ return { basename, monrace.name };
}
/*!
for (int current_monster = 0; current_monster < max_num; current_monster++) {
POSITION cy = 0;
POSITION cx = 0;
- if (!MonsterRace(party_mon[current_monster].r_idx).is_valid()) {
+ if (!MonraceList::is_valid(party_mon[current_monster].r_idx)) {
continue;
}
for (MONSTER_IDX i = player_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) {
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[i];
const auto parent_r_idx = player_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx;
- if (!m_ptr->has_parent() || MonsterRace(parent_r_idx).is_valid()) {
+ if (!m_ptr->has_parent() || MonraceList::is_valid(parent_r_idx)) {
continue;
}
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
const auto &[wid, hgt] = term_get_size();
- std::vector<MonsterRaceId> r_idx_list;
+ std::vector<MonsterRaceId> monrace_ids;
std::vector<IDX> grp_idx;
const auto max_element = std::max_element(MONSTER_KINDS_GROUP.begin(), MONSTER_KINDS_GROUP.end(),
}
}
} else {
- r_idx_list.push_back(*direct_r_idx);
+ monrace_ids.push_back(*direct_r_idx);
auto &monrace = monraces_info[*direct_r_idx];
auto &symbol_config = monrace.symbol_config;
(void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
display_group_list(max, browser_rows, grp_idx, MONSTER_KINDS_GROUP, grp_cur, grp_top);
if (old_grp_cur != grp_cur) {
old_grp_cur = grp_cur;
- r_idx_list = collect_monsters(player_ptr, grp_idx[grp_cur], mode);
+ monrace_ids = collect_monsters(player_ptr, grp_idx[grp_cur], mode);
}
while (mon_cur < mon_top) {
}
while (mon_cur >= mon_top + browser_rows) {
- auto remain = static_cast<int>(r_idx_list.size()) - browser_rows;
+ const int remain = std::ssize(monrace_ids) - browser_rows;
mon_top = static_cast<short>(std::min(remain, mon_top + browser_rows / 2));
}
}
if (!visual_list) {
- display_monster_list(max + 3, 6, browser_rows, r_idx_list, mon_cur, mon_top, visual_only);
+ display_monster_list(max + 3, 6, browser_rows, monrace_ids, mon_cur, mon_top, visual_only);
} else {
mon_top = mon_cur;
- display_monster_list(max + 3, 6, 1, r_idx_list, mon_cur, mon_top, visual_only);
+ display_monster_list(max + 3, 6, 1, monrace_ids, mon_cur, mon_top, visual_only);
display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), color_top, character_left);
}
- prt(format(_("%lu 種", "%lu Races"), r_idx_list.size()), 3, 26);
+ prt(format(_("%lu 種", "%lu Races"), monrace_ids.size()), 3, 26);
prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"), (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "",
visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
(symbols_cb.symbol != DisplaySymbol()) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
DisplaySymbol symbol_dummy;
auto *symbol_ptr = &symbol_dummy;
- if (!r_idx_list.empty()) {
- auto &monrace = monraces_info[r_idx_list[mon_cur]];
+ if (!monrace_ids.empty()) {
+ auto &monrace = monraces_info[monrace_ids[mon_cur]];
symbol_ptr = &monrace.symbol_config;
if (!visual_only) {
- monster_race_track(player_ptr, r_idx_list[mon_cur]);
+ monster_race_track(player_ptr, monrace_ids[mon_cur]);
handle_stuff(player_ptr);
}
case 'R':
case 'r': {
- if (!visual_list && !visual_only && MonsterRace(r_idx_list[mon_cur]).is_valid()) {
- screen_roff(player_ptr, r_idx_list[mon_cur], MONSTER_LORE_NORMAL);
-
+ if (!visual_list && !visual_only && MonraceList::is_valid(monrace_ids[mon_cur])) {
+ screen_roff(player_ptr, monrace_ids[mon_cur], MONSTER_LORE_NORMAL);
(void)inkey();
-
redraw = true;
}
}
default: {
- browser_cursor(ch, &column, &grp_cur, std::ssize(grp_idx), &mon_cur, r_idx_list.size());
+ browser_cursor(ch, &column, &grp_cur, std::ssize(grp_idx), &mon_cur, monrace_ids.size());
break;
}
lore_type *lore_ptr = &tmp_lore;
auto is_valid_reinforcer = [](const auto &reinforce) {
- auto [r_idx, dd, ds] = reinforce;
- auto is_reinforce = MonsterRace(r_idx).is_valid();
+ const auto &[r_idx, dd, ds] = reinforce;
+ auto is_reinforce = MonraceList::is_valid(r_idx);
is_reinforce &= dd > 0;
is_reinforce &= ds > 0;
return is_reinforce;
mon_level = std::max(i, mon_level);
}
+ const auto &monraces = MonraceList::get_instance();
while (true) {
total = 0;
tekitou = false;
for (i = 0; i < 4; i++) {
- MonsterRaceId r_idx;
+ MonsterRaceId monrace_id;
int j;
while (true) {
get_mon_num_prep(player_ptr, monster_can_entry_arena, nullptr);
- r_idx = get_mon_num(player_ptr, 0, mon_level, PM_ARENA);
- if (!MonsterRace(r_idx).is_valid()) {
+ monrace_id = get_mon_num(player_ptr, 0, mon_level, PM_ARENA);
+ if (!MonraceList::is_valid(monrace_id)) {
continue;
}
- if (monraces_info[r_idx].kind_flags.has(MonsterKindType::UNIQUE) || monraces_info[r_idx].population_flags.has(MonsterPopulationType::ONLY_ONE)) {
- if ((monraces_info[r_idx].level + 10) > mon_level) {
+ const auto &monrace = monraces.get_monrace(monrace_id);
+ if (monrace.kind_flags.has(MonsterKindType::UNIQUE) || monrace.population_flags.has(MonsterPopulationType::ONLY_ONE)) {
+ if ((monrace.level + 10) > mon_level) {
continue;
}
}
for (j = 0; j < i; j++) {
- if (r_idx == battle_mon_list[j]) {
+ if (monrace_id == battle_mon_list[j]) {
break;
}
}
break;
}
- battle_mon_list[i] = r_idx;
- if (monraces_info[r_idx].level < 45) {
+
+ battle_mon_list[i] = monrace_id;
+ if (monraces.get_monrace(monrace_id).level < 45) {
tekitou = true;
}
}
if (!projectable(player_ptr, y, x, ny, nx)) {
continue;
}
- if (MonsterRace(r_idx).is_valid()) {
+ if (MonraceList::is_valid(r_idx)) {
auto *r_ptr = &monraces_info[r_idx];
if (!monster_can_enter(player_ptr, ny, nx, r_ptr, 0)) {
continue;
/* Reinforcement */
for (const auto &[reinforce_r_idx, dd, ds] : r_ptr->reinforces) {
- if (!MonsterRace(reinforce_r_idx).is_valid()) {
+ if (!MonraceList::is_valid(reinforce_r_idx)) {
continue;
}
auto n = damroll(dd, ds);
place_monster_idx = r_idx;
for (int i = 0; i < 32; i++) {
POSITION nx, ny, d = 3;
- MonsterRaceId z;
scatter(player_ptr, &ny, &nx, y, x, d, PROJECT_NONE);
if (!is_cave_empty_bold2(player_ptr, ny, nx)) {
continue;
}
get_mon_num_prep(player_ptr, place_monster_can_escort, get_monster_hook2(player_ptr, ny, nx));
- z = get_mon_num(player_ptr, 0, r_ptr->level, 0);
- if (!MonsterRace(z).is_valid()) {
+ const auto monrace_id = get_mon_num(player_ptr, 0, r_ptr->level, 0);
+ if (!MonraceList::is_valid(monrace_id)) {
break;
}
- (void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, z, mode, summoner_m_idx);
- if (monraces_info[z].misc_flags.has(MonsterMiscType::HAS_FRIENDS) || r_ptr->misc_flags.has(MonsterMiscType::MORE_ESCORT)) {
- (void)place_monster_group(player_ptr, place_monster_m_idx, ny, nx, z, mode, summoner_m_idx);
+ (void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, monrace_id, mode, summoner_m_idx);
+ if (monraces_info[monrace_id].misc_flags.has(MonsterMiscType::HAS_FRIENDS) || r_ptr->misc_flags.has(MonsterMiscType::MORE_ESCORT)) {
+ (void)place_monster_group(player_ptr, place_monster_m_idx, ny, nx, monrace_id, mode, summoner_m_idx);
}
}
{
get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x));
const auto &floor = *player_ptr->current_floor_ptr;
- MonsterRaceId r_idx;
+ MonsterRaceId monrace_id;
do {
- r_idx = get_mon_num(player_ptr, 0, floor.monster_level, PM_NONE);
- } while ((mode & PM_NO_QUEST) && monraces_info[r_idx].misc_flags.has(MonsterMiscType::NO_QUEST));
- if (!MonsterRace(r_idx).is_valid()) {
+ monrace_id = get_mon_num(player_ptr, 0, floor.monster_level, PM_NONE);
+ } while ((mode & PM_NO_QUEST) && monraces_info[monrace_id].misc_flags.has(MonsterMiscType::NO_QUEST));
+ if (!MonraceList::is_valid(monrace_id)) {
return false;
}
auto try_become_jural = one_in_(5) || !floor.is_in_underground();
- try_become_jural &= monraces_info[r_idx].kind_flags.has_not(MonsterKindType::UNIQUE);
- try_become_jural &= angband_strchr("hkoptuyAHLOPTUVY", monraces_info[r_idx].symbol_definition.character) != nullptr;
+ try_become_jural &= monraces_info[monrace_id].kind_flags.has_not(MonsterKindType::UNIQUE);
+ try_become_jural &= angband_strchr("hkoptuyAHLOPTUVY", monraces_info[monrace_id].symbol_definition.character) != nullptr;
if (try_become_jural) {
mode |= PM_JURAL;
}
- return place_specific_monster(player_ptr, 0, y, x, r_idx, mode);
+ return place_specific_monster(player_ptr, 0, y, x, monrace_id, mode);
}
static std::optional<MonsterRaceId> select_horde_leader_r_idx(PlayerType *player_ptr)
const auto *floor_ptr = player_ptr->current_floor_ptr;
for (auto attempts = 1000; attempts > 0; --attempts) {
- auto r_idx = get_mon_num(player_ptr, 0, floor_ptr->monster_level, PM_NONE);
- if (!MonsterRace(r_idx).is_valid()) {
+ const auto monrace_id = get_mon_num(player_ptr, 0, floor_ptr->monster_level, PM_NONE);
+ if (!MonraceList::is_valid(monrace_id)) {
return std::nullopt;
}
- if (monraces_info[r_idx].kind_flags.has(MonsterKindType::UNIQUE)) {
+ if (monraces_info[monrace_id].kind_flags.has(MonsterKindType::UNIQUE)) {
continue;
}
- if (r_idx == MonsterRaceId::HAGURE) {
+ if (monrace_id == MonsterRaceId::HAGURE) {
continue;
}
- return r_idx;
+ return monrace_id;
}
return std::nullopt;
get_mon_num_prep(player_ptr, std::move(summon_specific_hook), get_monster_hook2(player_ptr, y, x), type);
DEPTH dlev = get_dungeon_or_wilderness_level(player_ptr);
- MonsterRaceId r_idx = get_mon_num(player_ptr, 0, (dlev + lev) / 2 + 5, mode);
- if (!MonsterRace(r_idx).is_valid()) {
+ const auto r_idx = get_mon_num(player_ptr, 0, (dlev + lev) / 2 + 5, mode);
+ if (!MonraceList::is_valid(r_idx)) {
return false;
}
*/
bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION oy, POSITION ox, MonsterRaceId r_idx, BIT_FLAGS mode)
{
- if (!MonsterRace(r_idx).is_valid() || (r_idx >= static_cast<MonsterRaceId>(monraces_info.size()))) {
+ if (!MonraceList::is_valid(r_idx) || (r_idx >= static_cast<MonsterRaceId>(monraces_info.size()))) {
return false;
}
auto *r_ptr = &monraces_info[r_idx];
concptr name = r_ptr->name.data();
- if (player_ptr->wild_mode || !in_bounds(&floor, y, x) || !MonsterRace(r_idx).is_valid()) {
+ if (player_ptr->wild_mode || !in_bounds(&floor, y, x) || !MonraceList::is_valid(r_idx)) {
return false;
}
const auto old_m_name = monster_desc(player_ptr, m_ptr, 0);
- if (!MonsterRace(r_idx).is_valid()) {
+ if (!MonraceList::is_valid(r_idx)) {
DEPTH level;
chameleon_change_m_idx = m_idx;
r_ptr = &monraces_info[r_idx];
chameleon_change_m_idx = 0;
- if (!MonsterRace(r_idx).is_valid()) {
+ if (!MonraceList::is_valid(r_idx)) {
return;
}
}
*/
old_race_flags::old_race_flags(MonsterRaceId monrace_id)
{
- if (!MonsterRace(monrace_id).is_valid()) {
+ if (!MonraceList::is_valid(monrace_id)) {
return;
}
player_ptr->current_floor_ptr->monster_noise = false;
sweep_monster_process(player_ptr);
hack_m_idx = 0;
- if (!MonsterRace(player_ptr->monster_race_idx).is_valid() || (player_ptr->monster_race_idx != old_monrace_id)) {
+ if (!MonraceList::is_valid(player_ptr->monster_race_idx) || (player_ptr->monster_race_idx != old_monrace_id)) {
return;
}
* @brief モンスターの経験値取得処理
* @param player_ptr プレイヤーへの参照ポインタ
* @param m_idx 経験値を得るモンスターの参照ID
- * @param s_idx 撃破されたモンスター種族の参照ID
+ * @param monrace_id 撃破されたモンスター種族ID
*/
-void monster_gain_exp(PlayerType *player_ptr, MONSTER_IDX m_idx, MonsterRaceId s_idx)
+void monster_gain_exp(PlayerType *player_ptr, MONSTER_IDX m_idx, MonsterRaceId monrace_id)
{
- if (m_idx <= 0 || !MonsterRace(s_idx).is_valid()) {
+ if (m_idx <= 0 || !MonraceList::is_valid(monrace_id)) {
return;
}
}
auto *r_ptr = &m_ptr->get_monrace();
- auto *s_ptr = &monraces_info[s_idx];
+ auto *s_ptr = &monraces_info[monrace_id];
if (AngbandSystem::get_instance().is_phase_out() || (r_ptr->next_exp == 0)) {
return;
case SUMMON_CYBER:
return (monrace.symbol_definition.character == 'U') && monrace.ability_flags.has(MonsterAbilityType::ROCKET);
case SUMMON_KIN: {
- auto summon_kin_type = MonsterRace(summoner_idx).is_valid() ? monraces_info[summoner_idx].symbol_definition.character : PlayerRace(player_ptr).get_summon_symbol();
+ const auto summon_kin_type = MonraceList::is_valid(summoner_idx) ? monraces_info[summoner_idx].symbol_definition.character : PlayerRace(player_ptr).get_summon_symbol();
return (monrace.symbol_definition.character == summon_kin_type) && (r_idx != MonsterRaceId::HAGURE);
}
case SUMMON_DAWN:
break;
}
case ItemKindType::CAPTURE: {
- auto capture_r_idx = i2enum<MonsterRaceId>(o_ptr->pval);
- if (!MonsterRace(capture_r_idx).is_valid()) {
+ auto captured_monrace_id = i2enum<MonsterRaceId>(o_ptr->pval);
+ if (!MonraceList::is_valid(captured_monrace_id)) {
value = 1000L;
} else {
- value = ((monraces_info[capture_r_idx].level) * 50L + 1000);
+ value = ((monraces_info[captured_monrace_id].level) * 50L + 1000);
}
break;
}
continue;
}
- if (MonsterRace(monrace_id).is_valid()) {
+ if (MonraceList::is_valid(monrace_id)) {
return monrace_id;
}
#include "monster-floor/monster-generator.h"
#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
-#include "monster-race/monster-race.h"
#include "monster/monster-list.h"
#include "monster/monster-util.h"
#include "object-enchant/item-apply-magic.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
+#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/system-variables.h"
#include "wizard/wizard-messages.h"
const auto monrace_id = get_mon_num(player_ptr, 0, floor.dun_level, 0);
const auto y = yval + 2 * ddy_ddd[dir1];
const auto x = xval + 2 * ddx_ddd[dir1];
- if (MonsterRace(monrace_id).is_valid()) {
+ if (MonraceList::is_valid(monrace_id)) {
place_specific_monster(player_ptr, 0, y, x, monrace_id, PM_ALLOW_SLEEP);
}
get_mon_num_prep(player_ptr, vault_aux_lite, nullptr);
const auto monrace_id = get_mon_num(player_ptr, 0, floor.dun_level, 0);
- if (MonsterRace(monrace_id).is_valid()) {
+ if (MonraceList::is_valid(monrace_id)) {
place_specific_monster(player_ptr, 0, yval, xval, monrace_id, 0L);
}
const auto monrace_id = get_mon_num(player_ptr, 0, floor.dun_level, 0);
const auto y = yval + ddy_ddd[dir1];
const auto x = xval + ddx_ddd[dir1];
- if (MonsterRace(monrace_id).is_valid()) {
+ if (MonraceList::is_valid(monrace_id)) {
place_specific_monster(player_ptr, 0, y, x, monrace_id, 0L);
}
}
DEPTH lev1 = r_ptr->level - ((randint1(20) / randint1(9)) + 1);
DEPTH lev2 = r_ptr->level + ((randint1(20) / randint1(9)) + 1);
- MonsterRaceId r;
+ MonsterRaceId monrace_id;
for (int i = 0; i < 1000; i++) {
- r = get_mon_num(player_ptr, 0, (player_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5, PM_NONE);
- if (!MonsterRace(r).is_valid()) {
+ monrace_id = get_mon_num(player_ptr, 0, (player_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5, PM_NONE);
+ if (!MonraceList::is_valid(monrace_id)) {
break;
}
- r_ptr = &monraces_info[r];
+ r_ptr = &monraces_info[monrace_id];
if (r_ptr->kind_flags.has(MonsterKindType::UNIQUE)) {
continue;
}
continue;
}
- r_idx = r;
+ r_idx = monrace_id;
break;
}
MonraceList MonraceList::instance{};
+bool MonraceList::is_valid(MonsterRaceId monrace_id)
+{
+ return monrace_id != MonsterRaceId::PLAYER;
+}
+
const std::map<MonsterRaceId, std::set<MonsterRaceId>> &MonraceList::get_unified_uniques()
{
return unified_uniques;
MonsterRaceInfo &operator[](const MonsterRaceId r_idx);
const MonsterRaceInfo &operator[](const MonsterRaceId r_idx) const;
+ static bool is_valid(MonsterRaceId monrace_id);
static const std::map<MonsterRaceId, std::set<MonsterRaceId>> &get_unified_uniques();
static MonraceList &get_instance();
std::map<MonsterRaceId, MonsterRaceInfo>::iterator begin();
#endif
for (const auto &[r_idx, dd, ds] : lore_ptr->r_ptr->reinforces) {
- auto is_reinforced = MonsterRace(r_idx).is_valid();
+ auto is_reinforced = MonraceList::is_valid(r_idx);
#ifndef JP
const char *prefix = (idx == 0) ? " " : (idx == max_idx) ? " and "
: ", ";
*/
void fix_monster(PlayerType *player_ptr)
{
- if (!MonsterRace(player_ptr->monster_race_idx).is_valid()) {
+ if (!MonraceList::is_valid(player_ptr->monster_race_idx)) {
return;
}
display_sub_windows(SubWindowRedrawingFlag::MONSTER_LORE,
void wiz_restore_monster_max_num(MonsterRaceId r_idx)
{
- if (!MonsterRace(r_idx).is_valid()) {
+ if (!MonraceList::is_valid(r_idx)) {
const auto restore_monrace_id = input_numerics("MonsterID", 1, monraces_info.size() - 1, MonsterRaceId::FILTHY_URCHIN);
if (!restore_monrace_id) {
return;
static std::optional<MonsterRaceId> input_monster_race_id(const MonsterRaceId r_idx)
{
- if (MonsterRace(r_idx).is_valid()) {
+ if (MonraceList::is_valid(r_idx)) {
return r_idx;
}
return input_numerics("MonsterID", 1, monraces_info.size() - 1, MonsterRaceId::FILTHY_URCHIN);