]> granicus.if.org Git - nethack/commitdiff
chain summoning
authorarromdee <arromdee>
Tue, 9 Jul 2002 07:10:21 +0000 (07:10 +0000)
committerarromdee <arromdee>
Tue, 9 Jul 2002 07:10:21 +0000 (07:10 +0000)
This adds a further throttle to chain summoning.  Monsters can only summon
spellcasting nasties if the nasties are lower level than the summoner, which
makes infinite chains impossible (as long as the player figures out which
monster to kill first).

doc/fixes34.1
src/wizard.c

index fbdb029d3d5587e7362370adf4b883cce58efa73..c1629c293a0e4a9211835b9c72221bb33397afcd 100644 (file)
@@ -54,7 +54,7 @@ avoid dmonsfree impossible message due to migrating a dead monster via
 avoid temporary disappearing Burdened message due to updating status line
        midway thru in_container
 don't credit player's wisdom when makelevel creates random Elbereth engravings
-reduce insect/monster creation from monster spells
+reduce insect/monster creation from monster spells and limit chain summons
 avoid "couldn't place lregion type 5" warning when arriving at Plane of Fire
 avoid crash due to delayed poly or were change no longer being valid
 ensure that Priest's ability to recognize B/U/C is considered in B/U/C menus
index 01d5941ac659ee625ae91ce3b90f90fe0b427ee7..e357234155211cb53a47185d196ac51a182ba311 100644 (file)
@@ -10,6 +10,8 @@
 #include "hack.h"
 #include "qtext.h"
 
+extern const int monstr[];
+
 #ifdef OVLB
 
 STATIC_DCL short FDECL(which_arti, (int));
@@ -435,10 +437,19 @@ nasty(mcast)
        bypos.y = u.uy;
        for(i = rnd(tmp); i > 0; --i)
            for(j=0; j<20; j++) {
+               int makeindex;
+
                if (mcast &&
                        !enexto(&bypos, mcast->mux, mcast->muy, mcast->data))
                    continue;
-               if ((mtmp = makemon(&mons[pick_nasty()],
+               /* Don't create more spellcasters of the monsters' level or
+                * higher--avoids chain summoners filling up the level.
+                */
+               do {
+                   makeindex = pick_nasty();
+               } while(mcast && attacktype(&mons[makeindex], AT_MAGC) &&
+                       monstr[makeindex] >= monstr[mcast->mnum]);
+               if ((mtmp = makemon(&mons[makeindex],
                                    bypos.x, bypos.y, NO_MM_FLAGS)) != 0) {
                    mtmp->msleeping = mtmp->mpeaceful = mtmp->mtame = 0;
                    set_malign(mtmp);