--
des.level_init({ style="mazegrid", bg ="-" });
-des.level_flags("mazelevel", "noteleport")
+des.level_flags("mazelevel")
-- First part
des.map({ halign = "half-left", valign = "center", map = [[
---------------------
-- TODO FIXME: see baalz_fixup - the legs get removed currently.
-des.level_flags("mazelevel", "noteleport", "corrmaze")
+des.level_flags("mazelevel", "corrmaze")
-- the two pools are fakes used to mark spots which need special wall fixups
-- the two iron bars are eyes and spots to their left will be made diggable
des.map({ halign = "right", valign = "center", map = [[
-- NetHack may be freely redistributed. See license for details.
--
-des.level_flags("mazelevel", "noteleport", "shortsighted", "noflip")
+des.level_flags("mazelevel", "shortsighted", "noflip")
-- des.level_init(mines,'.','}',true,true,unlit,false)
des.level_init({ style = "swamp", lit = 0 });
-- guarantee at least one open spot to ensure successful stair placement
--
des.level_init({ style="mazegrid", bg ="-" });
-des.level_flags("mazelevel", "noteleport", "shortsighted")
+des.level_flags("mazelevel", "shortsighted")
-- A ghost town
des.map({ halign = "right", valign = "center", map = [[
.|....|....|....|..............|....|........
tipping your cap might get a response
special levels can be flipped horizontally and/or vertically
new special level initialization routine, "swamp"
+demon lords and princes suppress teleporting in Gehennom
Platform- and/or Interface-Specific New Features
/* ### teleport.c ### */
+E boolean FDECL(noteleport_level, (struct monst *));
E boolean FDECL(goodpos, (int, int, struct monst *, unsigned));
E boolean FDECL(enexto, (coord *, XCHAR_P, XCHAR_P, struct permonst *));
E boolean FDECL(enexto_core, (coord *, XCHAR_P, XCHAR_P,
if (mon->mx != x || mon->my != y) {
(void) unmap_invisible(x, y);
pline("%s %s, %s evading your %skick.", Monnam(mon),
- (!g.level.flags.noteleport && can_teleport(mon->data))
+ (can_teleport(mon->data) && !noteleport_level(mon))
? "teleports"
: is_floater(mon->data)
? "floats"
/* some monsters teleport */
if (mtmp->mflee && !rn2(40) && can_teleport(mdat) && !mtmp->iswiz
- && !g.level.flags.noteleport) {
+ && !noteleport_level(mtmp)) {
(void) rloc(mtmp, TRUE);
return 0;
}
if (is_minion(ptr) || is_rider(ptr))
flag |= ALLOW_SANCT;
/* unicorn may not be able to avoid hero on a noteleport level */
- if (is_unicorn(ptr) && !g.level.flags.noteleport)
+ if (is_unicorn(ptr) && !noteleport_level(mtmp))
flag |= NOTONL;
if (passes_walls(ptr))
flag |= (ALLOW_WALL | ALLOW_ROCK);
if (!mtmp->mpeaceful && g.level.flags.shortsighted
&& nidist > (couldsee(nix, niy) ? 144 : 36) && appr == 1)
appr = 0;
- if (is_unicorn(ptr) && g.level.flags.noteleport) {
+ if (is_unicorn(ptr) && noteleport_level(mtmp)) {
/* on noteleport levels, perhaps we cannot avoid hero */
for (i = 0; i < cnt; i++)
if (!(info[i] & NOTONL))
* 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))
&& (!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;
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;
}
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;
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;
static boolean FDECL(rloc_pos_ok, (int, int, struct monst *));
static void FDECL(mvault_tele, (struct monst *));
+/* teleporting is prevented on this level for this monster? */
+boolean
+noteleport_level(mon)
+struct monst *mon;
+{
+ struct monst *mtmp;
+
+ /* demon court in Gehennom prevent others from teleporting */
+ if (In_hell(&u.uz) && !(is_dlord(mon->data) || is_dprince(mon->data)))
+ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
+ if (is_dlord(mtmp->data) || is_dprince(mtmp->data))
+ return TRUE;
+
+ /* natural no-teleport level */
+ if (g.level.flags.noteleport)
+ return TRUE;
+
+ return FALSE;
+}
+
/*
* Is (x,y) a good position of mtmp? If mtmp is NULL, then is (x,y) good
* for an object?
boolean result = FALSE; /* don't learn scroll */
/* Disable teleportation in stronghold && Vlad's Tower */
- if (g.level.flags.noteleport) {
+ if (noteleport_level(&g.youmonst)) {
if (!wizard) {
pline("A mysterious force prevents you from teleporting!");
return TRUE;
tele_restrict(mon)
struct monst *mon;
{
- if (g.level.flags.noteleport) {
+ if (noteleport_level(mon)) {
if (canseemon(mon))
pline("A mysterious force prevents %s from teleporting!",
mon_nam(mon));
if (give_feedback)
pline("%s resists your magic!", Monnam(mtmp));
return FALSE;
- } else if (g.level.flags.noteleport && u.uswallow && mtmp == u.ustuck) {
+ } else if (u.uswallow && mtmp == u.ustuck && noteleport_level(mtmp)) {
if (give_feedback)
You("are no longer inside %s!", mon_nam(mtmp));
unstuck(mtmp);
if ((Teleportation || can_teleport(g.youmonst.data)) && !Unaware
&& (Teleport_control || rn2(3) < Luck + 2)) {
You("attempt a teleport spell."); /* utcsri!carroll */
- if (!g.level.flags.noteleport) {
+ if (!noteleport_level(&g.youmonst)) {
(void) dotele(FALSE);
if (!is_pool(u.ux, u.uy))
return TRUE;