diff --git a/doc/fixes37.0 b/doc/fixes37.0 index a96f261e5..2921d7b88 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.17 $ $NHDT-Date: 1575542023 2019/12/05 10:33:43 $ +$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.19 $ $NHDT-Date: 1575755075 2019/12/07 21:44:35 $ General Fixes and Modified Features ----------------------------------- @@ -40,6 +40,7 @@ split off some of the functionality that was in makedefs (compiled-in options and accessed on the target platform replace quest.txt and associated conversion to quest.dat via makedefs with lua quest texts loaded at runtime +some altars are displayed in different colors (for tty and curses at least) Platform- and/or Interface-Specific New Features diff --git a/src/mapglyph.c b/src/mapglyph.c index 082186df6..bc7e4f727 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mapglyph.c $NHDT-Date: 1573943501 2019/11/16 22:31:41 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.51 $ */ +/* NetHack 3.6 mapglyph.c $NHDT-Date: 1575755075 2019/12/07 21:44:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.58 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -138,8 +138,52 @@ unsigned mgflags; if they use the same symbol and color is disabled */ } else if (!iflags.use_color && offset == S_lava && (g.showsyms[idx] == g.showsyms[S_pool + SYM_OFF_P] - || g.showsyms[idx] == g.showsyms[S_water + SYM_OFF_P])) { + || g.showsyms[idx] + == g.showsyms[S_water + SYM_OFF_P])) { special |= MG_BW_LAVA; + } else if (offset == S_altar && iflags.use_color) { + if ((Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) + && (levl[x][y].altarmask & AM_SHRINE)) { + /* high altar */ + color = CLR_BRIGHT_MAGENTA; + } else { + switch (levl[x][y].altarmask & AM_MASK) { +#if 0 /* + * On OSX with XTERM=xterm-color256 these render as + * white -> tty: gray, curses: ok + * gray -> both tty and curses: black + * black -> both tty and curses: blue + * red -> both tty and curses: ok. + * Since the colors have specific associations (mainly with + * the unicorns matched with each alignment), we shouldn't use + * scrambled colors and we don't have sufficient information + * to handle platform-specific variations. + */ + case AM_LAWFUL: /* 4 */ + color = CLR_WHITE; + break; + case AM_NEUTRAL: /* 2 */ + color = CLR_GRAY; + break; + case AM_CHAOTIC: /* 1 */ + color = CLR_BLACK; + break; +#else /* !0: TEMP? */ + case AM_LAWFUL: /* 4 */ + case AM_NEUTRAL: /* 2 */ + case AM_CHAOTIC: /* 1 */ + cmap_color(S_altar); /* gray */ + break; +#endif /* 0 */ + case AM_NONE: /* 0 */ + color = CLR_RED; + break; + default: /* 3, 5..7 -- shouldn't happen but 3 was possible + * prior to 3.6.3 (due to faulty sink polymorph) */ + color = NO_COLOR; + break; + } + } } else { cmap_color(offset); } diff --git a/src/pray.c b/src/pray.c index a2f667a29..0da0c2a23 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pray.c $NHDT-Date: 1573346192 2019/11/10 00:36:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.118 $ */ +/* NetHack 3.6 pray.c $NHDT-Date: 1575755077 2019/12/07 21:44:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.133 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1384,6 +1384,7 @@ dosacrifice() /* curse the lawful/neutral altar */ pline_The("altar is stained with %s blood.", g.urace.adj); levl[u.ux][u.uy].altarmask = AM_CHAOTIC; + newsym(u.ux, u.uy); /* in case Invisible to self */ angry_priest(); } else { struct monst *dmon; @@ -1640,15 +1641,16 @@ dosacrifice() a_gname()); if (rn2(8 + u.ulevel) > 5) { struct monst *pri; + boolean shrine; + You_feel("the power of %s increase.", u_gname()); exercise(A_WIS, TRUE); change_luck(1); - /* Yes, this is supposed to be &=, not |= */ - levl[u.ux][u.uy].altarmask &= AM_SHRINE; - /* the following accommodates stupid compilers */ - levl[u.ux][u.uy].altarmask = - levl[u.ux][u.uy].altarmask - | (Align2amask(u.ualign.type)); + shrine = on_shrine(); + levl[u.ux][u.uy].altarmask = Align2amask(u.ualign.type); + if (shrine) + levl[u.ux][u.uy].altarmask |= AM_SHRINE; + newsym(u.ux, u.uy); /* in case Invisible to self */ if (!Blind) pline_The("altar glows %s.", hcolor((u.ualign.type == A_LAWFUL)