From: PatR Date: Sat, 11 Jun 2022 18:38:52 +0000 (-0700) Subject: monsters less likely to dig in Sokoban X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad3aa545dc2144982aaa2aefbfe6e824717f58a7;p=nethack monsters less likely to dig in Sokoban Make monsters being created in Sokoban that are given a random defensive item be less likely to receive a wand of digging. Should result in fewer extra holes needing to be plugged. Resurrected from an old stash entry. I have no recollection of why I didn't consider it to be ready for prime time way back then. --- diff --git a/src/muse.c b/src/muse.c index 9d36506e7..a82aa92fb 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 muse.c $NHDT-Date: 1646688066 2022/03/07 21:21:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.159 $ */ +/* NetHack 3.7 muse.c $NHDT-Date: 1654972707 2022/06/11 18:38:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.164 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -1095,11 +1095,14 @@ rnd_defensive_item(struct monst* mtmp) case 5: return (mtmp->data != &mons[PM_PESTILENCE]) ? POT_FULL_HEALING : POT_SICKNESS; - case 7: + case 7: /* wand of digging */ + /* usually avoid digging in Sokoban */ + if (Sokoban && rn2(4)) + goto try_again; + /* some creatures shouldn't dig down to another level when hurt */ if (is_floater(pm) || mtmp->isshk || mtmp->isgd || mtmp->ispriest) return 0; - else - return WAN_DIGGING; + return WAN_DIGGING; } /*NOTREACHED*/ return 0;