byte spells[64];
bool flag, redraw, okay;
char choice;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
char out_val[160];
cptr p;
#ifdef JP
object_type *o_ptr;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
cptr q, s;
+ bool over_exerted = FALSE;
+
/* Require spell ability */
if (!p_ptr->realm1 && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE))
{
}
-
/* Spell failure chance */
chance = spell_chance(spell, use_realm);
+ /* Sufficient mana */
+ if (need_mana <= p_ptr->csp)
+ {
+ /* Use some mana */
+ p_ptr->csp -= need_mana;
+ }
+ else over_exerted = TRUE;
+
+ /* Redraw mana */
+ p_ptr->redraw |= (PR_MANA);
+
/* Failed spell */
if (randint0(100) < chance)
{
/* Take a turn */
energy_use = 100;
- /* Sufficient mana */
- if (need_mana <= p_ptr->csp)
- {
- /* Use some mana */
- p_ptr->csp -= need_mana;
- }
/* Over-exert the player */
- else
+ if(over_exerted)
{
int oops = need_mana;
}
}
- /* Redraw mana */
- p_ptr->redraw |= (PR_MANA);
-
/* Window stuff */
p_ptr->window |= (PW_PLAYER);
p_ptr->window |= (PW_SPELL);
int powers[36];
cptr power_desc[36];
bool flag, redraw;
- int ask;
char choice;
char out_val[160];
int pet_ctr;
/* Get a command from the user */
while (!flag)
{
+ int ask = TRUE;
+
if (choice == ESCAPE) choice = ' ';
else if (!get_com(out_val, &choice, TRUE)) break;