maxbet = std::min(maxbet, player_ptr->au);
constexpr auto prompt = _("賭け金?", "Your wager? ");
const auto wager_opt = input_integer(prompt, 1, maxbet, 1);
- if (!wager_opt.has_value()) {
+ if (!wager_opt) {
screen_load();
return false;
}
constexpr auto prompt = _("モンスターの文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^M名前):",
"Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): ");
const auto sym_opt = input_command(prompt, false);
- if (!sym_opt.has_value()) {
+ if (!sym_opt) {
screen_load();
return false;
}
} else if (sym == KTRL('M')) {
all = true;
const auto monster_name_opt = input_string(_("名前(英語の場合小文字で可)", "Enter name:"), MAX_MONSTER_NAME);
- if (!monster_name_opt.has_value()) {
+ if (!monster_name_opt) {
screen_load();
return false;
}
maxbet = std::min(maxbet, player_ptr->au);
constexpr auto prompt = _("賭け金?", "Your wager ?");
const auto wager_opt = input_integer(prompt, 1, maxbet, 1);
- if (!wager_opt.has_value()) {
+ if (!wager_opt) {
msg_print(nullptr);
screen_load();
return;
prt("--------------------------------", 8, 3);
while (true) {
const auto choice_opt = input_integer(_("何番?", "Pick a number"), 0, 9);
- if (!choice_opt.has_value()) {
+ if (!choice_opt) {
continue;
}
while (type == AMMO_NONE) {
const auto command = input_command(prompt, true);
- if (!command.has_value()) {
+ if (!command) {
return false;
}
}
auto selected_spell = get_learned_power(player_ptr);
- if (!selected_spell.has_value()) {
+ if (!selected_spell) {
return false;
}
choice = ' ';
} else {
const auto new_choice = input_command(prompt, true);
- if (!new_choice.has_value()) {
+ if (!new_choice) {
break;
}
this->choice = ' ';
} else {
const auto command = input_command(prompt, true);
- if (!command.has_value()) {
+ if (!command) {
break;
}
choice = ' ';
} else {
const auto new_choice = input_command(prompt);
- if (!new_choice.has_value()) {
+ if (!new_choice) {
break;
}
}
const auto new_choice = input_command(_("何を付加しますか:", "Command :"), true);
- if (!new_choice.has_value()) {
+ if (!new_choice) {
screen_load();
return 0;
}
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.has_value()) {
+ if (!command) {
break;
}
} else if (o_ptr->pval == 0) {
const auto limit = std::min(5, smith.get_addable_count(effect, o_ptr));
const auto num_enchants = input_numerics<short>(prompt, 1, limit, 1);
- if (!num_enchants.has_value()) {
+ if (!num_enchants) {
return;
}
} else if (effect == SmithEffectType::SLAY_GLOVE) {
const auto max_val = player_ptr->lev / 7 + 3;
const auto num_enchants = input_numerics(prompt, 1, max_val, 1);
- if (!num_enchants.has_value()) {
+ if (!num_enchants) {
return;
}
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.has_value()) {
+ if (!command) {
screen_load();
return;
}
get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x));
auto r_idx = select_horde_leader_r_idx(player_ptr);
- if (!r_idx.has_value()) {
+ if (!r_idx) {
return false;
}
}
const auto monmessage = get_random_line(filename.data(), enum2i(monster.ap_r_idx));
- if (monmessage.has_value()) {
+ if (monmessage) {
msg_format(_("%s^%s", "%s^ %s"), m_name.data(), monmessage->data());
}
}
}
const auto death_mes = get_random_line(_("mondeath_j.txt", "mondeath.txt"), enum2i(m_ptr->r_idx));
- if (death_mes.has_value()) {
+ if (death_mes) {
msg_format("%s^ %s", m_name.data(), death_mes->data());
}
if (one_in_(2)) {
constexpr auto filename = _("silly_j.txt", "silly.txt");
const auto silly_name = get_random_line(filename, enum2i(monster.r_idx));
- if (silly_name.has_value()) {
+ if (silly_name) {
return silly_name.value();
}
}
static std::string describe_non_pet(const PlayerType &player, const MonsterEntity &monster, const std::string &name, const BIT_FLAGS mode)
{
const auto fake_name = get_fake_monster_name(player, monster, name, mode);
- if (fake_name.has_value()) {
+ if (fake_name) {
return fake_name.value();
}
std::string monster_desc(PlayerType *player_ptr, const MonsterEntity *m_ptr, BIT_FLAGS mode)
{
const auto pronoun = decide_monster_personal_pronoun(*m_ptr, mode);
- if (pronoun.has_value()) {
+ if (pronoun) {
return pronoun.value();
}
const auto pronoun_self = get_monster_self_pronoun(*m_ptr, mode);
- if (pronoun_self.has_value()) {
+ if (pronoun_self) {
return pronoun_self.value();
}
? _("方向 ('5'でターゲットへ, '*'でターゲット再選択, ESCで中断)? ", "Direction ('5' for target, '*' to re-target, Escape to cancel)? ")
: _("方向 ('*'でターゲット選択, ESCで中断)? ", "Direction ('*' to choose a target, Escape to cancel)? ");
const auto command_opt = input_command(p, true);
- if (!command_opt.has_value()) {
+ if (!command_opt) {
break;
}
void setup_http_option(libcurl::EasySession &session, const std::optional<std::string> &user_agent)
{
- if (user_agent.has_value()) {
+ if (user_agent) {
session.setopt(CURLOPT_USERAGENT, user_agent->data());
}