]> granicus.if.org Git - nethack/commitdiff
Casting a forgotten spell uses some random amount of power
authorPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 09:32:04 +0000 (11:32 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 09:32:08 +0000 (11:32 +0200)
... in addition to the confusion/stunning it does.

doc/fixes3-7-0.txt
src/spell.c

index 15bc41d8b70a51259f4bd856ba19f5e4483aa201..8449db7a14ef4d4ae11be50cf73081030b3d0666 100644 (file)
@@ -806,6 +806,7 @@ chargeable rings have a chance of getting charged when hit with electricity
 flint and hard gems break less often when thrown
 hobbits getting a sling also get some ammo for it
 elves and rangers get alignment penalty for cutting down trees
+casting a forgotten spell uses some random amount of power
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 457405d4cef89355b05bf04fcb78085e1f30576c..034794b9052c89b05224e5c13f402d7f471d6731 100644 (file)
@@ -919,6 +919,12 @@ spelleffects(int spell, boolean atme)
         return ECMD_OK; /* no time elapses */
     }
 
+    /*
+     *  Note: dotele() also calculates energy use and checks nutrition
+     *  and strength requirements; it any of these change, update it too.
+     */
+    energy = (spellev(spell) * 5); /* 5 <= energy <= 35 */
+
     /*
      * Spell casting no longer affects knowledge of the spell. A
      * decrement of spell knowledge is done every turn.
@@ -927,6 +933,10 @@ spelleffects(int spell, boolean atme)
         Your("knowledge of this spell is twisted.");
         pline("It invokes nightmarish images in your mind...");
         spell_backfire(spell);
+        u.uen -= rnd(energy);
+        if (u.uen < 0)
+            u.uen = 0;
+        g.context.botl = 1;
         return ECMD_TIME;
     } else if (spellknow(spell) <= KEEN / 200) { /* 100 turns left */
         You("strain to recall the spell.");
@@ -937,11 +947,6 @@ spelleffects(int spell, boolean atme)
     } else if (spellknow(spell) <= KEEN / 10) { /* 2000 turns left */
         Your("recall of this spell is gradually fading.");
     }
-    /*
-     *  Note: dotele() also calculates energy use and checks nutrition
-     *  and strength requirements; it any of these change, update it too.
-     */
-    energy = (spellev(spell) * 5); /* 5 <= energy <= 35 */
 
     if (u.uhunger <= 10 && spellid(spell) != SPE_DETECT_FOOD) {
         You("are too hungry to cast that spell.");