Demon lords and princes suppress teleporting in Gehennom

Instead of having the demon lair levels unconditionally no-teleport,
grant demon lords and princes the ability to suppress teleportation
in Gehennom on the level they are on.
This commit is contained in:
Pasi Kallinen
2020-02-26 19:55:53 +02:00
parent 816079c8dd
commit d86b7e8e7c
11 changed files with 39 additions and 17 deletions

View File

@@ -546,7 +546,7 @@ struct monst *mtmp;
* mean if the monster leaves the level, they'll know
* about teleport traps.
*/
if (!g.level.flags.noteleport
if (!noteleport_level(mtmp)
|| !(mtmp->mtrapseen & (1 << (TELEP_TRAP - 1)))) {
g.m.defensive = obj;
g.m.has_defense = (mon_has_amulet(mtmp))
@@ -560,7 +560,7 @@ struct monst *mtmp;
&& (!obj->cursed || (!(mtmp->isshk && inhishop(mtmp))
&& !mtmp->isgd && !mtmp->ispriest))) {
/* see WAN_TELEPORTATION case above */
if (!g.level.flags.noteleport
if (!noteleport_level(mtmp)
|| !(mtmp->mtrapseen & (1 << (TELEP_TRAP - 1)))) {
g.m.defensive = obj;
g.m.has_defense = MUSE_SCR_TELEPORTATION;
@@ -673,7 +673,7 @@ struct monst *mtmp;
if (vismon && how) /* mentions 'teleport' */
makeknown(how);
/* monster learns that teleportation isn't useful here */
if (g.level.flags.noteleport)
if (noteleport_level(mtmp))
mtmp->mtrapseen |= (1 << (TELEP_TRAP - 1));
return 2;
}
@@ -692,7 +692,7 @@ struct monst *mtmp;
g.m_using = TRUE;
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
/* monster learns that teleportation isn't useful here */
if (g.level.flags.noteleport)
if (noteleport_level(mtmp))
mtmp->mtrapseen |= (1 << (TELEP_TRAP - 1));
g.m_using = FALSE;
return 2;
@@ -1016,7 +1016,7 @@ struct monst *mtmp;
switch (rn2(8 + (difficulty > 3) + (difficulty > 6) + (difficulty > 8))) {
case 6:
case 9:
if (g.level.flags.noteleport && ++trycnt < 2)
if (noteleport_level(mtmp) && ++trycnt < 2)
goto try_again;
if (!rn2(3))
return WAN_TELEPORTATION;