const auto chainsword_noise = get_random_line(_("chainswd_j.txt", "chainswd.txt"), 0);
if (chainsword_noise) {
- msg_print(chainsword_noise.value());
+ msg_print(*chainsword_noise);
}
}
}
sound(SOUND_ZAP);
- auto ident = wand_effect(this->player_ptr, sval.value(), dir, false, false);
+ auto ident = wand_effect(this->player_ptr, *sval, dir, false, false);
using Srf = StatusRecalculatingFlag;
EnumClassFlagGroup<Srf> flags_srf = { Srf::COMBINATION, Srf::REORDER };
if (rfu.has(Srf::AUTO_DESTRUCTION)) {
}
rfu.reset_flags(flags_srf);
- if (!(o_ptr->is_aware())) {
+ if (!o_ptr->is_aware()) {
chg_virtue(this->player_ptr, Virtue::PATIENCE, -1);
chg_virtue(this->player_ptr, Virtue::CHANCE, 1);
chg_virtue(this->player_ptr, Virtue::KNOWLEDGE, -1);
return;
}
- auto q_idx = quest_num.value();
+ auto q_idx = *quest_num;
init_flags = i2enum<init_flags_type>(INIT_SHOW_TEXT | INIT_ASSIGN);
player_ptr->current_floor_ptr->quest_number = q_idx;
parse_fixed_map(player_ptr, QUEST_DEFINITION_LIST, 0, 0, 0, 0);
return;
}
- r_idx = restore_monrace_id.value();
+ r_idx = *restore_monrace_id;
}
auto *r_ptr = &monraces_info[r_idx];
return;
}
- artifacts.get_artifact(input_artifact_id.value()).is_generated = aware;
+ artifacts.get_artifact(*input_artifact_id).is_generated = aware;
msg_print(message);
}
return;
}
- auto act_idx = act_id.value();
+ auto act_idx = *act_id;
o_ptr->art_flags.set(TR_ACTIVATE);
o_ptr->activation_id = act_idx;
}
break;
}
- const auto ch = command.value();
BIT_FLAGS mode;
std::string quality;
- if (ch == 'n' || ch == 'N') {
+ if (command == 'n' || command == 'N') {
mode = 0L;
quality = "normal";
- } else if (ch == 'g' || ch == 'G') {
+ } else if (command == 'g' || command == 'G') {
mode = AM_GOOD;
quality = "good";
- } else if (ch == 'e' || ch == 'E') {
+ } else if (command == 'e' || command == 'E') {
mode = AM_GOOD | AM_GREAT;
quality = "excellent";
} else {
constexpr auto p = "Enter number of items to roll: ";
const auto rolls_opt = input_numerics(p, 0, MAX_INT, rolls);
if (rolls_opt) {
- rolls = rolls_opt.value();
+ rolls = *rolls_opt;
}
constexpr auto q = "Rolls: %d Correct: %d Matches: %d Better: %d Worse: %d Other: %d";
break;
}
- const auto ch = command.value();
- if (ch == 'A' || ch == 'a') {
+ if (command == 'A' || command == 'a') {
changed = true;
break;
}
q_ptr->fixed_artifact_idx = FixedArtifactId::NONE;
}
- switch (tolower(ch)) {
+ switch (tolower(*command)) {
/* Apply bad magic, but first clear object */
case 'w':
q_ptr->prep(o_ptr->bi_id);
return;
}
- o_ptr->pval = pval.value();
+ o_ptr->pval = *pval;
wiz_display_item(player_ptr, o_ptr);
const auto bonus_ac = input_numerics("Enter new AC Bonus setting: ", -MAX_SHORT, MAX_SHORT, o_ptr->to_a);
if (!bonus_ac) {
return;
}
- o_ptr->to_a = bonus_ac.value();
+ o_ptr->to_a = *bonus_ac;
wiz_display_item(player_ptr, o_ptr);
const auto bonus_hit = input_numerics("Enter new Hit Bonus setting: ", -MAX_SHORT, MAX_SHORT, o_ptr->to_h);
if (!bonus_hit) {
return;
}
- o_ptr->to_h = bonus_hit.value();
+ o_ptr->to_h = *bonus_hit;
wiz_display_item(player_ptr, o_ptr);
const auto bonus_damage = input_numerics("Enter new Damage Bonus setting: ", -MAX_SHORT, MAX_SHORT, o_ptr->to_d);
if (!bonus_damage) {
return;
}
- o_ptr->to_d = bonus_damage.value();
+ o_ptr->to_d = *bonus_damage;
wiz_display_item(player_ptr, o_ptr);
}
return;
}
- const auto quantity_opt = input_numerics("Quantity: ", 1, 99, o_ptr->number);
- if (!quantity_opt) {
+ const auto quantity = input_numerics("Quantity: ", 1, 99, o_ptr->number);
+ if (!quantity) {
return;
}
- const auto quantity = quantity_opt.value();
- o_ptr->number = quantity;
+ o_ptr->number = *quantity;
if (o_ptr->bi_key.tval() == ItemKindType::ROD) {
- o_ptr->pval = o_ptr->pval * o_ptr->number / quantity;
+ o_ptr->pval = o_ptr->pval * o_ptr->number / *quantity;
}
}
break;
}
- const auto ch = command.value();
- if (ch == 'A' || ch == 'a') {
+ if (command == 'A' || command == 'a') {
changed = true;
break;
}
- if (ch == 's' || ch == 'S') {
+ if (command == 's' || command == 'S') {
wiz_statistics(player_ptr, q_ptr);
}
- if (ch == 'r' || ch == 'R') {
+ if (command == 'r' || command == 'R') {
wiz_reroll_item(player_ptr, q_ptr);
}
- if (ch == 't' || ch == 'T') {
+ if (command == 't' || command == 'T') {
wiz_tweak_item(player_ptr, q_ptr);
}
- if (ch == 'q' || ch == 'Q') {
+ if (command == 'q' || command == 'Q') {
wiz_quantity_item(q_ptr);
}
}
while (true) {
const auto pray_opt = input_string(_("何をお望み? ", "For what do you wish?"), MAX_NLEN);
if (pray_opt) {
- pray = pray_opt.value();
+ pray = *pray_opt;
break;
}
prt(format("[%c] %s", listsym[list], tvals[list].desc), row, col);
}
- const auto item_type_opt = input_command(_("アイテム種別を選んで下さい", "Get what type of object? "));
- if (!item_type_opt) {
+ const auto item_type = input_command(_("アイテム種別を選んで下さい", "Get what type of object? "));
+ if (!item_type) {
return std::nullopt;
}
- const auto item_type = item_type_opt.value();
short selection;
auto max_num = list;
for (selection = 0; selection < max_num; selection++) {
return 0;
}
- const auto ch = command.value();
short selection;
for (selection = 0; selection < max_num; selection++) {
- if (listsym[selection] == ch) {
+ if (listsym[selection] == command) {
break;
}
}
return;
}
- auto stat = new_ability_score.value();
- player_ptr->stat_cur[i] = stat;
- player_ptr->stat_max[i] = stat;
+ player_ptr->stat_cur[i] = *new_ability_score;
+ player_ptr->stat_max[i] = *new_ability_score;
}
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) {
+ const auto proficiency = input_numerics(_("熟練度", "Proficiency"), unskilled, master, static_cast<short>(master));
+ if (!proficiency) {
return;
}
- const auto proficiency = proficiency_opt.value();
for (auto tval : TV_WEAPON_RANGE) {
for (int i = 0; i < 64; i++) {
- player_ptr->weapon_exp[tval][i] = proficiency;
+ player_ptr->weapon_exp[tval][i] = *proficiency;
}
}
PlayerSkill(player_ptr).limit_weapon_skills_by_max_value();
for (auto j : PLAYER_SKILL_KIND_TYPE_RANGE) {
- player_ptr->skill_exp[j] = proficiency;
+ player_ptr->skill_exp[j] = *proficiency;
auto short_pclass = enum2i(player_ptr->pclass);
if (player_ptr->skill_exp[j] > class_skills_info[short_pclass].s_max[j]) {
player_ptr->skill_exp[j] = class_skills_info[short_pclass].s_max[j];
int k;
for (k = 0; k < 32; k++) {
- player_ptr->spell_exp[k] = std::min(PlayerSkill::spell_exp_at(PlayerSkillRank::MASTER), proficiency);
+ player_ptr->spell_exp[k] = std::min(PlayerSkill::spell_exp_at(PlayerSkillRank::MASTER), *proficiency);
}
for (; k < 64; k++) {
- player_ptr->spell_exp[k] = std::min(PlayerSkill::spell_exp_at(PlayerSkillRank::EXPERT), proficiency);
+ player_ptr->spell_exp[k] = std::min(PlayerSkill::spell_exp_at(PlayerSkillRank::EXPERT), *proficiency);
}
const auto gold = input_numerics("Gold: ", 0, MAX_INT, player_ptr->au);
return;
}
- player_ptr->au = gold.value();
+ player_ptr->au = *gold;
if (PlayerRace(player_ptr).equals(PlayerRaceType::ANDROID)) {
return;
}
- const auto experience_opt = input_numerics("Experience: ", 0, MAX_INT, player_ptr->max_exp);
- if (!experience_opt) {
+ const auto experience = input_numerics("Experience: ", 0, MAX_INT, player_ptr->max_exp);
+ if (!experience) {
return;
}
- const auto experience = experience_opt.value();
- player_ptr->max_exp = experience;
- player_ptr->exp = experience;
+ player_ptr->max_exp = *experience;
+ player_ptr->exp = *experience;
player_ptr->exp_frac = 0;
}
return;
}
- const auto f_val2 = input_numerics(_("偽装地形ID", "FeatureID"), 0, max, f_val1.value());
+ const auto f_val2 = input_numerics(_("偽装地形ID", "FeatureID"), 0, max, *f_val1);
if (!f_val2) {
return;
}
- cave_set_feat(player_ptr, y, x, f_val1.value());
- grid.mimic = f_val2.value();
+ cave_set_feat(player_ptr, y, x, *f_val1);
+ grid.mimic = *f_val2;
const auto &terrain = grid.get_terrain_mimic();
if (terrain.flags.has(TerrainCharacteristics::RUNE_PROTECTION) || terrain.flags.has(TerrainCharacteristics::RUNE_EXPLOSION)) {
grid.info |= CAVE_OBJECT;
return static_cast<short>(std::clamp(static_cast<int>(command_arg), DUNGEON_ANGBAND, DUNGEON_DARKNESS));
}
- while (true) {
- const auto dungeon_id = input_numerics("Jump which dungeon", DUNGEON_ANGBAND, DUNGEON_DARKNESS, initial_dungeon_id);
- if (!dungeon_id) {
- return std::nullopt;
- }
-
- return dungeon_id.value();
- }
+ return input_numerics("Jump which dungeon", DUNGEON_ANGBAND, DUNGEON_DARKNESS, initial_dungeon_id);
}
/*
const auto &floor = *player_ptr->current_floor_ptr;
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) {
+ const auto dungeon_id = select_debugging_dungeon(dungeon_idx);
+ if (!dungeon_id) {
if (!is_in_dungeon) {
return;
}
return;
}
- const auto dungeon_id = dungeon_id_opt.value();
- const auto level_opt = select_debugging_floor(floor, dungeon_id);
+ const auto level_opt = select_debugging_floor(floor, *dungeon_id);
if (!level_opt) {
return;
}
do_cmd_save_game(player_ptr, true);
}
- wiz_jump_floor(player_ptr, dungeon_id, level);
+ wiz_jump_floor(player_ptr, *dungeon_id, level);
}
/*!
return;
}
- player_ptr->prace = new_race.value();
+ player_ptr->prace = *new_race;
rp_ptr = &race_info[enum2i(player_ptr->prace)];
change_birth_flags();
handle_stuff(player_ptr);
return;
}
- const auto new_class_enum = new_class_opt.value();
+ const auto new_class_enum = *new_class_opt;
const auto new_class = enum2i(new_class_enum);
player_ptr->pclass = new_class_enum;
cp_ptr = &class_info[new_class];
return;
}
- player_ptr->realm1 = new_realm1.value();
- player_ptr->realm2 = new_realm2.value();
+ player_ptr->realm1 = *new_realm1;
+ player_ptr->realm2 = *new_realm2;
change_birth_flags();
handle_stuff(player_ptr);
}
return;
}
- w_ptr->dungeon_turn = w_ptr->game_turn = game_time.value();
+ w_ptr->dungeon_turn = w_ptr->game_turn = *game_time;
}
/*!
}
for (const auto &d : debug_spell_commands_list) {
- if (spell.value() != d.command_name) {
+ if (*spell != d.command_name) {
continue;
}
return;
}
- (d.command_function.spell3.spell_function)(player_ptr, power.value());
+ (d.command_function.spell3.spell_function)(player_ptr, *power);
return;
}
case 4: {
return;
}
- r_idx = new_monrace_id.value();
+ r_idx = *new_monrace_id;
}
(void)summon_named_creature(player_ptr, 0, player_ptr->y, player_ptr->x, r_idx, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
return;
}
- r_idx = new_monrace_id.value();
+ r_idx = *new_monrace_id;
}
(void)summon_named_creature(player_ptr, 0, player_ptr->y, player_ptr->x, r_idx, PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET);
return;
}
- dam = input_dam.value();
+ dam = *input_dam;
}
constexpr auto max = enum2i(AttributeType::MAX);
return;
}
- idx = input_effect_id.value();
+ idx = *input_effect_id;
screen_load();
}