-#include "core/player-processor.h"
+#include "core/player-processor.h"
#include "action/run-execution.h"
#include "action/travel-execution.h"
#include "core/disturbance.h"
-#include "core/player-redraw-types.h"
-#include "core/player-update-types.h"
#include "core/special-internal-keys.h"
#include "core/speed-table.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#include "dungeon/dungeon.h"
#include "floor/floor-save-util.h"
#include "floor/floor-util.h"
#include "floor/geometry.h"
#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
#include "monster/monster-describer.h"
#include "monster/monster-flag-types.h"
#include "monster/monster-list.h"
#include "spell-realm/spells-hex.h"
#include "spell-realm/spells-song.h"
#include "status/action-setter.h"
+#include "system/angband-system.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-race-info.h"
#include "system/player-type-definition.h"
+#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
+#include "timed-effect/player-blindness.h"
#include "timed-effect/player-confusion.h"
#include "timed-effect/player-cut.h"
#include "timed-effect/player-hallucination.h"
+#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
{
term_xtra(TERM_XTRA_DELAY, 10);
if (one_in_(1000)) {
- MONRACE_IDX r_idx;
bool success = false;
get_mon_num_prep(player_ptr, monster_is_fishing_target, nullptr);
- r_idx = get_mon_num(player_ptr, 0,
- is_in_dungeon(player_ptr) ? player_ptr->current_floor_ptr->dun_level
- : wilderness[player_ptr->wilderness_y][player_ptr->wilderness_x].level,
- 0);
+ auto *floor_ptr = player_ptr->current_floor_ptr;
+ const auto wild_level = wilderness[player_ptr->wilderness_y][player_ptr->wilderness_x].level;
+ const auto level = floor_ptr->is_in_dungeon() ? floor_ptr->dun_level : wild_level;
+ const auto r_idx = get_mon_num(player_ptr, 0, level, PM_NONE);
msg_print(nullptr);
- if (r_idx && one_in_(2)) {
+ if (MonsterRace(r_idx).is_valid() && one_in_(2)) {
POSITION y, x;
y = player_ptr->y + ddy[player_ptr->fishing_dir];
x = player_ptr->x + ddx[player_ptr->fishing_dir];
- if (place_monster_aux(player_ptr, 0, y, x, r_idx, PM_NO_KAGE)) {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, &player_ptr->current_floor_ptr->m_list[player_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
- msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
+ if (place_specific_monster(player_ptr, 0, y, x, r_idx, PM_NO_KAGE)) {
+ const auto m_name = monster_desc(player_ptr, &floor_ptr->m_list[floor_ptr->grid_array[y][x].m_idx], 0);
+ msg_print(_(format("%sが釣れた!", m_name.data()), "You have a good catch!"));
success = true;
}
}
player_ptr->invoking_midnight_curse = false;
}
- if (player_ptr->phase_out) {
+ const auto &system = AngbandSystem::get_instance();
+ if (system.is_phase_out()) {
for (MONSTER_IDX m_idx = 1; m_idx < player_ptr->current_floor_ptr->m_max; m_idx++) {
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
- if (!monster_is_valid(m_ptr)) {
+ if (!m_ptr->is_valid()) {
continue;
}
}
}
- if (player_ptr->riding && !player_ptr->effects()->confusion()->is_confused() && !player_ptr->blind) {
+ const auto effects = player_ptr->effects();
+ if (player_ptr->riding && !effects->confusion()->is_confused() && !effects->blindness()->is_blind()) {
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->riding];
- auto *r_ptr = &r_info[m_ptr->r_idx];
- if (monster_csleep_remaining(m_ptr)) {
- GAME_TEXT m_name[MAX_NLEN];
+ auto *r_ptr = &m_ptr->get_monrace();
+ if (m_ptr->is_asleep()) {
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
(void)set_monster_csleep(player_ptr, player_ptr->riding, 0);
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sを起こした。", "You have woken %s up."), m_name);
+ msg_format(_("%s^を起こした。", "You have woken %s up."), m_name.data());
}
- if (monster_stunned_remaining(m_ptr)) {
+ if (m_ptr->is_stunned()) {
if (set_monster_stunned(player_ptr, player_ptr->riding,
- (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (monster_stunned_remaining(m_ptr) - 1))) {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sを朦朧状態から立ち直らせた。", "%^s is no longer stunned."), m_name);
+ (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (m_ptr->get_remaining_stun() - 1))) {
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
+ msg_format(_("%s^を朦朧状態から立ち直らせた。", "%s^ is no longer stunned."), m_name.data());
}
}
- if (monster_confused_remaining(m_ptr)) {
+ if (m_ptr->is_confused()) {
if (set_monster_confused(player_ptr, player_ptr->riding,
- (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (monster_confused_remaining(m_ptr) - 1))) {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sを混乱状態から立ち直らせた。", "%^s is no longer confused."), m_name);
+ (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (m_ptr->get_remaining_confusion() - 1))) {
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
+ msg_format(_("%s^を混乱状態から立ち直らせた。", "%s^ is no longer confused."), m_name.data());
}
}
- if (monster_fear_remaining(m_ptr)) {
+ if (m_ptr->is_fearful()) {
if (set_monster_monfear(player_ptr, player_ptr->riding,
- (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (monster_fear_remaining(m_ptr) - 1))) {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sを恐怖から立ち直らせた。", "%^s is no longer afraid."), m_name);
+ (randint0(r_ptr->level) < player_ptr->skill_exp[PlayerSkillKindType::RIDING]) ? 0 : (m_ptr->get_remaining_fear() - 1))) {
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
+ msg_format(_("%s^を恐怖から立ち直らせた。", "%s^ is no longer fearful."), m_name.data());
}
}
set_lightspeed(player_ptr, player_ptr->lightspeed - 1, true);
}
+ auto &rfu = RedrawingFlagsUpdater::get_instance();
if (PlayerClass(player_ptr).equals(PlayerClassType::FORCETRAINER) && get_current_ki(player_ptr)) {
if (get_current_ki(player_ptr) < 40) {
set_current_ki(player_ptr, true, 0);
} else {
set_current_ki(player_ptr, false, -40);
}
- player_ptr->update |= (PU_BONUS);
+ rfu.set_flag(StatusRecalculatingFlag::BONUS);
}
if (player_ptr->action == ACTION_LEARN) {
s64b_sub(&(player_ptr->csp), &(player_ptr->csp_frac), cost, cost_frac);
}
- player_ptr->redraw |= PR_MANA;
+ rfu.set_flag(MainWindowRedrawingFlag::MP);
}
if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU)) {
set_action(player_ptr, ACTION_NONE);
} else {
player_ptr->csp -= 2;
- player_ptr->redraw |= (PR_MANA);
+ rfu.set_flag(MainWindowRedrawingFlag::MP);
}
}
/*** Handle actual user input ***/
while (player_ptr->energy_need <= 0) {
- player_ptr->window_flags |= PW_PLAYER;
+ rfu.set_flag(SubWindowRedrawingFlag::PLAYER);
player_ptr->sutemi = false;
player_ptr->counter = false;
player_ptr->now_damaged = false;
PlayerEnergy energy(player_ptr);
energy.reset_player_turn();
- auto effects = player_ptr->effects();
auto is_knocked_out = effects->stun()->is_knocked_out();
- if (player_ptr->phase_out) {
+ auto is_paralyzed = effects->paralysis()->is_paralyzed();
+ if (system.is_phase_out()) {
move_cursor_relative(player_ptr->y, player_ptr->x);
command_cmd = SPECIAL_KEY_BUILDING;
process_command(player_ptr);
- } else if ((player_ptr->paralyzed || is_knocked_out) && !cheat_immortal) {
+ } else if ((is_paralyzed || is_knocked_out) && !cheat_immortal) {
energy.set_player_turn_energy(100);
} else if (player_ptr->action == ACTION_REST) {
if (player_ptr->resting > 0) {
if (!player_ptr->resting) {
set_action(player_ptr, ACTION_NONE);
}
- player_ptr->redraw |= (PR_STATE);
+
+ rfu.set_flag(MainWindowRedrawingFlag::ACTION);
}
energy.set_player_turn_energy(100);
travel_step(player_ptr);
} else if (command_rep) {
command_rep--;
- player_ptr->redraw |= (PR_STATE);
+ rfu.set_flag(MainWindowRedrawingFlag::ACTION);
handle_stuff(player_ptr);
msg_flag = false;
prt("", 0, 0);
} else {
move_cursor_relative(player_ptr->y, player_ptr->x);
- player_ptr->window_flags |= PW_MONSTER_LIST;
+ static constexpr auto flags = {
+ SubWindowRedrawingFlag::SIGHT_MONSTERS,
+ SubWindowRedrawingFlag::PETS,
+ };
+ rfu.set_flags(flags);
window_stuff(player_ptr);
can_save = true;
}
if (effects->hallucination()->is_hallucinated()) {
- player_ptr->redraw |= (PR_MAP);
+ rfu.set_flag(MainWindowRedrawingFlag::MAP);
}
for (MONSTER_IDX m_idx = 1; m_idx < player_ptr->current_floor_ptr->m_max; m_idx++) {
- monster_type *m_ptr;
- monster_race *r_ptr;
+ MonsterEntity *m_ptr;
+ MonsterRaceInfo *r_ptr;
m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
- if (!monster_is_valid(m_ptr)) {
+ if (!m_ptr->is_valid()) {
continue;
}
- r_ptr = &r_info[m_ptr->ap_r_idx];
+ r_ptr = &m_ptr->get_appearance_monrace();
// モンスターのシンボル/カラーの更新
if (m_ptr->ml && r_ptr->visual_flags.has_any_of({ MonsterVisualType::MULTI_COLOR, MonsterVisualType::SHAPECHANGER })) {
m_ptr->ml = false;
update_monster(player_ptr, m_idx, false);
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);
}
lite_spot(player_ptr, m_ptr->fy, m_ptr->fx);
}
mane_data->new_mane = false;
- player_ptr->redraw |= (PR_IMITATION);
+ rfu.set_flag(MainWindowRedrawingFlag::IMITATION);
}
if (player_ptr->action == ACTION_LEARN) {
auto mane_data = PlayerClass(player_ptr).get_specific_data<bluemage_data_type>();
mane_data->new_magic_learned = false;
- player_ptr->redraw |= (PR_STATE);
+ rfu.set_flag(MainWindowRedrawingFlag::ACTION);
}
if (player_ptr->timewalk && (player_ptr->energy_need > -1000)) {
- player_ptr->redraw |= (PR_MAP);
- player_ptr->update |= (PU_MONSTERS);
- player_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON);
-
+ rfu.set_flag(MainWindowRedrawingFlag::MAP);
+ rfu.set_flag(StatusRecalculatingFlag::MONSTER_STATUSES);
+ static constexpr auto flags_swrf = {
+ SubWindowRedrawingFlag::OVERHEAD,
+ SubWindowRedrawingFlag::DUNGEON,
+ };
+ rfu.set_flags(flags_swrf);
msg_print(_("「時は動きだす…」", "You feel time flowing around you once more."));
msg_print(nullptr);
player_ptr->timewalk = false;
break;
}
- auto sniper_data = PlayerClass(player_ptr).get_specific_data<sniper_data_type>();
+ auto sniper_data = PlayerClass(player_ptr).get_specific_data<SniperData>();
if (player_ptr->energy_use && sniper_data && sniper_data->reset_concent) {
reset_concentration(player_ptr, true);
}