#include "monster/monster-update.h"
#include "core/disturbance.h"
-#include "core/player-redraw-types.h"
-#include "core/player-update-types.h"
#include "core/window-redrawer.h"
#include "dungeon/dungeon-flag-types.h"
#include "floor/cave.h"
#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"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
-#include "system/monster-race-definition.h"
-#include "system/monster-type-definition.h"
+#include "system/monster-entity.h"
+#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
+#include "system/redrawing-flags-updater.h"
#include "target/projection-path-calculator.h"
#include "timed-effect/player-blindness.h"
#include "timed-effect/player-hallucination.h"
* @param player_ptr プレイヤーへの参照ポインタ
* @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ
*/
-void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr)
+void update_player_type(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MonsterRaceInfo *r_ptr)
{
+ using Mbt = MonsterBrightnessType;
+ const auto except_has_lite = EnumClassFlagGroup<Mbt>(self_ld_mask).set({ Mbt::HAS_DARK_1, Mbt::HAS_DARK_2 });
+ auto &rfu = RedrawingFlagsUpdater::get_instance();
if (turn_flags_ptr->do_view) {
- player_ptr->update |= PU_FLOW;
+ rfu.set_flag(StatusRedrawingFlag::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))) {
- player_ptr->update |= PU_MON_LITE;
+ const auto has_lite = r_ptr->brightness_flags.has_any_of({ Mbt::HAS_LITE_1, Mbt::HAS_LITE_2 });
+ if (turn_flags_ptr->do_move && (r_ptr->brightness_flags.has_any_of(except_has_lite) || (has_lite && !player_ptr->phase_out))) {
+ rfu.set_flag(StatusRedrawingFlag::MONSTER_LITE);
}
}
*/
void update_player_window(PlayerType *player_ptr, old_race_flags *old_race_flags_ptr)
{
- monster_race *r_ptr;
+ MonsterRaceInfo *r_ptr;
r_ptr = &monraces_info[player_ptr->monster_race_idx];
if ((old_race_flags_ptr->old_r_flags1 != r_ptr->r_flags1) || (old_race_flags_ptr->old_r_flags2 != r_ptr->r_flags2) ||
(old_race_flags_ptr->old_r_flags3 != r_ptr->r_flags3) || (old_race_flags_ptr->old_r_ability_flags != r_ptr->r_ability_flags) ||
(old_race_flags_ptr->old_r_blows3 != r_ptr->r_blows[3]) || (old_race_flags_ptr->old_r_cast_spell != r_ptr->r_cast_spell) ||
(old_race_flags_ptr->old_r_behavior_flags != r_ptr->r_behavior_flags) || (old_race_flags_ptr->old_r_kind_flags != r_ptr->r_kind_flags) ||
(old_race_flags_ptr->old_r_drop_flags != r_ptr->r_drop_flags) || (old_race_flags_ptr->old_r_feature_flags != r_ptr->r_feature_flags)) {
- player_ptr->window_flags |= PW_MONSTER;
+ player_ptr->window_flags |= PW_MONSTER_LORE;
}
}
return distance;
}
-static void update_smart_stupid_flags(monster_race *r_ptr)
+static void update_smart_stupid_flags(MonsterRaceInfo *r_ptr)
{
if (r_ptr->r_behavior_flags.has(MonsterBehaviorType::SMART)) {
r_ptr->r_behavior_flags.set(MonsterBehaviorType::SMART);
}
}
- if ((player_ptr->esp_nonliving) && (r_ptr->kind_flags.has(MonsterKindType::NONLIVING) && r_ptr->kind_flags.has_none_of({ MonsterKindType::DEMON, MonsterKindType::UNDEAD }))) {
+ if ((player_ptr->esp_nonliving) && r_ptr->kind_flags.has(MonsterKindType::NONLIVING) && r_ptr->kind_flags.has_none_of({ MonsterKindType::DEMON, MonsterKindType::UNDEAD })) {
um_ptr->flag = true;
m_ptr->mflag.set(MonsterTemporaryFlagType::ESP);
if (m_ptr->is_original_ap() && !is_hallucinated) {
m_ptr->ml = true;
lite_spot(player_ptr, um_ptr->fy, um_ptr->fx);
+ auto &rfu = RedrawingFlagsUpdater::get_instance();
if (player_ptr->health_who == m_idx) {
- player_ptr->redraw |= PR_HEALTH;
+ rfu.set_flag(MainWindowRedrawingFlag::HEALTH);
}
if (player_ptr->riding == m_idx) {
- player_ptr->redraw |= PR_UHEALTH;
+ rfu.set_flag(MainWindowRedrawingFlag::UHEALTH);
}
if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
um_ptr->m_ptr->ml = false;
lite_spot(player_ptr, um_ptr->fy, um_ptr->fx);
+ auto &rfu = RedrawingFlagsUpdater::get_instance();
if (player_ptr->health_who == m_idx) {
- player_ptr->redraw |= PR_HEALTH;
+ rfu.set_flag(MainWindowRedrawingFlag::HEALTH);
}
if (player_ptr->riding == m_idx) {
- player_ptr->redraw |= PR_UHEALTH;
+ rfu.set_flag(MainWindowRedrawingFlag::UHEALTH);
}
if (um_ptr->do_disturb && (disturb_pets || um_ptr->m_ptr->is_hostile())) {
um_type tmp_um;
um_type *um_ptr = initialize_um_type(player_ptr, &tmp_um, m_idx, full);
if (disturb_high) {
- monster_race *ap_r_ptr = &monraces_info[um_ptr->m_ptr->ap_r_idx];
+ MonsterRaceInfo *ap_r_ptr = &monraces_info[um_ptr->m_ptr->ap_r_idx];
if (ap_r_ptr->r_tkills && ap_r_ptr->level >= player_ptr->lev) {
um_ptr->do_disturb = true;
}