Designate high altars with dedicated altarmask bit
High altars and normal temple altars had identical altarmasks, so there was no way to distinguish between the two based on the altarmask alone. Instead, anywhere it was necessary to determine whether an altar was a high altar included a check whether the hero was currently the Astral Plane or Moloch's Sanctum, and assumed any temple altar was the high altar. Since there's an extra, unused bit in altarmask anyway, use it to explicitly mark high altars -- the lua level files already distinguish between normal temple altars and so-called 'sanctum' altars anyway, so rather than throwing away this distinction when generating the level, keep it in the altarmask and use it in place of various u.uz checks. I think this would require incrementing EDITLEVEL again...
This commit is contained in:
@@ -3989,10 +3989,7 @@ dfeature_at(int x, int y, char *buf)
|
||||
cmap = S_sink; /* "sink" */
|
||||
else if (IS_ALTAR(ltyp)) {
|
||||
Sprintf(altbuf, "%saltar to %s (%s)",
|
||||
((lev->altarmask & AM_SHRINE)
|
||||
&& (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)))
|
||||
? "high "
|
||||
: "",
|
||||
(lev->altarmask & AM_SANCTUM) ? "high " : "",
|
||||
a_gname(),
|
||||
align_str(Amask2align(lev->altarmask & ~AM_SHRINE)));
|
||||
dfeature = altbuf;
|
||||
|
||||
@@ -292,12 +292,10 @@ do_earthquake(int force)
|
||||
pline_The("kitchen sink falls%s.", into_a_chasm);
|
||||
goto do_pit;
|
||||
case ALTAR:
|
||||
/* always preserve the high altars */
|
||||
if (Is_astralevel(&u.uz) || Is_sanctum(&u.uz))
|
||||
break;
|
||||
/* no need to check for high altar here; we've just
|
||||
excluded those */
|
||||
amsk = altarmask_at(x, y);
|
||||
/* always preserve the high altars */
|
||||
if ((amsk & AM_SANCTUM) != 0)
|
||||
break;
|
||||
algn = Amask2align(amsk & AM_MASK);
|
||||
if (cansee(x, y))
|
||||
pline_The("%s altar falls%s.",
|
||||
|
||||
@@ -619,13 +619,11 @@ lookat(int x, int y, char *buf, char *monbuf)
|
||||
Sprintf(buf, "%s %saltar",
|
||||
/* like endgame high priests, endgame high altars
|
||||
are only recognizable when immediately adjacent */
|
||||
(Is_astralevel(&u.uz) && !next2u(x, y))
|
||||
(Is_astralevel(&u.uz) && !next2u(x, y)
|
||||
&& (amsk & AM_SANCTUM))
|
||||
? "aligned"
|
||||
: align_str(algn),
|
||||
((amsk & AM_SHRINE) != 0
|
||||
&& (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)))
|
||||
? "high "
|
||||
: "");
|
||||
(amsk & AM_SANCTUM) ? "high " : "");
|
||||
break;
|
||||
case S_ndoor:
|
||||
if (is_drawbridge_wall(x, y) >= 0)
|
||||
|
||||
@@ -1468,8 +1468,7 @@ dosacrifice(void)
|
||||
You("are not standing on an altar.");
|
||||
return ECMD_OK;
|
||||
}
|
||||
highaltar = ((Is_astralevel(&u.uz) || Is_sanctum(&u.uz))
|
||||
&& (levl[u.ux][u.uy].altarmask & AM_SHRINE));
|
||||
highaltar = (levl[u.ux][u.uy].altarmask & AM_SANCTUM);
|
||||
|
||||
otmp = floorfood("sacrifice", 1);
|
||||
if (!otmp)
|
||||
|
||||
@@ -2330,6 +2330,8 @@ create_altar(altar* a, struct mkroom* croom)
|
||||
if (a->shrine) { /* Is it a shrine or sanctum? */
|
||||
priestini(&u.uz, croom, x, y, (a->shrine > 1));
|
||||
levl[x][y].altarmask |= AM_SHRINE;
|
||||
if (a->shrine == 2) /* high altar or sanctum */
|
||||
levl[x][y].altarmask |= AM_SANCTUM;
|
||||
g.level.flags.has_temple = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user