POSITION y = 1;
POSITION x = 15;
PLAYER_LEVEL plev = player_ptr->lev;
- int ask = true;
char choice;
char out_val[160];
SPELL_IDX sentaku[32];
break;
}
+ auto should_redraw_cursor = true;
if (use_menu && choice != ' ') {
switch (choice) {
case '0': {
case '\r':
case '\n': {
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
}
}
/* Request redraw */
- if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask)) {
+ if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && should_redraw_cursor)) {
/* Show the list */
if (!redraw || use_menu) {
char psi_desc[80];
if (!use_menu) {
if (isalpha(choice)) {
- /* Note verify */
- ask = (isupper(choice));
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
} else {
- ask = false; /* Can't uppercase digits */
-
i = choice - '0' + 26;
}
}
j = sentaku[i];
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Prompt */
- (void)strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), exe_spell(player_ptr, REALM_HISSATSU, j, SpellProcessType::NAME));
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}
PERCENTAGE minfail = 0;
PLAYER_LEVEL plev = player_ptr->lev;
PERCENTAGE chance = 0;
- int ask;
char choice;
char out_val[MAX_MONSTER_NAME];
char comment[80];
continue;
}
- /* Note verify */
- ask = isupper(choice);
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
/* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
/* Totally Illegal */
if ((i < 0) || (i >= num)) {
/* Save the spell index */
spell = monster_powers.at(mane_data->mane_list[i].spell);
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Prompt */
- (void)strnfmt(tmp_val, 78, _("%sをまねますか?", "Use %s? "), spell.name);
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}
/* Get a command from the user */
while (!flag) {
- int ask = true;
-
if (choice == ESCAPE) {
choice = ' ';
} else if (!get_com(prompt.c_str(), &choice, true)) {
break;
}
+ auto should_redraw_cursor = true;
if (use_menu && (choice != ' ')) {
switch (choice) {
case '0':
case '\r':
case '\n':
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
if (menu_line > num) {
}
/* Request redraw */
- if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask)) {
+ if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && should_redraw_cursor)) {
/* Show the list */
if (!redraw || use_menu) {
byte y = 1, x = 0;
}
if (!use_menu) {
- /* Note verify */
- ask = (isupper(choice));
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
}
/* Totally Illegal */
continue;
}
- /* Verify it */
- if (ask) {
- if (!get_check(format(_("%sを使いますか? ", "Use %s? "), power_desc[i].c_str()))) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}
#include "spell/spells-describer.h"
#include "spell/spells-execution.h"
#include "spell/spells-summon.h"
-#include "spell/technic-info-table.h"
#include "status/action-setter.h"
#include "status/bad-status-setter.h"
#include "status/base-status.h"
int i;
SPELL_IDX spell = -1;
int num = 0;
- int ask = true;
- MANA_POINT need_mana;
SPELL_IDX spells[64];
bool flag, redraw, okay;
char choice;
- const magic_type *s_ptr;
char out_val[160];
concptr p;
COMMAND_CODE code;
break;
}
+ auto should_redraw_cursor = true;
if (use_menu && choice != ' ') {
switch (choice) {
case '0': {
case '\r':
case '\n': {
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
}
}
/* Display a list of spells */
print_spells(player_ptr, menu_line, spells, num, 1, 15, use_realm);
- if (ask) {
+ if (should_redraw_cursor) {
continue;
}
} else {
continue;
}
- /* Note verify */
- ask = (isupper(choice));
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
}
/* Totally Illegal */
continue;
}
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Access the spell */
- if (!is_magic(use_realm)) {
- s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
- } else {
- s_ptr = &mp_ptr->info[use_realm - 1][spell];
- }
-
- /* Extract mana consumption rate */
- if (use_realm == REALM_HISSATSU) {
- need_mana = s_ptr->smana;
- } else {
- need_mana = mod_need_mana(player_ptr, s_ptr->smana, spell, use_realm);
- }
-
- /* Prompt */
-#ifdef JP
- jverb(prompt, jverb_buf, JVERB_AND);
- /* 英日切り替え機能に対応 */
- (void)strnfmt(tmp_val, 78, "%s(MP%d, 失敗率%d%%)を%sますか? ", exe_spell(player_ptr, use_realm, spell, SpellProcessType::NAME), need_mana,
- spell_chance(player_ptr, spell, use_realm), jverb_buf);
-#else
- (void)strnfmt(tmp_val, 78, "%^s %s (%d mana, %d%% fail)? ", prompt, exe_spell(player_ptr, use_realm, spell, SpellProcessType::NAME), need_mana,
- spell_chance(player_ptr, spell, use_realm));
-#endif
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}
char choice;
bool flag, request_list;
auto tval = ItemKindType::NONE;
- int ask = true;
OBJECT_SUBTYPE_VALUE i = 0;
char out_val[160];
break;
}
+ auto should_redraw_cursor = true;
if (use_menu && choice != ' ') {
switch (choice) {
case '0': {
case 'X':
case '\r': {
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
}
}
/* Request redraw */
- if (use_menu && ask) {
+ if (use_menu && should_redraw_cursor) {
continue;
}
if (!use_menu) {
if (isalpha(choice)) {
- /* Note verify */
- ask = (isupper(choice));
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
} else {
- ask = false; /* Can't uppercase digits */
-
i = choice - '0' + 26;
}
}
}
if (!only_browse) {
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Prompt */
- (void)strnfmt(tmp_val, 78, _("%sを使いますか? ", "Use %s? "), k_info[lookup_kind(tval, i)].name.c_str());
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
auto &item = item_group[i];
if (tval == ItemKindType::ROD) {
if (item.charge > k_info[lookup_kind(tval, i)].pval * (item.count - 1) * EATER_ROD_CHARGE) {
msg_print(_("その魔法はまだ充填している最中だ。", "The magic is still charging."));
msg_print(nullptr);
- if (use_menu) {
- ask = true;
- }
continue;
}
} else {
if (item.charge < EATER_CHARGE) {
msg_print(_("その魔法は使用回数が切れている。", "The magic has no charges left."));
msg_print(nullptr);
- if (use_menu) {
- ask = true;
- }
continue;
}
}
TERM_LEN y = 1;
TERM_LEN x = 10;
PLAYER_LEVEL plev = player_ptr->lev;
- int ask = true;
char choice;
char out_val[160];
char comment[80];
break;
}
+ auto should_redraw_cursor = true;
if (use_menu && choice != ' ') {
switch (choice) {
case '0':
case '\r':
case '\n':
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
}
int spell_max = enum2i(ElementSpells::MAX);
- if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask)) {
+ if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && should_redraw_cursor)) {
if (!redraw || use_menu) {
char desc[80];
char name[80];
}
if (!use_menu) {
- ask = isupper(choice);
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
}
if ((i < 0) || (i >= num)) {
continue;
}
- if (ask) {
- char name[80];
- char tmp_val[160];
- elem = get_elemental_elem(player_ptr, i);
- spell = get_elemental_info(player_ptr, i);
- (void)sprintf(name, spell.name, get_element_name(player_ptr->element, elem));
- (void)strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), name);
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
flag = true;
}
}
this->spell = &mind_ptr->info[this->index];
- if (this->ask) {
- char tmp_val[160];
- (void)strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), this->spell->name);
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
this->flag = true;
}
return true;
}
+ this->should_redraw_cursor = true;
switch (this->choice) {
case '0':
if (!only_browse) {
case '\r':
case '\n':
this->index = this->menu_line - 1;
- this->ask = false;
+ this->should_redraw_cursor = false;
break;
default:
break;
bool MindPowerGetter::display_minds_chance(const bool only_browse)
{
- if ((this->choice != ' ') && (this->choice != '*') && (this->choice != '?') && (!use_menu || !this->ask)) {
+ if ((this->choice != ' ') && (this->choice != '*') && (this->choice != '?') && (!use_menu || !this->should_redraw_cursor)) {
return false;
}
return;
}
- this->ask = (bool)isupper(this->choice);
- if (this->ask) {
- this->choice = (char)tolower(this->choice);
- }
-
- this->index = (islower(this->choice) ? A2I(this->choice) : -1);
+ this->index = A2I(this->choice);
}
int num = 0;
TERM_LEN y = 1;
TERM_LEN x = 10;
- bool ask = true;
+ bool should_redraw_cursor = true;
char choice = 0;
concptr mind_description = "";
const mind_type *spell = nullptr;
TERM_LEN y = 1;
TERM_LEN x = 20;
PLAYER_LEVEL plev = player_ptr->lev;
- int ask;
char choice;
char out_val[160];
concptr p = _("射撃術", "power");
continue;
}
- /* Note verify */
- ask = isupper(choice);
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
/* Totally Illegal */
if ((i < 0) || (i > num) || (!only_browse && (snipe_powers[i].mana_cost > sniper_data->concent))) {
/* Save the spell index */
spell = snipe_powers[i];
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Prompt */
- (void)strnfmt(tmp_val, 78, _("%sを使いますか?", "Use %s? "), snipe_powers[i].name);
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}
char choice;
concptr q, s;
ObjectType *o_ptr;
- int ask = true;
char out_val[160];
GAME_TEXT o_name[MAX_NLEN];
int menu_line = (use_menu ? 1 : 0);
break;
}
+ auto should_redraw_cursor = true;
if (use_menu) {
switch (choice) {
case '0': {
case '\r':
case '\n': {
i = menu_line - 1;
- ask = false;
+ should_redraw_cursor = false;
break;
}
}
}
/* Request redraw */
- if ((choice == ' ') || (use_menu && ask)) {
+ if ((choice == ' ') || (use_menu && should_redraw_cursor)) {
if (!use_menu) {
page++;
}
}
if (!use_menu) {
- /* Note verify */
- ask = (isupper(choice));
-
- /* Lowercase */
- if (ask) {
- choice = (char)tolower(choice);
- }
-
- /* Extract request */
- i = (islower(choice) ? A2I(choice) : -1);
+ i = A2I(choice);
}
effect_idx = page * effect_num_per_page + i;
continue;
}
- /* Verify it */
- if (ask) {
- char tmp_val[160];
-
- /* Prompt */
- (void)strnfmt(tmp_val, 78, _("%sを付加しますか? ", "Add the ability of %s? "), Smith::get_effect_name(smith_effect_list[i]));
-
- /* Belay that order */
- if (!get_check(tmp_val)) {
- continue;
- }
- }
-
/* Stop the loop */
flag = true;
}