Monsters "remember" noteleport levels

... 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.
This commit is contained in:
Pasi Kallinen
2022-08-11 08:43:37 +03:00
parent c855b04a57
commit 649fc7f9b3

View 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)))) {