add glyphs+tiles for door+chest traps

When trap detection finds trapped doors and trapped chests, it shows
those as bear traps.  When the hero comes within view, they revert to
normal and the detected trap is forgotten.  This doesn't change that,
it is just groundwork to be able to show them distinctly.  Like the
TT_BEARTRAP patch, it increments EDITLEVEL so this seemed like a good
time to put the groudwork in place.

There shouldn't be any visible changes even though internal glyph and
tile values have been renumbered after inserting two new entries.
Adding traps after S_vibrating_square was quite a hassle and suffered
though a couple of off-by-one errors that weren't trivial to find and
fix.
This commit is contained in:
PatR
2022-04-27 11:22:12 -07:00
parent d194459c7d
commit d1217b9f25
13 changed files with 294 additions and 225 deletions

View File

@@ -404,8 +404,8 @@ enum glyphmap_change_triggers { gm_nochange, gm_newgame, gm_levelchange,
* Altars Altar (unaligned, chaotic, neutral, lawful, other)
* Count: 5
*
* cmap B S_grave through S_vibrating_square
* Count: (S_vibrating_square - S_grave) + 1 = 37
* cmap B S_grave through S_arrow_trap + TRAPNUM - 1
* Count: (S_arrow_trap + (TRAPNUM - 1) - S_grave) = 39
*
* zap beams set of four (there are four directions) HI_ZAP.
* Count: 4 * NUM_ZAP
@@ -497,7 +497,9 @@ enum glyph_offsets {
GLYPH_CMAP_A_OFF = (((S_trwall - S_vwall) + 1) + GLYPH_CMAP_SOKO_OFF),
GLYPH_ALTAR_OFF = (((S_brdnladder - S_ndoor) + 1) + GLYPH_CMAP_A_OFF),
GLYPH_CMAP_B_OFF = (5 + GLYPH_ALTAR_OFF),
GLYPH_ZAP_OFF = (((S_vibrating_square - S_grave) + 1) + GLYPH_CMAP_B_OFF),
/* (46 + (26 - 1)- 32 ) == 39 */
GLYPH_ZAP_OFF = ((S_arrow_trap + MAXTCHARS - S_grave)
+ GLYPH_CMAP_B_OFF),
GLYPH_CMAP_C_OFF = ((NUM_ZAP << 2) + GLYPH_ZAP_OFF),
GLYPH_SWALLOW_OFF = (((S_goodpos - S_digbeam) + 1) + GLYPH_CMAP_C_OFF),
GLYPH_EXPLODE_OFF = ((NUMMONS << 3) + GLYPH_SWALLOW_OFF),
@@ -932,7 +934,7 @@ enum glyph_offsets {
(GLYPH_CMAP_B_OFF + (S_arrow_trap - S_grave))
#define glyph_is_trap(glyph) \
((glyph) >= (GLYPH_TRAP_OFF) && \
(glyph) < ((GLYPH_TRAP_OFF) + (TRAPNUM - 1)))
(glyph) < ((GLYPH_TRAP_OFF) + MAXTCHARS))
#define glyph_is_warning(glyph) \
((glyph) >= GLYPH_WARNING_OFF \
&& (glyph) < (GLYPH_WARNING_OFF + WARNCOUNT))