return std::nullopt;
}
- switch (command.value()) {
+ switch (*command) {
case 'A':
case 'a':
return BlueMagicType::BOLT;
break;
}
- choice = choice_opt.value();
+ choice = *choice_opt;
}
if (first_show_list || (choice == ' ') || (choice == '*') || (choice == '?')) {
while (!selected_spell) {
describe_blue_magic_name(player_ptr, menu_line, bluemage_data, spells);
- const auto choice_opt = input_command(prompt, true);
- if (!choice_opt) {
+ const auto choice = input_command(prompt, true);
+ if (!choice) {
break;
}
- const auto choice = choice_opt.value();
if (choice == '0') {
break;
}
- if (!switch_blue_magic_choice(choice, menu_line, bluemage_data, spells)) {
+ if (!switch_blue_magic_choice(*choice, menu_line, bluemage_data, spells)) {
continue;
}
return std::nullopt;
}
- return static_cast<T>(new_visual_id.value());
+ return static_cast<T>(*new_visual_id);
}
if (isupper(i)) {
}
if (item.is_random_artifact()) {
- const std::string_view name_sv = item.randart_name.value();
+ const std::string_view name_sv = *item.randart_name;
/* '『' から始まらない伝説のアイテムの名前は最初に付加する */
/* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
ss << name_sv.substr(3) << "の";
return ss.str();
} else if (!name_sv.starts_with("『") && !name_sv.starts_with("《") && !name_sv.starts_with('\'')) {
- return item.randart_name.value();
+ return *item.randart_name;
}
}
return std::nullopt;
}
- const std::string_view name_sv = item.randart_name.value();
+ const std::string_view name_sv = *item.randart_name;
if (name_sv.starts_with("『") || name_sv.starts_with("《")) {
return item.randart_name;
}
ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
const auto &filename = get_open_filename(&ofn, ANGBAND_DIR_SAVE, savefile, MAIN_WIN_MAX_PATH);
if (filename) {
- savefile = filename.value();
+ savefile = *filename;
validate_file(savefile);
game_in_progress = true;
}
ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
const auto &filename = get_open_filename(&ofn, ANGBAND_DIR_USER, savefile, MAIN_WIN_MAX_PATH);
if (filename) {
- savefile = filename.value();
+ savefile = *filename;
prepare_browse_movie_without_path_build(savefile);
movie_in_progress = true;
}
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
const auto &filename = get_open_filename(&ofn, "", wallpaper_path, MAIN_WIN_MAX_PATH);
if (filename) {
- wallpaper_path = filename.value();
+ wallpaper_path = *filename;
change_bg_mode(bg_mode::BG_ONE, true, true);
}
break;
}
while (type == AMMO_NONE) {
- const auto command = input_command(prompt, true);
- if (!command) {
+ const auto ch = input_command(prompt, true);
+ if (!ch) {
return false;
}
- const auto ch = command.value();
if (ch == 'S' || ch == 's') {
type = AMMO_SHOT;
break;
break;
}
- choice = new_choice.value();
+ choice = *new_choice;
}
auto should_redraw_cursor = true;
break;
}
- this->choice = command.value();
+ this->choice = *command;
}
if (!interpret_mind_key_input(only_browse)) {
break;
}
- choice = new_choice.value();
+ choice = *new_choice;
}
/* Request redraw */
return 0;
}
- choice = new_choice.value();
+ choice = *new_choice;
if (isupper(choice)) {
choice = (char)tolower(choice);
}
display_smith_effect_list(smith, smith_effect_list, menu_line, page * effect_num_per_page, effect_num_per_page);
const auto page_effect_num = std::min<int>(effect_num_per_page, smith_effect_list.size() - (page * effect_num_per_page));
- const auto command = input_command(prompt);
- if (!command) {
+ const auto choice = input_command(prompt);
+ if (!choice) {
break;
}
- const auto choice = command.value();
auto should_redraw_cursor = true;
if (use_menu) {
- switch (choice) {
+ switch (*choice) {
case '0': {
screen_load();
return;
}
if (!use_menu) {
- i = A2I(choice);
+ i = A2I(*choice);
}
effect_idx = page * effect_num_per_page + i;
return;
}
- o_ptr->pval = num_enchants.value();
+ o_ptr->pval = *num_enchants;
}
add_essence_count = o_ptr->pval;
return;
}
- add_essence_count = num_enchants.value();
+ add_essence_count = *num_enchants;
}
msg_format(_("エッセンスを%d個使用します。", "It will take %d essences."), use_essence * add_essence_count);
prt(_(" d) エッセンス付加", " d) Add essence"), 5, 14);
prt(_(" e) 武器/防具強化", " e) Enchant weapon/armor"), 6, 14);
std::string prompt = _(format("どの能力を%sますか:", only_browse ? "調べ" : "使い"), "Command :");
- const auto command = input_command(prompt, true);
- if (!command) {
+ const auto choice = input_command(prompt, true);
+ if (!choice) {
screen_load();
return;
}
- const auto choice = command.value();
- switch (choice) {
+ switch (*choice) {
case 'A':
case 'a':
mode = 1;
return true;
}
- auto *r_ptr = &monraces_info[r_idx.value()];
+ auto *r_ptr = &monraces_info[*r_idx];
if (floor_ptr->m_list[m_idx].mflag2.has(MonsterConstantFlagType::CHAMELEON)) {
r_ptr = &monraces_info[floor_ptr->m_list[m_idx].r_idx];
}
constexpr auto filename = _("silly_j.txt", "silly.txt");
const auto silly_name = get_random_line(filename, enum2i(monster.r_idx));
if (silly_name) {
- return silly_name.value();
+ return *silly_name;
}
}
{
const auto fake_name = get_fake_monster_name(player, monster, name, mode);
if (fake_name) {
- return fake_name.value();
+ return *fake_name;
}
if (any_bits(mode, MD_INDEF_VISIBLE)) {
{
const auto pronoun = decide_monster_personal_pronoun(*m_ptr, mode);
if (pronoun) {
- return pronoun.value();
+ return *pronoun;
}
const auto pronoun_self = get_monster_self_pronoun(*m_ptr, mode);
if (pronoun_self) {
- return pronoun_self.value();
+ return *pronoun_self;
}
const auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
break;
}
- auto command = command_opt.value();
+ auto command = *command_opt;
if (use_menu && (command == '\r')) {
command = 't';
}