monster_race *riding_r_ptr = &r_info[player_ptr->riding ? riding_m_ptr->r_idx : 0];
PlayerEnergy energy(player_ptr);
if (can_move && player_ptr->riding) {
- if (riding_r_ptr->flags1 & RF1_NEVER_MOVE) {
+ if (riding_r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE)) {
msg_print(_("動けない!", "Can't move!"));
energy.reset_player_turn();
can_move = false;
-#include "dungeon/quest.h"
+#include "dungeon/quest.h"
#include "cmd-io/cmd-dump.h"
#include "core/asking-player.h"
#include "core/player-update-types.h"
continue;
if (r_ptr->rarity > 100)
continue;
- if (r_ptr->flags7 & RF7_FRIENDLY)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY))
continue;
if (r_ptr->flags7 & RF7_AQUATIC)
continue;
*/
static bool resisted_psi_because_weird_mind_or_powerful(effect_monster_type *em_ptr)
{
- bool has_resistance = any_bits(em_ptr->r_ptr->flags2, RF2_STUPID | RF2_WEIRD_MIND) || any_bits(em_ptr->r_ptr->flags3, RF3_ANIMAL)
- || (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam));
+ bool has_resistance = em_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID) || any_bits(em_ptr->r_ptr->flags2, RF2_WEIRD_MIND) || any_bits(em_ptr->r_ptr->flags3, RF3_ANIMAL) || (em_ptr->r_ptr->level > randint1(3 * em_ptr->dam));
if (!has_resistance)
return false;
m_ptr->mtimed[MTIMED_CSLEEP] = 0;
m_ptr->hold_o_idx_list.clear();
m_ptr->target_y = 0;
- if (((*r_ptr)->flags1 & RF1_PREVENT_SUDDEN_MAGIC) && !ironman_nightmare) {
+ if ((*r_ptr)->behavior_flags.has(MonsterBehaviorType::PREVENT_SUDDEN_MAGIC) && !ironman_nightmare) {
m_ptr->mflag.set(MonsterTemporaryFlagType::PREVENT_MAGIC);
}
}
#include "load/old/load-v1-5-0.h"
#include "load/savedata-old-flag-types.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
+#include "monster-race/race-flags2.h"
+#include "monster-race/race-flags7.h"
#include "system/angband.h"
#include "system/monster-race-definition.h"
#include "util/bit-flags-calculator.h"
rd_FlagGroup(r_ptr->r_aura_flags, rd_byte);
}
+static void rd_r_behavior_flags(monster_race *r_ptr)
+{
+ if (loading_savefile_version_is_older_than(11)) {
+ struct flag_list_ver11 {
+ BIT_FLAGS check_flag;
+ MonsterBehaviorType flag;
+ };
+
+ const std::vector<flag_list_ver11> flag1 = {
+ { RF1_NEVER_BLOW, MonsterBehaviorType::NEVER_BLOW },
+ { RF1_NEVER_MOVE, MonsterBehaviorType::NEVER_MOVE },
+ { RF1_RAND_25, MonsterBehaviorType::RAND_MOVE_25 },
+ { RF1_RAND_50, MonsterBehaviorType::RAND_MOVE_50 },
+ };
+
+ const std::vector<flag_list_ver11> flag2 = {
+ { RF2_OPEN_DOOR, MonsterBehaviorType::OPEN_DOOR },
+ { RF2_BASH_DOOR, MonsterBehaviorType::BASH_DOOR },
+ { RF2_MOVE_BODY, MonsterBehaviorType::MOVE_BODY },
+ { RF2_KILL_BODY, MonsterBehaviorType::KILL_BODY },
+ { RF2_TAKE_ITEM, MonsterBehaviorType::TAKE_ITEM },
+ { RF2_KILL_ITEM, MonsterBehaviorType::KILL_ITEM },
+ { RF2_STUPID, MonsterBehaviorType::STUPID },
+ { RF2_SMART, MonsterBehaviorType::SMART },
+ };
+
+ for (const auto &f : flag1)
+ if (any_bits(r_ptr->r_flags1, f.check_flag))
+ r_ptr->r_behavior_flags.set(f.flag);
+
+ for (const auto &f : flag2)
+ if (any_bits(r_ptr->r_flags2, f.check_flag))
+ r_ptr->r_behavior_flags.set(f.flag);
+
+ return;
+ }
+
+ rd_FlagGroup(r_ptr->r_behavior_flags, rd_byte);
+}
+
/*!
* @brief モンスターの思い出を読み込む / Read the monster lore
* @param r_ptr 読み込み先モンスター種族情報へのポインタ
migrate_old_aura_flags(r_ptr);
rd_r_ability_flags(r_ptr, r_idx);
rd_r_aura_flags(r_ptr);
+ rd_r_behavior_flags(r_ptr);
r_ptr->max_num = rd_byte();
r_ptr->floor_id = rd_s16b();
r_ptr->r_flagsr &= r_ptr->flagsr;
r_ptr->r_ability_flags &= r_ptr->ability_flags;
r_ptr->r_aura_flags &= r_ptr->aura_flags;
+ r_ptr->r_behavior_flags &= r_ptr->r_behavior_flags;
}
void load_lore(void)
lore_ptr->flags3 = lore_ptr->r_ptr->flags3;
lore_ptr->ability_flags = lore_ptr->r_ptr->ability_flags;
lore_ptr->aura_flags = lore_ptr->r_ptr->aura_flags;
+ lore_ptr->behavior_flags = lore_ptr->r_ptr->behavior_flags;
lore_ptr->flagsr = lore_ptr->r_ptr->flagsr;
}
-/*!
+/*!
* @brief モンスターの思い出を記憶する処理
* @date 2020/06/09
* @author Hourier
auto ability_flags = r_ptr->ability_flags;
n += ability_flags.reset(r_ptr->r_ability_flags).count();
+ auto behavior_flags = r_ptr->behavior_flags;
+ n += behavior_flags.reset(r_ptr->r_behavior_flags).count();
+
r_ptr->r_flags1 = r_ptr->flags1;
r_ptr->r_flags2 = r_ptr->flags2;
r_ptr->r_flags3 = r_ptr->flags3;
r_ptr->r_flagsr = r_ptr->flagsr;
r_ptr->r_ability_flags = r_ptr->ability_flags;
+ r_ptr->r_behavior_flags = r_ptr->behavior_flags;
if (!r_ptr->r_can_evolve)
n++;
lore_ptr->flags3 = (lore_ptr->r_ptr->flags3 & lore_ptr->r_ptr->r_flags3);
lore_ptr->ability_flags = (lore_ptr->r_ptr->ability_flags & lore_ptr->r_ptr->r_ability_flags);
lore_ptr->aura_flags = (lore_ptr->r_ptr->aura_flags & lore_ptr->r_ptr->r_aura_flags);
+ lore_ptr->behavior_flags = (lore_ptr->r_ptr->behavior_flags & lore_ptr->r_ptr->r_behavior_flags);
lore_ptr->flags7 = (lore_ptr->r_ptr->flags7 & lore_ptr->r_ptr->flags7);
lore_ptr->flagsr = (lore_ptr->r_ptr->flagsr & lore_ptr->r_ptr->r_flagsr);
lore_ptr->reinforce = false;
-#include "melee/melee-spell-flags-checker.h"
+#include "melee/melee-spell-flags-checker.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
bool vs_ninja = (player_ptr->pclass == PlayerClassType::NINJA) && !is_hostile(ms_ptr->t_ptr);
bool can_use_lite_area = vs_ninja && !(ms_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) && !(ms_ptr->r_ptr->flags7 & RF7_DARK_MASK);
- if ((ms_ptr->r_ptr->flags2 & RF2_STUPID) != 0)
+ if (ms_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return;
if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) {
static void check_stupid(melee_spell_type *ms_ptr)
{
- if (!ms_ptr->in_no_magic_dungeon || ((ms_ptr->r_ptr->flags2 & RF2_STUPID) != 0))
+ if (!ms_ptr->in_no_magic_dungeon || ms_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return;
ms_ptr->ability_flags &= RF_ABILITY_NOMAGIC_MASK;
static void check_non_stupid(PlayerType *player_ptr, melee_spell_type *ms_ptr)
{
- if ((ms_ptr->r_ptr->flags2 & RF2_STUPID) != 0)
+ if (ms_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return;
if (ms_ptr->ability_flags.has_any_of(RF_ABILITY_BOLT_MASK)
static void check_smart(PlayerType *player_ptr, melee_spell_type *ms_ptr)
{
- if ((ms_ptr->r_ptr->flags2 & RF2_SMART) == 0)
+ if (ms_ptr->r_ptr->behavior_flags.has_not(MonsterBehaviorType::SMART))
return;
if ((ms_ptr->m_ptr->hp < ms_ptr->m_ptr->maxhp / 10) && (randint0(100) < 50)) {
-/*!
+/*!
* @brief モンスター同士が乱闘する処理
* @date 2020/05/23
* @author Hourier
return false;
monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx];
- if (r_ptr->flags1 & RF1_NEVER_BLOW)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW))
return false;
if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE))
}
else if (pa_ptr->ma_ptr->effect == MA_SLOW) {
- if (!((r_ptr->flags1 & RF1_NEVER_MOVE) || angband_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char))) {
+ if (!(r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE) || angband_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char))) {
msg_format(_("%sの足首に関節蹴りをくらわした!", "You kick %s in the ankle."), pa_ptr->m_name);
special_effect = MA_SLOW;
} else
static bool check_no_blow(PlayerType *player_ptr, monap_type *monap_ptr)
{
auto *r_ptr = &r_info[monap_ptr->m_ptr->r_idx];
- if (any_bits(r_ptr->flags1, RF1_NEVER_BLOW)) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW)) {
return false;
}
-/*!
+/*!
* @brief モンスターの攻撃に関する処理
* @date 2020/03/08
* @author Hourier
if (!turn_flags_ptr->do_move || !player_bold(player_ptr, ny, nx))
return;
- if (r_ptr->flags1 & RF1_NEVER_BLOW) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW)) {
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags1 |= (RF1_NEVER_BLOW);
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::NEVER_BLOW);
turn_flags_ptr->do_move = false;
}
if (turn_flags_ptr->do_move && d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE) && !monster_confused_remaining(m_ptr)) {
- if (!(r_ptr->flags2 & RF2_STUPID))
+ if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::STUPID))
turn_flags_ptr->do_move = false;
else if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags2 |= (RF2_STUPID);
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::STUPID);
}
if (!turn_flags_ptr->do_move)
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_type *y_ptr;
y_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if ((r_ptr->flags1 & RF1_NEVER_BLOW) != 0)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW))
return false;
- if (((r_ptr->flags2 & RF2_KILL_BODY) == 0) && is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags2 |= (RF2_KILL_BODY);
+ if ((r_ptr->behavior_flags.has_not(MonsterBehaviorType::KILL_BODY)) && is_original_ap_and_seen(player_ptr, m_ptr))
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::KILL_BODY);
if ((y_ptr->r_idx == 0) || (y_ptr->hp < 0))
return false;
return false;
if (monster_confused_remaining(m_ptr))
return true;
- if ((r_ptr->flags2 & RF2_STUPID) == 0)
+ if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::STUPID))
return false;
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags2 |= (RF2_STUPID);
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::STUPID);
return true;
}
monster_race *z_ptr = &r_info[y_ptr->r_idx];
turn_flags_ptr->do_move = false;
- bool do_kill_body = any_bits(r_ptr->flags2, RF2_KILL_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_BLOW);
+ bool do_kill_body = r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW);
do_kill_body &= (r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level);
do_kill_body &= (g_ptr->m_idx != player_ptr->riding);
return exe_monster_attack_to_monster(player_ptr, m_idx, g_ptr);
}
- bool do_move_body = any_bits(r_ptr->flags2, RF2_MOVE_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_MOVE);
+ bool do_move_body = r_ptr->behavior_flags.has(MonsterBehaviorType::MOVE_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_MOVE);
do_move_body &= (r_ptr->mexp > z_ptr->mexp);
do_move_body &= can_cross;
do_move_body &= (g_ptr->m_idx != player_ptr->riding);
-/*!
+/*!
* @brief モンスターの移動方向を決定する処理
* @date 2020/03/08
* @author Hourier
static bool random_walk(PlayerType *player_ptr, DIRECTION *mm, monster_type *m_ptr)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (((r_ptr->flags1 & (RF1_RAND_50 | RF1_RAND_25)) == (RF1_RAND_50 | RF1_RAND_25)) && (randint0(100) < 75)) {
+ if (r_ptr->behavior_flags.has_all_of({ MonsterBehaviorType::RAND_MOVE_50, MonsterBehaviorType::RAND_MOVE_25 }) && (randint0(100) < 75)) {
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags1 |= (RF1_RAND_50 | RF1_RAND_25);
+ r_ptr->r_behavior_flags.set({ MonsterBehaviorType::RAND_MOVE_50, MonsterBehaviorType::RAND_MOVE_25 });
mm[0] = mm[1] = mm[2] = mm[3] = 5;
return true;
}
- if ((r_ptr->flags1 & RF1_RAND_50) && (randint0(100) < 50)) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50) && (randint0(100) < 50)) {
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags1 |= RF1_RAND_50;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::RAND_MOVE_50);
mm[0] = mm[1] = mm[2] = mm[3] = 5;
return true;
}
- if ((r_ptr->flags1 & RF1_RAND_25) && (randint0(100) < 25)) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_25) && (randint0(100) < 25)) {
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags1 |= RF1_RAND_25;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::RAND_MOVE_25);
mm[0] = mm[1] = mm[2] = mm[3] = 5;
return true;
return true;
}
- if ((r_ptr->flags1 & RF1_NEVER_MOVE) && (m_ptr->cdis > 1)) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE) && (m_ptr->cdis > 1)) {
mm[0] = mm[1] = mm[2] = mm[3] = 5;
return true;
}
-/*!
+/*!
* todo 後で再分割する
* @brief モンスター生成処理
* @date 2020/06/10
if (monster_has_hostile_align(player_ptr, m_ptr, 0, 0, z_ptr))
return false;
- if (r_ptr->flags7 & RF7_FRIENDLY) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY)) {
if (monster_has_hostile_align(player_ptr, nullptr, 1, -1, z_ptr))
return false;
}
static bool check_hp_for_feat_destruction(feature_type *f_ptr, monster_type *m_ptr)
{
- return f_ptr->flags.has_not(FloorFeatureType::GLASS) || (r_info[m_ptr->r_idx].flags2 & RF2_STUPID) || (m_ptr->hp >= std::max(m_ptr->maxhp / 3, 200));
+ return f_ptr->flags.has_not(FloorFeatureType::GLASS) || r_info[m_ptr->r_idx].behavior_flags.has(MonsterBehaviorType::STUPID) || (m_ptr->hp >= std::max(m_ptr->maxhp / 3, 200));
}
/*!
feature_type *f_ptr;
f_ptr = &f_info[g_ptr->feat];
turn_flags_ptr->do_move = false;
- if (((r_ptr->flags2 & RF2_OPEN_DOOR) == 0) || f_ptr->flags.has_not(FloorFeatureType::OPEN) || (is_pet(m_ptr) && ((player_ptr->pet_extra_flags & PF_OPEN_DOORS) == 0)))
+ if ((r_ptr->behavior_flags.has_not(MonsterBehaviorType::OPEN_DOOR)) || f_ptr->flags.has_not(FloorFeatureType::OPEN) || (is_pet(m_ptr) && ((player_ptr->pet_extra_flags & PF_OPEN_DOORS) == 0)))
return true;
if (f_ptr->power == 0) {
static void bash_glass_door(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr, feature_type *f_ptr, bool may_bash)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!may_bash || ((r_ptr->flags2 & RF2_BASH_DOOR) == 0) || f_ptr->flags.has_not(FloorFeatureType::BASH)
- || (is_pet(m_ptr) && ((player_ptr->pet_extra_flags & PF_OPEN_DOORS) == 0)))
+ if (!may_bash || (r_ptr->behavior_flags.has_not(MonsterBehaviorType::BASH_DOOR)) || f_ptr->flags.has_not(FloorFeatureType::BASH) || (is_pet(m_ptr) && ((player_ptr->pet_extra_flags & PF_OPEN_DOORS) == 0)))
return;
if (!check_hp_for_feat_destruction(f_ptr, m_ptr) || (randint0(m_ptr->hp / 10) <= f_ptr->power))
player_ptr->update |= (PU_FLOW);
player_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON);
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags2 |= (RF2_BASH_DOOR);
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::BASH_DOOR);
return false;
}
grid_type *g_ptr;
g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!turn_flags_ptr->do_move || !g_ptr->is_rune_protection() || (((r_ptr->flags1 & RF1_NEVER_BLOW) != 0) && player_bold(player_ptr, ny, nx)))
+ if (!turn_flags_ptr->do_move || !g_ptr->is_rune_protection() || ((r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW)) && player_bold(player_ptr, ny, nx)))
return false;
turn_flags_ptr->do_move = false;
grid_type *g_ptr;
g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!turn_flags_ptr->do_move || !g_ptr->is_rune_explosion() || (((r_ptr->flags1 & RF1_NEVER_BLOW) != 0) && player_bold(player_ptr, ny, nx)))
+ if (!turn_flags_ptr->do_move || !g_ptr->is_rune_explosion() || ((r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW)) && player_bold(player_ptr, ny, nx)))
return true;
turn_flags_ptr->do_move = false;
if (turn_flags_ptr->do_move && !can_cross && !turn_flags_ptr->did_kill_wall && !turn_flags_ptr->did_bash_door)
turn_flags_ptr->do_move = false;
- if (turn_flags_ptr->do_move && (r_ptr->flags1 & RF1_NEVER_MOVE)) {
+ if (turn_flags_ptr->do_move && r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE)) {
if (is_original_ap_and_seen(player_ptr, m_ptr))
- r_ptr->r_flags1 |= (RF1_NEVER_MOVE);
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::NEVER_MOVE);
turn_flags_ptr->do_move = false;
}
}
bool is_takable_or_killable = !g_ptr->o_idx_list.empty();
- is_takable_or_killable &= (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) != 0;
+ is_takable_or_killable &= r_ptr->behavior_flags.has_any_of({ MonsterBehaviorType::TAKE_ITEM, MonsterBehaviorType::KILL_ITEM });
bool is_pickup_items = (player_ptr->pet_extra_flags & PF_PICKUP_ITEMS) != 0;
- is_pickup_items &= (r_ptr->flags2 & RF2_TAKE_ITEM) != 0;
+ is_pickup_items &= r_ptr->behavior_flags.has(MonsterBehaviorType::TAKE_ITEM);
is_takable_or_killable &= !is_pet(m_ptr) || is_pickup_items;
if (!is_takable_or_killable) {
-/*!
+/*!
* @brief モンスターが移動した結果、床のアイテムに重なった時の処理と、モンスターがアイテムを落とす処理
* @date 2020/03/07
* @author Hourier
monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (is_special_object) {
- if (turn_flags_ptr->do_take && (r_ptr->flags2 & RF2_STUPID)) {
+ if (turn_flags_ptr->do_take && r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) {
turn_flags_ptr->did_take_item = true;
if (m_ptr->ml && player_can_see_bold(player_ptr, ny, nx)) {
msg_format(_("%^sは%sを拾おうとしたが、だめだった。", "%^s tries to pick up %s, but fails."), m_name, o_name);
grid_type *g_ptr;
g_ptr = &player_ptr->current_floor_ptr->grid_array[ny][nx];
- turn_flags_ptr->do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) != 0;
+ turn_flags_ptr->do_take = r_ptr->behavior_flags.has(MonsterBehaviorType::TAKE_ITEM);
for (auto it = g_ptr->o_idx_list.begin(); it != g_ptr->o_idx_list.end();) {
BIT_FLAGS flg2 = 0L, flg3 = 0L, flgr = 0L;
GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN];
now_cost = 999;
}
- if (r_ptr->flags2 & (RF2_BASH_DOOR | RF2_OPEN_DOOR)) {
+ if (r_ptr->behavior_flags.has_any_of({ MonsterBehaviorType::BASH_DOOR, MonsterBehaviorType::OPEN_DOOR })) {
this->can_open_door = true;
}
this->best = when;
} else {
auto *r_ptr = &r_info[floor_ptr->m_list[this->m_idx].r_idx];
- this->cost = any_bits(r_ptr->flags2, RF2_BASH_DOOR | RF2_OPEN_DOOR) ? g_ptr->get_distance(r_ptr) : g_ptr->get_cost(r_ptr);
+ this->cost = r_ptr->behavior_flags.has_any_of({ MonsterBehaviorType::BASH_DOOR, MonsterBehaviorType::OPEN_DOOR }) ? g_ptr->get_distance(r_ptr) : g_ptr->get_cost(r_ptr);
if ((this->cost == 0) || (this->best < this->cost)) {
continue;
}
-/*!
+/*!
* @brief モンスターをフロアに1体配置する処理
* @date 2020/06/13
* @author Hourier
monster_race *r_ptr = &r_info[r_idx];
bool unselectable = any_bits(r_ptr->flags1, RF1_UNIQUE);
unselectable |= any_bits(r_ptr->flags2, RF2_MULTIPLY);
- unselectable |= any_bits(r_ptr->flags7, RF7_FRIENDLY | RF7_CHAMELEON);
- unselectable |= any_bits(r_ptr->flags7, RF7_AQUATIC);
+ unselectable |= r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY);
+ unselectable |= any_bits(r_ptr->flags7, RF7_AQUATIC | RF7_CHAMELEON);
if (unselectable)
return false;
m_ptr->ml = false;
if (any_bits(mode, PM_FORCE_PET)) {
set_pet(player_ptr, m_ptr);
- } else if (((who == 0) && any_bits(r_ptr->flags7, RF7_FRIENDLY)) || is_friendly_idx(player_ptr, who) || any_bits(mode, PM_FORCE_FRIENDLY)) {
+ } else if (((who == 0) && r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY)) || is_friendly_idx(player_ptr, who) || any_bits(mode, PM_FORCE_FRIENDLY)) {
if (!monster_has_hostile_align(player_ptr, nullptr, 0, -1, r_ptr) && !player_ptr->current_floor_ptr->inside_arena)
set_friendly(m_ptr);
}
m_ptr->energy_need = ENERGY_NEED() - (int16_t)randint0(100) * 2;
}
- if (any_bits(r_ptr->flags1, RF1_PREVENT_SUDDEN_MAGIC) && !ironman_nightmare) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::PREVENT_SUDDEN_MAGIC) && !ironman_nightmare) {
m_ptr->mflag.set(MonsterTemporaryFlagType::PREVENT_MAGIC);
}
-#include "monster-race/monster-race-hook.h"
+#include "monster-race/monster-race-hook.h"
#include "dungeon/dungeon.h"
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-types.h"
if (any_bits(r_ptr->flags2, RF2_MULTIPLY))
return false;
- if (any_bits(r_ptr->flags7, RF7_FRIENDLY))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY))
return false;
return true;
if (!vault_monster_okay(player_ptr, r_idx))
return false;
- if (any_bits(r_ptr->flags2, RF2_KILL_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_BLOW))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW))
return false;
if (any_bits(r_ptr->flags3, RF3_EVIL))
if (!vault_monster_okay(player_ptr, r_idx))
return false;
- if (any_bits(r_ptr->flags2, RF2_KILL_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_BLOW))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW))
return false;
if (any_bits(r_ptr->flags3, RF3_GOOD))
if (!vault_monster_okay(player_ptr, r_idx))
return false;
- if (any_bits(r_ptr->flags2, RF2_KILL_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_BLOW))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW))
return false;
if (any_bits(r_ptr->flags3, RF3_EVIL))
if (!vault_monster_okay(player_ptr, r_idx))
return false;
- if (any_bits(r_ptr->flags2, RF2_KILL_BODY) && none_bits(r_ptr->flags1, RF1_NEVER_BLOW))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW))
return false;
if (none_bits(r_ptr->flags3, RF3_DEMON))
if (!vault_monster_okay(player_ptr, r_idx))
return false;
- if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY) && r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_BLOW))
return false;
if (!(r_ptr->flags2 & (RF2_ELDRITCH_HORROR)))
HIT_POINT dam = 0;
monster_race *r_ptr = &r_info[r_idx];
- bool unselectable = any_bits(r_ptr->flags1, RF1_NEVER_MOVE);
+ bool unselectable = r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE);
unselectable |= any_bits(r_ptr->flags2, RF2_MULTIPLY);
unselectable |= any_bits(r_ptr->flags2, RF2_QUANTUM) && none_bits(r_ptr->flags1, RF1_UNIQUE);
unselectable |= any_bits(r_ptr->flags7, RF7_AQUATIC);
ret = ret * 4 / 3;
else if (r_ptr->ability_flags.has(MonsterAbilityType::DRAIN_MANA))
ret = ret * 11 / 10;
- if (r_ptr->flags1 & RF1_RAND_25)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_25))
ret = ret * 9 / 10;
- if (r_ptr->flags1 & RF1_RAND_50)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50))
ret = ret * 9 / 10;
if (r_ptr->flagsr & RFR_RES_ALL)
ret *= 100000;
-/*!
+/*!
* @brief モンスター情報の記述 / describe monsters (using monster memory)
* @date 2013/12/11
* @author
if (angband_strchr("/|\\()[]=$,.!?&`#%<>+~", r_ptr->d_char) == nullptr)
return false;
- if (none_bits(r_ptr->flags1, RF1_NEVER_MOVE) && !monster_csleep_remaining(m_ptr)) {
+ if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_MOVE) && !monster_csleep_remaining(m_ptr)) {
return false;
}
-/*!
+/*!
* @brief モンスター処理 / misc code for monsters
* @date 2014/07/08
* @author
if (!(r_ptr->flags1 & (RF1_UNIQUE)))
return false;
- if (r_ptr->flags7 & (RF7_FRIENDLY | RF7_CHAMELEON))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY) || (r_ptr->flags7 & RF7_CHAMELEON))
return false;
if (std::abs(r_ptr->level - r_info[MON_CHAMELEON_K].level) > 5)
return false;
if (r_ptr->flags2 & RF2_MULTIPLY)
return false;
- if (r_ptr->flags7 & (RF7_FRIENDLY | RF7_CHAMELEON))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY) && (r_ptr->flags7 & RF7_CHAMELEON))
return false;
if ((r_ptr->blow[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[2].method == RaceBlowMethodType::EXPLODE)
BIT_FLAGS old_r_flags3;
BIT_FLAGS old_r_flagsr;
EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags;
+ EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags;
byte old_r_blows0;
byte old_r_blows1;
-/*!
+/*!
* @brief モンスター情報のアップデート処理
* @date 2020/03/08
* @author Hourier
return;
if (turn_flags_ptr->did_open_door)
- r_ptr->r_flags2 |= RF2_OPEN_DOOR;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::OPEN_DOOR);
if (turn_flags_ptr->did_bash_door)
- r_ptr->r_flags2 |= RF2_BASH_DOOR;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::BASH_DOOR);
if (turn_flags_ptr->did_take_item)
- r_ptr->r_flags2 |= RF2_TAKE_ITEM;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::TAKE_ITEM);
if (turn_flags_ptr->did_kill_item)
- r_ptr->r_flags2 |= RF2_KILL_ITEM;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::KILL_ITEM);
if (turn_flags_ptr->did_move_body)
- r_ptr->r_flags2 |= RF2_MOVE_BODY;
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::MOVE_BODY);
if (turn_flags_ptr->did_pass_wall)
r_ptr->r_flags2 |= RF2_PASS_WALL;
static void update_smart_stupid_flags(monster_race *r_ptr)
{
- if (r_ptr->flags2 & RF2_SMART)
- r_ptr->r_flags2 |= RF2_SMART;
+ if (r_ptr->r_behavior_flags.has(MonsterBehaviorType::SMART))
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::SMART);
- if (r_ptr->flags2 & RF2_STUPID)
- r_ptr->r_flags2 |= RF2_STUPID;
+ if (r_ptr->r_behavior_flags.has(MonsterBehaviorType::STUPID))
+ r_ptr->r_behavior_flags.set(MonsterBehaviorType::STUPID);
}
/*!
{
monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!smart_learn || ((r_ptr->flags2 & RF2_STUPID) != 0) || (((r_ptr->flags2 & RF2_SMART) == 0) && (randint0(100) < 50)))
+ if (!smart_learn || (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) || ((r_ptr->behavior_flags.has_not(MonsterBehaviorType::SMART)) && (randint0(100) < 50)))
return;
switch (what) {
{
msr_type tmp_msr;
msr_type *msr_ptr = initialize_msr_type(player_ptr, &tmp_msr, m_idx, ability_flags);
- if (msr_ptr->r_ptr->flags2 & RF2_STUPID)
+ if (msr_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return;
if (!smart_cheat && !smart_learn)
{
floor_type *floor_ptr = player_ptr->current_floor_ptr;
msa_ptr->in_no_magic_dungeon = d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC) && floor_ptr->dun_level && (!floor_ptr->inside_quest || quest_type::is_fixed(floor_ptr->inside_quest));
- if (!msa_ptr->in_no_magic_dungeon || ((msa_ptr->r_ptr->flags2 & RF2_STUPID) != 0))
+ if (!msa_ptr->in_no_magic_dungeon || ((msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))))
return;
msa_ptr->ability_flags &= RF_ABILITY_NOMAGIC_MASK;
static void check_mspell_smart(PlayerType *player_ptr, msa_type *msa_ptr)
{
- if ((msa_ptr->r_ptr->flags2 & RF2_SMART) == 0)
+ if (msa_ptr->r_ptr->behavior_flags.has_not(MonsterBehaviorType::SMART))
return;
if ((msa_ptr->m_ptr->hp < msa_ptr->m_ptr->maxhp / 10) && (randint0(100) < 50)) {
static bool check_mspell_non_stupid(PlayerType *player_ptr, msa_type *msa_ptr)
{
- if ((msa_ptr->r_ptr->flags2 & RF2_STUPID) != 0)
+ if (msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return true;
if (!player_ptr->csp)
static bool check_mspell_unexploded(PlayerType *player_ptr, msa_type *msa_ptr)
{
PERCENTAGE fail_rate = 25 - (msa_ptr->rlev + 3) / 4;
- if (msa_ptr->r_ptr->flags2 & RF2_STUPID)
+ if (msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
fail_rate = 0;
if (!spell_is_inate(msa_ptr->thrown_spell) && (msa_ptr->in_no_magic_dungeon || (monster_stunned_remaining(msa_ptr->m_ptr) && one_in_(2)) || (randint0(100) < fail_rate))) {
-/*!
+/*!
* @brief モンスターの魔法によってフロアを明るくする処理及びその判定
* @date 2020/07/23
* @author Hourier
bool can_use_lite_area = (player_ptr->pclass == PlayerClassType::NINJA) && ((msa_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) == 0)
&& ((msa_ptr->r_ptr->flags7 & RF7_DARK_MASK) == 0);
- if ((msa_ptr->r_ptr->flags2 & RF2_STUPID) != 0)
+ if (msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return;
if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) {
-/*!
+/*!
* @brief モンスターが詠唱する魔法を選択する処理
* @date 2020/07/23
* @author Hourier
monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[msa_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (r_ptr->flags2 & RF2_STUPID)
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
return (msa_ptr->mspells[randint0(msa_ptr->mspells.size())]);
for (size_t i = 0; i < msa_ptr->mspells.size(); i++) {
*/
bool int_outof(monster_race *r_ptr, PERCENTAGE prob)
{
- if (!(r_ptr->flags2 & RF2_SMART))
+ if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::SMART))
prob = prob / 2;
return (randint0(100) < prob);
}
/* Monster melee attacks */
- if ((r_ptr->flags1 & RF1_NEVER_BLOW) || d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW) || d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
dam_max += dam_max0;
continue;
}
wr_u32b(r_ptr->r_flagsr);
wr_FlagGroup(r_ptr->r_ability_flags, wr_byte);
wr_FlagGroup(r_ptr->r_aura_flags, wr_byte);
+ wr_FlagGroup(r_ptr->r_behavior_flags, wr_byte);
wr_byte((byte)r_ptr->max_num);
wr_s16b(r_ptr->floor_id);
GAME_TEXT m_name[MAX_NLEN];
sn = 0;
- if (none_bits(r_ptr->flags1, RF1_NEVER_MOVE)) {
+ if (r_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_MOVE)) {
for (DIRECTION i = 0; i < 8; i++) {
POSITION y = yy + ddy_ddd[i];
POSITION x = xx + ddx_ddd[i];
-#include "dungeon/dungeon-flag-types.h"
+#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
update_monster(player_ptr, g_ptr->m_idx, false);
- if (r_ptr->flags2 & (RF2_STUPID))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
chance = 10;
- if (r_ptr->flags2 & (RF2_SMART))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::SMART))
chance = 100;
if (monster_csleep_remaining(m_ptr) && (randint0(100) < chance)) {
-#pragma once
+#pragma once
#include <stdint.h>
#include <string>
/*!
* @brief セーブファイルのバージョン(3.0.0から導入)
*/
-constexpr uint32_t SAVEFILE_VERSION = 10;
+constexpr uint32_t SAVEFILE_VERSION = 11;
/*!
* @brief バージョンが開発版が安定版かを返す(廃止予定)
-#include "target/target-getter.h"
+#include "target/target-getter.h"
#include "core/asking-player.h"
#include "effect/spells-effect-util.h"
#include "floor/geometry.h"
if (monster_confused_remaining(m_ptr)) {
if (randint0(100) < 75)
dir = ddd[randint0(8)];
- } else if ((r_ptr->flags1 & RF1_RAND_50) && (r_ptr->flags1 & RF1_RAND_25) && (randint0(100) < 50))
+ } else if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50) && r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_25) && (randint0(100) < 50))
dir = ddd[randint0(8)];
- else if ((r_ptr->flags1 & RF1_RAND_50) && (randint0(100) < 25))
+ else if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50) && (randint0(100) < 25))
dir = ddd[randint0(8)];
}
if (monster_confused_remaining(m_ptr)) {
if (randint0(100) < 75)
dir = ddd[randint0(8)];
- } else if ((r_ptr->flags1 & RF1_RAND_50) && (r_ptr->flags1 & RF1_RAND_25) && (randint0(100) < 50))
+ } else if (r_ptr->behavior_flags.has_all_of({ MonsterBehaviorType::RAND_MOVE_50, MonsterBehaviorType::RAND_MOVE_25 }) && (randint0(100) < 50))
dir = ddd[randint0(8)];
- else if ((r_ptr->flags1 & RF1_RAND_50) && (randint0(100) < 25))
+ else if (r_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50) && (randint0(100) < 25))
dir = ddd[randint0(8)];
}
if (attack_numbers > 0) {
hooked_roff(_("。", ". "));
- } else if (lore_ptr->flags1 & RF1_NEVER_BLOW) {
+ } else if (lore_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW)) {
hooked_roff(format(_("%^sは物理的な攻撃方法を持たない。", "%^s has no physical attacks. "), Who::who(lore_ptr->msex)));
} else {
hooked_roff(format(_("%s攻撃については何も知らない。", "Nothing is known about %s attack. "), Who::whose(lore_ptr->msex)));
}
#ifdef JP
- if (lore_ptr->flags2 & (RF2_SMART))
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::SMART))
hook_c_roff(TERM_YELLOW, "的確に");
hooked_roff("魔法を使うことができ、");
#else
hooked_roff(" magical, casting spells");
- if (lore_ptr->flags2 & RF2_SMART)
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::SMART))
hook_c_roff(TERM_YELLOW, " intelligently");
#endif
lore_ptr->color[lore_ptr->vn++] = TERM_L_DARK;
}
- if (lore_ptr->flags2 & RF2_OPEN_DOOR) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::OPEN_DOOR)) {
lore_ptr->vp[lore_ptr->vn] = _("ドアを開ける", "open doors");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags2 & RF2_BASH_DOOR) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::BASH_DOOR)) {
lore_ptr->vp[lore_ptr->vn] = _("ドアを打ち破る", "bash down doors");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags2 & RF2_MOVE_BODY) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::MOVE_BODY)) {
lore_ptr->vp[lore_ptr->vn] = _("弱いモンスターを押しのける", "push past weaker monsters");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags2 & RF2_KILL_BODY) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::KILL_BODY)) {
lore_ptr->vp[lore_ptr->vn] = _("弱いモンスターを倒す", "destroy weaker monsters");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags2 & RF2_TAKE_ITEM) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::TAKE_ITEM)) {
lore_ptr->vp[lore_ptr->vn] = _("アイテムを拾う", "pick up objects");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags2 & RF2_KILL_ITEM) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::KILL_ITEM)) {
lore_ptr->vp[lore_ptr->vn] = _("アイテムを壊す", "destroy objects");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
void display_random_move(lore_type *lore_ptr)
{
- if (((lore_ptr->flags1 & RF1_RAND_50) == 0) && ((lore_ptr->flags1 & RF1_RAND_25) == 0))
+ if (lore_ptr->behavior_flags.has_none_of({ MonsterBehaviorType::RAND_MOVE_50, MonsterBehaviorType::RAND_MOVE_25 }))
return;
- if ((lore_ptr->flags1 & RF1_RAND_50) && (lore_ptr->flags1 & RF1_RAND_25)) {
+ if (lore_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50) && lore_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_25)) {
hooked_roff(_("かなり", " extremely"));
- } else if (lore_ptr->flags1 & RF1_RAND_50) {
+ } else if (lore_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_50)) {
hooked_roff(_("幾分", " somewhat"));
- } else if (lore_ptr->flags1 & RF1_RAND_25) {
+ } else if (lore_ptr->behavior_flags.has(MonsterBehaviorType::RAND_MOVE_25)) {
hooked_roff(_("少々", " a bit"));
}
void display_monster_never_move(lore_type *lore_ptr)
{
- if ((lore_ptr->flags1 & RF1_NEVER_MOVE) == 0)
+ if (lore_ptr->behavior_flags.has_not(MonsterBehaviorType::NEVER_MOVE))
return;
if (lore_ptr->old) {