#include "effect/effect-monster-resist-hurt.h"
#include "effect/effect-monster-util.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-flags.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
em_ptr->obvious = true;
}
- BIT_FLAGS dark = RF7_SELF_DARK_1 | RF7_SELF_DARK_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2;
+ auto dark = { MonsterBrightnessType::SELF_DARK_1, MonsterBrightnessType::SELF_DARK_2, MonsterBrightnessType::HAS_DARK_1, MonsterBrightnessType::HAS_DARK_2 };
- if (any_bits(em_ptr->r_ptr->flags7, dark)) {
+ if (em_ptr->r_ptr->brightness_flags.has_any_of(dark)) {
em_ptr->note = _("には耐性がある!", " resists!");
em_ptr->dam *= 3;
em_ptr->dam /= (randint1(6) + 6);
lore_ptr->flags7 = (lore_ptr->r_ptr->flags7 & lore_ptr->r_ptr->flags7);
lore_ptr->resistance_flags = (lore_ptr->r_ptr->resistance_flags & lore_ptr->r_ptr->r_resistance_flags);
lore_ptr->feature_flags = (lore_ptr->r_ptr->feature_flags & lore_ptr->r_ptr->r_feature_flags);
+ lore_ptr->brightness_flags = lore_ptr->r_ptr->brightness_flags;
lore_ptr->reinforce = false;
lore_ptr->know_everything = false;
lore_ptr->mode = mode;
#include "lore/magic-types-setter.h"
#include "lore/lore-calculator.h"
#include "lore/lore-util.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
#include "player-base/player-class.h"
void set_floor_types(PlayerType *player_ptr, lore_type *lore_ptr)
{
if (lore_ptr->ability_flags.has(MonsterAbilityType::DARKNESS)) {
- if (!PlayerClass(player_ptr).equals(PlayerClassType::NINJA) || lore_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) || lore_ptr->r_ptr->resistance_flags.has(MonsterResistanceType::HURT_LITE) || (lore_ptr->r_ptr->flags7 & RF7_DARK_MASK)) {
+ if (!PlayerClass(player_ptr).equals(PlayerClassType::NINJA) || lore_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) || lore_ptr->r_ptr->resistance_flags.has(MonsterResistanceType::HURT_LITE) || (lore_ptr->r_ptr->brightness_flags.has_any_of(dark_mask))) {
lore_ptr->vp[lore_ptr->vn] = _("暗闇", "create darkness");
lore_ptr->color[lore_ptr->vn++] = TERM_L_DARK;
} else {
#include "monster-floor/monster-move.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-ability-mask.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
}
bool vs_ninja = PlayerClass(player_ptr).equals(PlayerClassType::NINJA) && !ms_ptr->t_ptr->is_hostile();
- bool can_use_lite_area = vs_ninja && ms_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) && ms_ptr->r_ptr->resistance_flags.has_not(MonsterResistanceType::HURT_LITE) && !(ms_ptr->r_ptr->flags7 & RF7_DARK_MASK);
+ bool can_use_lite_area = vs_ninja && ms_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) && ms_ptr->r_ptr->resistance_flags.has_not(MonsterResistanceType::HURT_LITE) && ms_ptr->r_ptr->brightness_flags.has_none_of(dark_mask);
if (ms_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) {
return;
}
#include "mind/mind-explanations-table.h"
#include "mind/mind-mindcrafter.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-flags.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
POSITION d = distance(dy, dx, y, x);
auto *r_ptr = &monraces_info[f_ptr->m_list[m_idx].r_idx];
- if (d <= 1 && any_bits(r_ptr->flags7, RF7_HAS_LITE_1 | RF7_SELF_LITE_1)) {
+ if (d <= 1 && r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_1, MonsterBrightnessType::SELF_LITE_1 })) {
return false;
}
- if (d <= 2 && any_bits(r_ptr->flags7, RF7_HAS_LITE_2 | RF7_SELF_LITE_2)) {
+ if (d <= 2 && r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_2, MonsterBrightnessType::SELF_LITE_2 })) {
return false;
}
- if (d <= 1 && any_bits(r_ptr->flags7, RF7_HAS_DARK_1 | RF7_SELF_DARK_1)) {
+ if (d <= 1 && r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_DARK_1, MonsterBrightnessType::SELF_DARK_1 })) {
is_dark = true;
}
- if (d <= 2 && any_bits(r_ptr->flags7, RF7_HAS_DARK_2 | RF7_SELF_DARK_2)) {
+ if (d <= 2 && r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_DARK_2, MonsterBrightnessType::SELF_DARK_2 })) {
is_dark = true;
}
}
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags7.h"
#include "monster/monster-describer.h"
#include "monster/monster-status.h"
lite_spot(player_ptr, oy, ox);
lite_spot(player_ptr, ty, tx);
- if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (r_ptr->brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
#include "monster-floor/special-death-switcher.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags7.h"
md_ptr->r_ptr->defeat_level = player_ptr->lev;
}
- if (md_ptr->r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (md_ptr->r_ptr->brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= PU_MON_LITE;
}
#include "grid/grid.h"
#include "monster-floor/monster-lite-util.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-flags.h"
#include "monster-race/race-flags7.h"
#include "monster/monster-status.h"
#include "player-base/player-class.h"
}
int rad = 0;
- if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_SELF_LITE_1)) {
+ if (r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_1, MonsterBrightnessType::SELF_LITE_1 })) {
rad++;
}
- if (r_ptr->flags7 & (RF7_HAS_LITE_2 | RF7_SELF_LITE_2)) {
+ if (r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_2, MonsterBrightnessType::SELF_LITE_2 })) {
rad += 2;
}
- if (r_ptr->flags7 & (RF7_HAS_DARK_1 | RF7_SELF_DARK_1)) {
+ if (r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_DARK_1, MonsterBrightnessType::SELF_DARK_1 })) {
rad--;
}
- if (r_ptr->flags7 & (RF7_HAS_DARK_2 | RF7_SELF_DARK_2)) {
+ if (r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_DARK_2, MonsterBrightnessType::SELF_DARK_2 })) {
rad -= 2;
}
TerrainCharacteristics f_flag;
if (rad > 0) {
- if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (m_ptr->is_asleep() || (!floor_ptr->dun_level && is_daytime()) || player_ptr->phase_out)) {
+ if (r_ptr->brightness_flags.has_none_of({ MonsterBrightnessType::SELF_LITE_1, MonsterBrightnessType::SELF_LITE_2 }) && (m_ptr->is_asleep() || (!floor_ptr->dun_level && is_daytime()) || player_ptr->phase_out)) {
continue;
}
add_mon_lite = update_monster_lite;
f_flag = TerrainCharacteristics::LOS;
} else {
- if (!(r_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) && (m_ptr->is_asleep() || (!floor_ptr->dun_level && !is_daytime()))) {
+ if (r_ptr->brightness_flags.has_none_of({ MonsterBrightnessType::SELF_DARK_1, MonsterBrightnessType::SELF_DARK_2 }) && (m_ptr->is_asleep() || (!floor_ptr->dun_level && !is_daytime()))) {
continue;
}
#include "floor/floor-object.h"
#include "grid/grid.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags7.h"
#include "monster-race/race-indice-types.h"
*m_ptr = {};
floor_ptr->m_cnt--;
lite_spot(player_ptr, y, x);
- if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (r_ptr->brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
}
#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-kind-mask.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
m_ptr->mflag.set(MonsterTemporaryFlagType::BORN);
}
- if (any_bits(r_ptr->flags7, RF7_SELF_LD_MASK)) {
+ if (r_ptr->brightness_flags.has_any_of(self_ld_mask)) {
set_bits(player_ptr->update, PU_MON_LITE);
- } else if (any_bits(r_ptr->flags7, RF7_HAS_LD_MASK) && !m_ptr->is_asleep()) {
+ } else if (r_ptr->brightness_flags.has_any_of(has_ld_mask) && !m_ptr->is_asleep()) {
set_bits(player_ptr->update, PU_MON_LITE);
}
update_monster(player_ptr, g_ptr->m_idx, true);
MonsterBrightnessType::SELF_DARK_1,
MonsterBrightnessType::SELF_DARK_2
};
+
+const EnumClassFlagGroup<MonsterBrightnessType> ld_mask = EnumClassFlagGroup<MonsterBrightnessType>(lite_mask).set(dark_mask);
extern const EnumClassFlagGroup<MonsterBrightnessType> dark_mask;
extern const EnumClassFlagGroup<MonsterBrightnessType> has_ld_mask;
extern const EnumClassFlagGroup<MonsterBrightnessType> self_ld_mask;
+extern const EnumClassFlagGroup<MonsterBrightnessType> ld_mask;
#include "monster-floor/monster-summon.h"
#include "monster-race/monster-kind-mask.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
lite_spot(player_ptr, m_ptr->fy, m_ptr->fx);
auto old_r_idx = m_ptr->r_idx;
- if ((monraces_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) || (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))) {
+ if (monraces_info[old_r_idx].brightness_flags.has_any_of(ld_mask) || r_ptr->brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
#include "monster-floor/monster-move.h"
#include "monster-race/monster-kind-mask.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
#include "monster-race/race-indice-types.h"
}
}
- if (monraces_info[m_ptr->r_idx].flags7 & RF7_HAS_LD_MASK) {
+ if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(has_ld_mask)) {
player_ptr->update |= PU_MON_LITE;
}
#include "grid/grid.h"
#include "mind/drs-types.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-flags.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
*/
void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MonsterRaceInfo *r_ptr)
{
+ auto except_has_lite = EnumClassFlagGroup<MonsterBrightnessType>(self_ld_mask).set({ MonsterBrightnessType::HAS_DARK_1, MonsterBrightnessType::HAS_DARK_2 });
if (turn_flags_ptr->do_view) {
player_ptr->update |= PU_FLOW;
player_ptr->window_flags |= PW_OVERHEAD | PW_DUNGEON;
}
- if (turn_flags_ptr->do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !player_ptr->phase_out))) {
+ if (turn_flags_ptr->do_move && (r_ptr->brightness_flags.has_any_of(except_has_lite) || (r_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_1, MonsterBrightnessType::HAS_LITE_2 }) && !player_ptr->phase_out))) {
player_ptr->update |= PU_MON_LITE;
}
}
#include "mind/drs-types.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-ability-flags.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags3.h"
const auto is_ninja = PlayerClass(player_ptr).equals(PlayerClassType::NINJA);
const auto is_living_monster = r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD);
const auto is_not_weak_lite = r_ptr->resistance_flags.has_not(MonsterResistanceType::HURT_LITE);
- if (is_ninja && is_living_monster && is_not_weak_lite && none_bits(r_ptr->flags7, RF7_DARK_MASK)) {
+ if (is_ninja && is_living_monster && is_not_weak_lite && r_ptr->brightness_flags.has_none_of(dark_mask)) {
can_use_lite_area = true;
}
#include "floor/line-of-sight.h"
#include "monster-race/monster-race.h"
#include "monster-race/race-ability-mask.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
}
PlayerClass pc(player_ptr);
- bool can_use_lite_area = pc.equals(PlayerClassType::NINJA) && msa_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) && msa_ptr->r_ptr->resistance_flags.has_not(MonsterResistanceType::HURT_LITE) && ((msa_ptr->r_ptr->flags7 & RF7_DARK_MASK) == 0);
+ bool can_use_lite_area = pc.equals(PlayerClassType::NINJA) && msa_ptr->r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD) && msa_ptr->r_ptr->resistance_flags.has_not(MonsterResistanceType::HURT_LITE) && (msa_ptr->r_ptr->brightness_flags.has_none_of(dark_mask));
if (msa_ptr->r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) {
return;
#include "mind/mind-ninja.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags7.h"
#include "monster/monster-describer.h"
#include "monster/monster-info.h"
lite_spot(player_ptr, oy, ox);
lite_spot(player_ptr, ty, tx);
- if (monraces_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
}
#include "grid/feature-flag-types.h"
#include "grid/grid.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags7.h"
#include "monster/monster-describer.h"
#include "monster/monster-status-setter.h"
update_monster(player_ptr, m_idx, true);
lite_spot(player_ptr, target_row, target_col);
lite_spot(player_ptr, ty, tx);
- if (monraces_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
#include "main/sound-of-music.h"
#include "monster-floor/monster-move.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-mask.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags7.h"
#include "monster/monster-info.h"
lite_spot(player_ptr, oy, ox);
lite_spot(player_ptr, ny, nx);
- if (monraces_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
lite_spot(player_ptr, oy, ox);
lite_spot(player_ptr, ny, nx);
- if (monraces_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) {
+ if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(ld_mask)) {
player_ptr->update |= (PU_MON_LITE);
}
}
#include "lore/lore-calculator.h"
#include "lore/lore-util.h"
#include "monster-race/monster-race.h"
+#include "monster-race/race-brightness-flags.h"
#include "monster-race/race-flags-resistance.h"
#include "monster-race/race-flags1.h"
#include "monster-race/race-flags2.h"
void display_monster_concrete_abilities(lore_type *lore_ptr)
{
- if (lore_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) {
+ if (lore_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_LITE_1, MonsterBrightnessType::HAS_LITE_2 })) {
lore_ptr->vp[lore_ptr->vn] = _("ダンジョンを照らす", "illuminate the dungeon");
lore_ptr->color[lore_ptr->vn++] = TERM_WHITE;
}
- if (lore_ptr->flags7 & (RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) {
+ if (lore_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::HAS_DARK_1, MonsterBrightnessType::HAS_DARK_2 })) {
lore_ptr->vp[lore_ptr->vn] = _("ダンジョンを暗くする", "darken the dungeon");
lore_ptr->color[lore_ptr->vn++] = TERM_L_DARK;
}
hooked_roff(format(_("%^sは水中に棲んでいる。", "%^s lives in water. "), Who::who(lore_ptr->msex)));
}
- if (lore_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) {
+ if (lore_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::SELF_LITE_1, MonsterBrightnessType::SELF_LITE_2 })) {
hooked_roff(format(_("%^sは光っている。", "%^s is shining. "), Who::who(lore_ptr->msex)));
}
- if (lore_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) {
+ if (lore_ptr->brightness_flags.has_any_of({ MonsterBrightnessType::SELF_DARK_1, MonsterBrightnessType::SELF_DARK_2 })) {
hook_c_roff(TERM_L_DARK, format(_("%^sは暗黒に包まれている。", "%^s is surrounded by darkness. "), Who::who(lore_ptr->msex)));
}