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;
+
/* 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;