}
}
-
-bool select_the_force = FALSE;
-
/*!
* @brief 領域魔法の閲覧、学習、使用選択するインターフェイス処理
* Allow user to choose a spell/prayer from the given book.
#endif
int menu_line = (use_menu ? 1 : 0);
-#ifdef ALLOW_REPEAT /* TNB */
-
/* Get the spell, if available */
if (repeat_pull(&code))
{
}
}
-#endif /* ALLOW_REPEAT -- TNB */
-
p = spell_category_name(mp_ptr->spell_book);
/* Extract spells */
/* No redraw yet */
redraw = FALSE;
- /* Show choices */
p_ptr->window |= (PW_SPELL);
-
- window_stuff();
+ handle_stuff();
/* Build a prompt (accept all spells) */
#ifdef JP
{
/* Show list */
redraw = TRUE;
-
- /* Save the screen */
screen_save();
/* Display a list of spells */
/* Hide list */
redraw = FALSE;
-
- /* Restore the screen */
screen_load();
}
flag = TRUE;
}
-
- /* Restore the screen */
if (redraw) screen_load();
-
- /* Show choices */
p_ptr->window |= (PW_SPELL);
-
- window_stuff();
-
+ handle_stuff();
/* Abort if needed */
if (!flag) return FALSE;
/* Save the choice */
(*sn) = spell;
-#ifdef ALLOW_REPEAT /* TNB */
-
repeat_push((COMMAND_CODE)spell);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Success */
return TRUE;
}
char which;
COMMAND_CODE code;
-#ifdef ALLOW_REPEAT
-
/* Get the item index */
if (repeat_pull(&code) && (code == INVEN_FORCE))
{
return;
}
-#endif /* ALLOW_REPEAT */
-
/* Show the prompt */
prt(_("('w'練気術, ESC) 'w'かESCを押してください。 ", "(w for the Force, ESC) Hit 'w' or ESC. "), 0, 0);
if (which == ESCAPE) break;
else if (which == 'w')
{
-
-#ifdef ALLOW_REPEAT
-
repeat_push(INVEN_FORCE);
-
-#endif /* ALLOW_REPEAT */
-
break;
}
}
confirm_use_force(TRUE);
return;
}
- select_the_force = TRUE;
}
/* Restrict choices to "useful" books */
if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
else item_tester_hook = item_tester_learn_spell;
- /* Get an item */
q = _("どの本を読みますか? ", "Browse which book? ");
s = _("読める本がない。", "You have no books that you can read.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
+ if (!o_ptr)
{
- select_the_force = FALSE;
- return;
- }
- select_the_force = FALSE;
-
- if (item == INVEN_FORCE) /* the_force */
- {
- do_cmd_mind_browse();
+ if (item == INVEN_FORCE) /* the_force */
+ {
+ do_cmd_mind_browse();
+ return;
+ }
return;
}
- /* Get the item (in the pack) */
- else if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
-
/* Access the item's sval */
sval = o_ptr->sval;
/* Track the object kind */
object_kind_track(o_ptr->k_idx);
-
- /* Hack -- Handle stuff */
handle_stuff();
-
/* Extract spells */
for (spell = 0; spell < 32; spell++)
{
}
}
-
- /* Save the screen */
screen_save();
-
- /* Clear the top line */
prt("", 0, 0);
/* Keep browsing spells. Exit browsing on cancel. */
prt(_("読める呪文がない。", "No spells to browse."), 0, 0);
(void)inkey();
-
- /* Restore the screen */
screen_load();
return;
line++;
}
}
-
- /* Restore the screen */
screen_load();
}
if (p_ptr->realm2 == REALM_NONE) item_tester_tval = mp_ptr->spell_book;
else item_tester_hook = item_tester_learn_spell;
- /* Get an item */
q = _("どの本から学びますか? ", "Study which book? ");
s = _("読める本がない。", "You have no books that you can read.");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
+ if (!o_ptr) return;
/* Access the item's sval */
sval = o_ptr->sval;
/* Track the object kind */
object_kind_track(o_ptr->k_idx);
-
- /* Hack -- Handle stuff */
handle_stuff();
/* Mage -- Learn a selected spell */
#
/* Update Study */
p_ptr->update |= (PU_SPELLS);
- update_stuff();
+ handle_stuff();
/* Redraw object recall */
p_ptr->window |= (PW_OBJECT);
confirm_use_force(FALSE);
return;
}
- select_the_force = TRUE;
}
prayer = spell_category_name(mp_ptr->spell_book);
/* Restrict choices to spell books */
item_tester_tval = mp_ptr->spell_book;
- /* Get an item */
q = _("どの呪文書を使いますか? ", "Use which book? ");
s = _("呪文書がない!", "You have no spell books!");
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
+ if (!o_ptr)
{
- select_the_force = FALSE;
- return;
- }
- select_the_force = FALSE;
-
- if (item == INVEN_FORCE) /* the_force */
- {
- do_cmd_mind();
+ if (item == INVEN_FORCE) /* the_force */
+ {
+ do_cmd_mind();
+ return;
+ }
return;
}
- /* Get the item (in the pack) */
- else if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
-
/* Access the item's sval */
sval = o_ptr->sval;
if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && (o_ptr->tval == REALM2_BOOK)) increment = 32;
-
/* Track the object kind */
object_kind_track(o_ptr->k_idx);
-
- /* Hack -- Handle stuff */
handle_stuff();
if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
p_ptr->csp -= need_mana;
}
else over_exerted = TRUE;
-
- /* Redraw mana */
p_ptr->redraw |= (PR_MANA);
/* Failed spell */