]> granicus.if.org Git - nethack/commitdiff
Monsters "remember" noteleport levels
authorPasi Kallinen <paxed@alt.org>
Thu, 11 Aug 2022 05:43:37 +0000 (08:43 +0300)
committerPasi Kallinen <paxed@alt.org>
Thu, 11 Aug 2022 05:43:40 +0000 (08:43 +0300)
... using the same hack when zapping themselves: If the level is
no-teleport, the monster will learn of teleport traps, and if
it knows about them, won't try using teleportation again.

src/muse.c

index 49ac4940dc350f8fbad16e17b3b547d582208355..61674e19df3f52bed68d3c9fd4daf15a6534cf1e 100644 (file)
@@ -1289,6 +1289,9 @@ find_offensive(struct monst* mtmp)
         if (obj->otyp == WAN_TELEPORTATION && obj->spe > 0
             /* don't give controlled hero a free teleport */
             && !Teleport_control
+            /* same hack as MUSE_WAN_TELEPORTATION_SELF */
+            && (!noteleport_level(mtmp)
+                || !(mtmp->mtrapseen & (1 << (TELEP_TRAP - 1))))
             /* do try to move hero to a more vulnerable spot */
             && (onscary(u.ux, u.uy, mtmp)
                 || (stairway_at(u.ux, u.uy)))) {