#include "cmd-visual/cmd-visuals.h"
#include "core/asking-player.h"
#include "core/player-redraw-types.h"
-#include "core/player-update-types.h"
#include "core/special-internal-keys.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/quest.h" //!< @do_cmd_quest() がある。後で移設する.
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
+#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
#include "util/int-char-converter.h"
#include "view/display-messages.h"
#include "window/display-sub-windows.h"
#include "wizard/cmd-wizard.h"
#include "world/world.h"
+#include <optional>
+#include <string>
/*!
* @brief ウィザードモードへの導入処理
msg_print(_("ウィザードモード突入。", "Wizard mode on."));
}
- player_ptr->update |= (PU_MONSTERS);
+ auto &rfu = RedrawingFlagsUpdater::get_instance();
+ rfu.set_flag(StatusRedrawingFlag::MONSTER_STATUSES);
player_ptr->redraw |= (PR_TITLE);
break;
}
break;
}
- if (floor_ptr->dun_level && dungeons_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MAGIC) && !pc.equals(PlayerClassType::BERSERKER) && !pc.equals(PlayerClassType::SMITH)) {
+ const auto &dungeon = dungeons_info[player_ptr->dungeon_idx];
+ auto non_magic_class = pc.equals(PlayerClassType::BERSERKER);
+ non_magic_class |= pc.equals(PlayerClassType::SMITH);
+ if (floor_ptr->dun_level && dungeon.flags.has(DungeonFeatureType::NO_MAGIC) && !non_magic_class) {
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(nullptr);
break;
}
- if (player_ptr->anti_magic && !pc.equals(PlayerClassType::BERSERKER) && !pc.equals(PlayerClassType::SMITH)) {
+ if (player_ptr->anti_magic && !non_magic_class) {
concptr which_power = _("魔法", "magic");
switch (player_ptr->pclass) {
case PlayerClassType::MINDCRAFTER:
flush();
}
if (one_in_(2)) {
- char error_m[1024];
sound(SOUND_ILLEGAL);
- if (!get_rnd_line(_("error_j.txt", "error.txt"), 0, error_m)) {
- msg_print(error_m);
+ const auto error_mes = get_random_line(_("error_j.txt", "error.txt"), 0);
+ if (error_mes.has_value()) {
+ msg_print(error_mes.value());
}
} else {
prt(_(" '?' でヘルプが表示されます。", "Type '?' for help."), 0, 0);