}
const auto item_type_opt = input_command(_("アイテム種別を選んで下さい", "Get what type of object? "));
- if (!item_type_opt.has_value()) {
+ if (!item_type_opt) {
return std::nullopt;
}
auto max_num = num;
const auto prompt = format(_("%s群の具体的なアイテムを選んで下さい", "What Kind of %s? "), tval_description.data());
const auto command = input_command(prompt);
- if (!command.has_value()) {
+ if (!command) {
return 0;
}
{
term_clear();
auto selection = wiz_select_tval();
- if (!selection.has_value()) {
+ if (!selection) {
return 0;
}
const auto max_max_ability_score = player_ptr->stat_max_max[i];
const auto max_ability_score = player_ptr->stat_max[i];
const auto new_ability_score = input_numerics(stat_names[i], 3, max_max_ability_score, max_ability_score);
- if (!new_ability_score.has_value()) {
+ if (!new_ability_score) {
return;
}
const auto unskilled = PlayerSkill::weapon_exp_at(PlayerSkillRank::UNSKILLED);
const auto master = PlayerSkill::weapon_exp_at(PlayerSkillRank::MASTER);
const auto proficiency_opt = input_numerics(_("熟練度", "Proficiency"), unskilled, master, static_cast<short>(master));
- if (!proficiency_opt.has_value()) {
+ if (!proficiency_opt) {
return;
}
}
const auto gold = input_numerics("Gold: ", 0, MAX_INT, player_ptr->au);
- if (!gold.has_value()) {
+ if (!gold) {
return;
}
}
const auto experience_opt = input_numerics("Experience: ", 0, MAX_INT, player_ptr->max_exp);
- if (!experience_opt.has_value()) {
+ if (!experience_opt) {
return;
}
return;
}
- auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
+ const Pos2D pos(y, x);
+ auto &grid = player_ptr->current_floor_ptr->get_grid(pos);
const int max = TerrainList::get_instance().size() - 1;
- const auto f_val1 = input_numerics(_("実地形ID", "FeatureID"), 0, max, g_ptr->feat);
- if (!f_val1.has_value()) {
+ const auto f_val1 = input_numerics(_("実地形ID", "FeatureID"), 0, max, grid.feat);
+ if (!f_val1) {
return;
}
const auto f_val2 = input_numerics(_("偽装地形ID", "FeatureID"), 0, max, f_val1.value());
- if (!f_val2.has_value()) {
+ if (!f_val2) {
return;
}
cave_set_feat(player_ptr, y, x, f_val1.value());
- g_ptr->mimic = f_val2.value();
- auto *f_ptr = &terrains_info[g_ptr->get_feat_mimic()];
- if (f_ptr->flags.has(TerrainCharacteristics::RUNE_PROTECTION) || f_ptr->flags.has(TerrainCharacteristics::RUNE_EXPLOSION)) {
- g_ptr->info |= CAVE_OBJECT;
- } else if (f_ptr->flags.has(TerrainCharacteristics::MIRROR)) {
- g_ptr->info |= CAVE_GLOW | CAVE_OBJECT;
+ grid.mimic = f_val2.value();
+ const auto &terrain = grid.get_terrain_mimic();
+ if (terrain.flags.has(TerrainCharacteristics::RUNE_PROTECTION) || terrain.flags.has(TerrainCharacteristics::RUNE_EXPLOSION)) {
+ grid.info |= CAVE_OBJECT;
+ } else if (terrain.flags.has(TerrainCharacteristics::MIRROR)) {
+ grid.info |= CAVE_GLOW | CAVE_OBJECT;
}
note_spot(player_ptr, y, x);
while (true) {
const auto dungeon_id = input_numerics("Jump which dungeon", DUNGEON_ANGBAND, DUNGEON_DARKNESS, initial_dungeon_id);
- if (!dungeon_id.has_value()) {
+ if (!dungeon_id) {
return std::nullopt;
}
const auto is_in_dungeon = floor.is_in_dungeon();
const auto dungeon_idx = is_in_dungeon ? floor.dungeon_idx : static_cast<short>(DUNGEON_ANGBAND);
const auto dungeon_id_opt = select_debugging_dungeon(dungeon_idx);
- if (!dungeon_id_opt.has_value()) {
+ if (!dungeon_id_opt) {
if (!is_in_dungeon) {
return;
}
const auto dungeon_id = dungeon_id_opt.value();
const auto level_opt = select_debugging_floor(floor, dungeon_id);
- if (!level_opt.has_value()) {
+ if (!level_opt) {
return;
}
void wiz_reset_race(PlayerType *player_ptr)
{
const auto new_race = input_numerics("RaceID", 0, MAX_RACES - 1, player_ptr->prace);
- if (!new_race.has_value()) {
+ if (!new_race) {
return;
}
void wiz_reset_class(PlayerType *player_ptr)
{
const auto new_class_opt = input_numerics("ClassID", 0, PLAYER_CLASS_TYPE_MAX - 1, player_ptr->pclass);
- if (!new_class_opt.has_value()) {
+ if (!new_class_opt) {
return;
}
void wiz_reset_realms(PlayerType *player_ptr)
{
const auto new_realm1 = input_numerics("1st Realm (None=0)", 0, MAX_REALM - 1, player_ptr->realm1);
- if (!new_realm1.has_value()) {
+ if (!new_realm1) {
return;
}
const auto new_realm2 = input_numerics("2nd Realm (None=0)", 0, MAX_REALM - 1, player_ptr->realm2);
- if (!new_realm2.has_value()) {
+ if (!new_realm2) {
return;
}
void set_gametime(void)
{
const auto game_time = input_integer("Dungeon Turn", 0, w_ptr->dungeon_turn_limit - 1);
- if (!game_time.has_value()) {
+ if (!game_time) {
return;
}