From: nethack.rankin Date: Sun, 12 Feb 2006 06:24:25 +0000 (+0000) Subject: couple of spell bits (trunk only) X-Git-Tag: MOVE2GIT~1122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=458c90fd7efc34a24e4ce38a00e3c9f530b3f7b4;p=nethack couple of spell bits (trunk only) 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. --- diff --git a/include/hack.h b/include/hack.h index d3e182223..cd37508bf 100644 --- a/include/hack.h +++ b/include/hack.h @@ -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 */ diff --git a/include/spell.h b/include/spell.h index 807ed9731..26a9fc9de 100644 --- a/include/spell.h +++ b/include/spell.h @@ -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 */ diff --git a/src/spell.c b/src/spell.c index b161c78c9..a9a961727 100644 --- a/src/spell.c +++ b/src/spell.c @@ -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(