]> granicus.if.org Git - nethack/commitdiff
high level monster spell casting (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 15 Mar 2011 02:25:28 +0000 (02:25 +0000)
committernethack.rankin <nethack.rankin>
Tue, 15 Mar 2011 02:25:28 +0000 (02:25 +0000)
     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.

doc/fixes35.0
src/mcastu.c

index f28312985e0f21dbeda5677ed4356303169c5f0e..f1095ecde65248516ba2cbab07c17f634811c8d7 100644 (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
index 1f049120c522a2a82459d02e8de1dd94a22ca7ba..dc02b28a921c975e2a7f235ff5cf3d535e43264b 100644 (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: