high level monster spell casting (trunk only)

Mage-spell casters higher than level 23 and cleric-spell casters
higher than level 13 became less and less likely to cast interesting
spells as level went higher, more and more likely to cast the default
psi-bolt or open wounds.  [Level 21 caster had 4.75% chance to cast
touch of death; level 22, 9%; level 23, 13% chance; then level 24, 12.5%;
level 25, 12%; level 30, 10%; level 50 (demon lords/princes), only 6%.]
This oddity in spell selection meant that the Wizard of Yendor gradually
became less likely to use "double trouble" to clone himself as he got
killed off more times and his next incarnation arrived at higher level.
This fix makes high level casters who pick too-high spell usually retry
until they get a valid one instead of just reverting to the default.
Still slightly biased towards psi-bolt and open wounds, since they're
effective even though a bit boring.
This commit is contained in:
nethack.rankin
2011-03-15 02:25:28 +00:00
parent 47e80eb78c
commit fa94c173af
2 changed files with 16 additions and 1 deletions

View File

@@ -348,6 +348,8 @@ enhance life-saving by preventing subsequent poison from being fatal upon
don't create mail daemons when populating special levels with random demons
teleport control and polymorph control are ineffective while hero is stunned
don't report "fried to a crisp" for disintegration from divine wrath
spellcasting monsters' spell selection became less likely to choose harder
spells as their level got higher (including Wizard's "double trouble")
Platform- and/or Interface-Specific Fixes

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 mcastu.c $Date$ $Revision$ */
/* SCCS Id: @(#)mcastu.c 3.5 2005/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -76,7 +75,14 @@ STATIC_OVL int
choose_magic_spell(spellval)
int spellval;
{
/* for 3.4.3 and earlier, val greater than 22 selected the default spell */
while (spellval > 24 && rn2(25)) spellval = rn2(spellval);
switch (spellval) {
case 24:
case 23:
if (Antimagic || Hallucination) return MGC_PSI_BOLT;
/* else FALL THROUGH */
case 22:
case 21:
case 20:
@@ -121,7 +127,14 @@ STATIC_OVL int
choose_clerical_spell(spellnum)
int spellnum;
{
/* for 3.4.3 and earlier, num greater than 13 selected the default spell */
while (spellnum > 15 && rn2(16)) spellnum = rn2(spellnum);
switch (spellnum) {
case 15:
case 14:
if (rn2(3)) return CLC_OPEN_WOUNDS;
/* else FALL THROUGH */
case 13:
return CLC_GEYSER;
case 12: