diff --git a/include/extern.h b/include/extern.h index 4cbb92639..111ee870e 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2713,7 +2713,6 @@ E int NDECL (num_spells); E void NDECL(dump_spells); E void FDECL(cast_sphere, (short otyp)); E void NDECL(spell_nag); -E boolean NDECL(max_spells_learned); /* ### steal.c ### */ diff --git a/src/pray.c b/src/pray.c index 01691ab99..69b1fcc49 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1474,9 +1474,8 @@ aligntyp g_align; otmp->material = objects[otmp->otyp].oc_material; otmp->owt = weight(otmp); } - if (!u.uconduct.literate && !max_spells_learned() - && otmp->otyp != SPE_BLANK_PAPER - && !known_spell(otmp->otyp)) { + if (!u.uconduct.literate && (otmp->otyp != SPE_BLANK_PAPER) + && !known_spell(otmp->otyp)) { if (force_learn_spell(otmp->otyp)) pline("Divine knowledge of %s fills your mind!", OBJ_NAME(objects[otmp->otyp])); diff --git a/src/spell.c b/src/spell.c index 18f63f316..310853130 100644 --- a/src/spell.c +++ b/src/spell.c @@ -17,9 +17,6 @@ #define CAST_BOOST 500 /* memory increase for successful casting */ #define REINFORCE_BOOST 10000 /* memory increase for reinforce memory */ #define MAX_KNOW 70000 /* Absolute Max timeout */ -/* Most spells a player can learn */ -#define SPELL_LIMIT ((ACURR(A_WIS) + ACURR(A_INT) + 5) \ - / (primary_caster() ? (Role_if(PM_WIZARD) ? 3 : 4) : 12)) /* x: need to add 1 when used for reading a spellbook rather than for hero initialization; spell memory is decremented at the end of each turn, @@ -52,7 +49,6 @@ STATIC_DCL char *FDECL(spellretention, (int, char *)); STATIC_DCL int NDECL(throwspell); STATIC_DCL void FDECL(spell_backfire, (int)); STATIC_DCL boolean FDECL(spell_aim_step, (genericptr_t, int, int)); -STATIC_DCL boolean NDECL(primary_caster); static const char clothes[] = { ARMOR_CLASS, 0 }; @@ -372,15 +368,6 @@ learn(VOID_ARGS) boolean costly = TRUE; struct obj *book = context.spbook.book; - if (max_spells_learned()) { - if (ACURR(A_INT) == AMAX(A_INT) - && ACURR(A_WIS) == AMAX(A_WIS)) - You("are not capable of learning any new spells (right now)."); - else - You("are not capable of learning any new spells."); - return 0; - } - /* JDS: lenses give 50% faster reading; 33% smaller read time */ if (context.spbook.delay && ublindf && ublindf->otyp == LENSES && rn2(2)) context.spbook.delay++; @@ -2063,7 +2050,7 @@ int spell; int difficulty; int skill; int dex_adjust; - boolean paladin_bonus, is_spellcaster, non_casters; + boolean paladin_bonus, primary_casters, non_casters; /* Calculate intrinsic ability (splcaster) */ @@ -2096,8 +2083,14 @@ int spell; paladin_bonus = Role_if(PM_KNIGHT) && spell_skilltype(spellid(spell)) == P_ENCHANTMENT_SPELL; /* Casting roles */ - is_spellcaster = primary_caster(); - + primary_casters = (Role_if(PM_HEALER) + || Role_if(PM_PRIEST) + || Role_if(PM_FLAME_MAGE) + || Role_if(PM_ICE_MAGE) + || Role_if(PM_NECROMANCER) + || Role_if(PM_WIZARD) + || Role_if(PM_INFIDEL)); + non_casters = (Role_if(PM_ARCHEOLOGIST) || Role_if(PM_BARBARIAN) || Role_if(PM_CAVEMAN) @@ -2276,7 +2269,7 @@ int spell; && !is_robe(uarm)) { #define PENALTY_NON_CASTER (spellev(spell) * 10) #define PENALTY_PRI_CASTER (spellev(spell) * 10) - 30 - if (is_spellcaster && spellev(spell) >= 4) + if (primary_casters && spellev(spell) >= 4) chance -= PENALTY_PRI_CASTER; if (non_casters) chance -= PENALTY_NON_CASTER; @@ -2515,23 +2508,6 @@ spell_nag() Your("%s spell is fading!", spellname(i)); } } -} -STATIC_OVL boolean -primary_caster() { - return (Role_if(PM_HEALER) - || Role_if(PM_PRIEST) - || Role_if(PM_FLAME_MAGE) - || Role_if(PM_ICE_MAGE) - || Role_if(PM_NECROMANCER) - || Role_if(PM_WIZARD) - || Role_if(PM_INFIDEL)); -} - -boolean -max_spells_learned() -{ - return num_spells() >= SPELL_LIMIT; } - /*spell.c*/