]> granicus.if.org Git - nethack/commitdiff
couple of spell bits (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 12 Feb 2006 06:24:25 +0000 (06:24 +0000)
committernethack.rankin <nethack.rankin>
Sun, 12 Feb 2006 06:24:25 +0000 (06:24 +0000)
     Move NO_SPELL and MAX_SPELL_STUDY from hack.h to spell.h.  I didn't
even remember that the latter existed when I put MAX_SPELL_STUDY in the
former recently.

     Add a couple of new "spell is almost gone" messages that occur when
casting spells.  One matches up with yesterday's change for when you can
re-read a spellbook to reinforce memory of a known spell.

     When "too hungry", you can't cast any spells, except detect food so
that you can find something to eat.  When "too weak" you couldn't cast any
spells at all; now you can cast restore ability so that you can recover
lost strength.  [We still need to come up with a better crowning bonus for
monks than spellbook of restore ability.]  I couldn't think of a reasonable
exception for the "can't cast when carrying too much" restriction.  If we
can come up with one (levitation?), then remove curse could/should become
an exception for the "no free hands" restriction.

include/hack.h
include/spell.h
src/spell.c

index d3e18222350defc1331c11dba0621e03b42425ac..cd37508bf319848ef117b7c0b2360c06c895c3b4 100644 (file)
@@ -85,9 +85,6 @@
 #define CXN_ARTICLE     8      /* include a/an/the prefix */
 #define CXN_NOCORPSE   16      /* suppress " corpse" suffix */
 
-/* spellbook re-use control; used when reading and when polymorphing */
-#define MAX_SPELL_STUDY 3
-
 /*
  * This is the way the game ends.  If these are rearranged, the arrays
  * in end.c and topten.c will need to be changed.  Some parts of the
@@ -163,8 +160,6 @@ NEARDATA extern coord bhitpos;      /* place where throw or zap hits or stops */
 #include "extern.h"
 #endif /* USE_TRAMPOLI */
 
-#define NO_SPELL       0
-
 /* flags to control makemon() */
 #define NO_MM_FLAGS      0x00000       /* use this rather than plain 0 */
 #define NO_MINVENT       0x00001       /* suppress minvent when creating mon */
index 807ed9731db30cc954ceae170dfb8e14f7c4c13d..26a9fc9de8031fd33edc7aeecbae3b5d1e284a89 100644 (file)
@@ -1,10 +1,15 @@
-/*     SCCS Id: @(#)spell.h    3.5     1995/06/01      */
+/*     SCCS Id: @(#)spell.h    3.5     2006/02/11      */
 /* Copyright 1986, M. Stephenson                                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #ifndef SPELL_H
 #define SPELL_H
 
+#define NO_SPELL       0
+
+/* spellbook re-use control; used when reading and when polymorphing */
+#define MAX_SPELL_STUDY 3
+
 struct spell {
     short      sp_id;                  /* spell id (== object.otyp) */
     xchar      sp_lev;                 /* power level */
index b161c78c9448044d182c779b392691c32331cb18..a9a961727d46c05188f90a7a3b7c5a21e31ed5ab 100644 (file)
@@ -772,17 +772,21 @@ boolean atme;
            pline("It invokes nightmarish images in your mind...");
            spell_backfire(spell);
            return(0);
-       } else if (spellknow(spell) <= 100) {
+       } else if (spellknow(spell) <= KEEN / 200) {    /* 100 turns left */
            You("strain to recall the spell.");
-       } else if (spellknow(spell) <= 1000) {
+       } else if (spellknow(spell) <= KEEN / 40) {     /* 500 turns left */
+           You("have difficulty remembering the spell.");
+       } else if (spellknow(spell) <= KEEN / 20) {     /* 1000 turns left */
            Your("knowledge of this spell is growing faint.");
+       } else if (spellknow(spell) <= KEEN / 10) {     /* 2000 turns left */
+           Your("recall of this spell is gradually fading.");
        }
        energy = (spellev(spell) * 5);    /* 5 <= energy <= 35 */
 
        if (u.uhunger <= 10 && spellid(spell) != SPE_DETECT_FOOD) {
                You("are too hungry to cast that spell.");
                return(0);
-       } else if (ACURR(A_STR) < 4 {
+       } else if (ACURR(A_STR) < 4 && spellid(spell) != SPE_RESTORE_ABILITY) {
                You("lack the strength to cast spells.");
                return(0);
        } else if(check_capacity(