sym-changes - add engravings to the map

1. Add "engraved room floor" pchar sym (S_engroom). The symbol that
displays at the engraved part of a room (not a corridor though).
The default symbol is '`' which is currently never shown if people
have defined the boulder symbol to '0' and statues are displayed as
monster symbols. It is bright blue.

Add some stylized variations of the S_engroom symset to some of
the symsets.

2. Add "engraved corridor" pchar sym (S_engrcorr). The symbol that
displays at the engraved part of a corridor. The default symbol is
'#', and it matches the symbol for corridor from for whatever the
current symset uses. It is bright blue to match the color of the
S_engroom symbol. Using the normal corridor symbol for display
preserves the lines of the corridor so is not as visually-disruptive
as a smaller symbol would be. Explicit entries that match the S_corr
symbol have been added to the symset file.

Magic mapping and clairvoyance impacts yet to be determined.

The Guidebook updates will come later.
This commit is contained in:
nhmall
2023-03-05 17:35:49 -05:00
parent 0b5956ba34
commit 32ca917d2c
11 changed files with 540 additions and 337 deletions

View File

@@ -251,11 +251,13 @@ start: IBMgraphics
S_ndoor: \xfa # meta-z, centered dot
S_vodoor: \xfe # meta-~, small centered square
S_hodoor: \xfe # meta-~, small centered square
S_engroom: \xee # epsilon
S_bars: \xf0 # equivalence symbol
S_tree: \xf1 # plus or minus symbol
S_room: \xfa # meta-z, centered dot
S_corr: \xb0 # meta-0, light shading
S_litcorr: \xb1 # meta-1, medium shading
S_engrcorr: \xb0 # meta-0, light shading
S_fountain: \xf4 # meta-t, integral top half
S_sink: \xf4 # meta-t, integral top half
S_pool: \xf7 # meta-w, approx. equals
@@ -287,6 +289,7 @@ start: IBMGraphics_1
S_tdwall: \xc2 # meta-B, T down
S_tlwall: \xb4 # meta-4, T left
S_trwall: \xc3 # meta-C, T right
S_engroom: \xee # epsilon
S_vbeam: \xb3 # meta-3, vertical rule
S_hbeam: \xc4 # meta-D, horizontal rule
S_sw_ml: \xb3 # meta-3, vertical rule
@@ -311,8 +314,10 @@ start: IBMGraphics_2
S_trwall: \xc3 # meta-C, T right
S_vodoor: \xfe # meta-~, small centered square
S_hodoor: \xfe # meta-~, small centered square
S_engroom: \xee # epsilon
S_corr: \xb0 # meta-0, light shading
S_litcorr: \xb1 # meta-1, medium shading
S_engrcorr: \xb0 # meta-0, light shading
S_vbeam: \xb3 # meta-3, vertical rule
S_hbeam: \xc4 # meta-D, horizontal rule
S_sw_ml: \xb3 # meta-3, vertical rule
@@ -348,6 +353,7 @@ start: RogueIBM
S_room: \xfa # centered dot
S_corr: \xb1
S_litcorr: \xb2
S_engrcorr: \xb1
S_upstair: \xf0 # Greek Xi
S_dnstair: \xf0
S_brupstair: \xf0 # Greek Xi
@@ -374,8 +380,10 @@ start: RogueEpyx
S_vodoor: \xce
S_hodoor: \xce
S_room: \xfa # centered dot
S_engroom: \xee # epsilon
S_corr: \xb1
S_litcorr: \xb2
S_engrcorr: \xb1
S_upstair: \xf0 # Greek Xi
S_dnstair: \xf0
S_brupstair: \xf0 # Greek Xi
@@ -452,8 +460,10 @@ start: RogueWindows
S_vodoor: \xce
S_hodoor: \xce
S_room: \xfa # centered dot
S_engroom: \xee # epsilon
S_corr: \xb1
S_litcorr: \xb2
S_engrcorr: \xb1
S_upstair: \xf0 # Greek Xi
S_dnstair: \xf0
S_brupstair: \xf0 # Greek Xi
@@ -479,8 +489,10 @@ start: curses
S_bars: \xfc # meta-|, not-equals sign (was '#')
S_tree: \xe7 # meta-g, plus or minus sign
S_room: \xfe # meta-z, centered dot
S_engroom: \xee # epsilon
S_corr: \xe1 # meta-a, solid block
S_litcorr: \xe1 # meta-a, solid block
S_engrcorr: \xe1 # meta-a, solid block
S_ice: \xfe # meta-z, centered dot
S_vodbridge: \xfe # meta-z, centered dot
S_hodbridge: \xfe # meta-z, centered dot
@@ -560,6 +572,7 @@ start: MACgraphics
S_bars: \xf0 # equivalency symbol
S_tree: \xf1 # plus-or-minus
S_corr: \xb0
S_engrcorr: \xb0
S_grave: \xef # same as open door
S_pool: \xe0
finish
@@ -585,6 +598,7 @@ start: Enhanced1
S_bars: U+2261 # IDENTICAL TO
S_tree: U+03a8 # GREEK CAPITAL LETTER PSI
S_room: U+00b7 # MIDDLE DOT
S_engroom: U+03BE # Greek Small Letter Xi
S_darkroom: U+00b7 # MIDDLE DOT
S_upladder: U+2264 # LESS-THAN OR EQUAL TO
S_dnladder: U+2265 # GREATER-THAN OR EQUAL TO

View File

@@ -113,70 +113,72 @@
PCHAR( 18, '#', S_tree, "tree", CLR(CLR_GREEN))
PCHAR( 19, '.', S_room, "floor of a room", CLR(CLR_GRAY))
PCHAR( 20, '.', S_darkroom, "dark part of a room", CLR(CLR_BLACK))
PCHAR2(21, '#', S_corr, "dark corridor", "corridor", CLR(CLR_GRAY))
PCHAR( 22, '#', S_litcorr, "lit corridor", CLR(CLR_GRAY))
PCHAR2(23, '<', S_upstair, "up stairs", "staircase up", CLR(CLR_GRAY))
PCHAR2(24, '>', S_dnstair, "down stairs", "staircase down", CLR(CLR_GRAY))
PCHAR2(25, '<', S_upladder, "up ladder", "ladder up", CLR(CLR_BROWN))
PCHAR2(26, '>', S_dnladder, "down ladder", "ladder down", CLR(CLR_BROWN))
PCHAR( 27, '<', S_brupstair, "branch staircase up", CLR(CLR_YELLOW))
PCHAR( 28, '>', S_brdnstair, "branch staircase down", CLR(CLR_YELLOW))
PCHAR( 29, '<', S_brupladder, "branch ladder up", CLR(CLR_YELLOW))
PCHAR( 30, '>', S_brdnladder, "branch ladder down", CLR(CLR_YELLOW))
PCHAR( 21, '`', S_engroom, "engraved part of a room", CLR(CLR_BRIGHT_BLUE))
PCHAR2(22, '#', S_corr, "dark corridor", "corridor", CLR(CLR_GRAY))
PCHAR( 23, '#', S_litcorr, "lit corridor", CLR(CLR_GRAY))
PCHAR( 24, '#', S_engrcorr, "engraved part of a corridor", CLR(CLR_BRIGHT_BLUE))
PCHAR2(25, '<', S_upstair, "up stairs", "staircase up", CLR(CLR_GRAY))
PCHAR2(26, '>', S_dnstair, "down stairs", "staircase down", CLR(CLR_GRAY))
PCHAR2(27, '<', S_upladder, "up ladder", "ladder up", CLR(CLR_BROWN))
PCHAR2(28, '>', S_dnladder, "down ladder", "ladder down", CLR(CLR_BROWN))
PCHAR( 29, '<', S_brupstair, "branch staircase up", CLR(CLR_YELLOW))
PCHAR( 30, '>', S_brdnstair, "branch staircase down", CLR(CLR_YELLOW))
PCHAR( 31, '<', S_brupladder, "branch ladder up", CLR(CLR_YELLOW))
PCHAR( 32, '>', S_brdnladder, "branch ladder down", CLR(CLR_YELLOW))
/* end cmap A */
PCHAR( 31, '_', S_altar, "altar", CLR(CLR_GRAY))
PCHAR( 33, '_', S_altar, "altar", CLR(CLR_GRAY))
/* start cmap B */
PCHAR( 32, '|', S_grave, "grave", CLR(CLR_WHITE))
PCHAR2(33, '\\', S_throne, "throne", "opulent throne", CLR(HI_GOLD))
PCHAR( 34, '{', S_sink, "sink", CLR(CLR_WHITE))
PCHAR( 35, '{', S_fountain, "fountain", CLR(CLR_BRIGHT_BLUE))
PCHAR2(36, '}', S_pool, "pool", "water", CLR(CLR_BLUE))
PCHAR( 37, '.', S_ice, "ice", CLR(CLR_CYAN))
PCHAR( 38, '}', S_lava, "molten lava", CLR(CLR_RED))
PCHAR( 39, '}', S_lavawall, "wall of lava", CLR(CLR_ORANGE))
PCHAR2(40, '.', S_vodbridge, "vertical open drawbridge",
PCHAR( 34, '|', S_grave, "grave", CLR(CLR_WHITE))
PCHAR2(35, '\\', S_throne, "throne", "opulent throne", CLR(HI_GOLD))
PCHAR( 36, '{', S_sink, "sink", CLR(CLR_WHITE))
PCHAR( 37, '{', S_fountain, "fountain", CLR(CLR_BRIGHT_BLUE))
PCHAR2(38, '}', S_pool, "pool", "water", CLR(CLR_BLUE))
PCHAR( 39, '.', S_ice, "ice", CLR(CLR_CYAN))
PCHAR( 40, '}', S_lava, "molten lava", CLR(CLR_RED))
PCHAR( 41, '}', S_lavawall, "wall of lava", CLR(CLR_ORANGE))
PCHAR2(42, '.', S_vodbridge, "vertical open drawbridge",
"lowered drawbridge", CLR(CLR_BROWN))
PCHAR2(41, '.', S_hodbridge, "horizontal open drawbridge",
PCHAR2(43, '.', S_hodbridge, "horizontal open drawbridge",
"lowered drawbridge", CLR(CLR_BROWN))
PCHAR2(42, '#', S_vcdbridge, "vertical closed drawbridge",
PCHAR2(44, '#', S_vcdbridge, "vertical closed drawbridge",
"raised drawbridge", CLR(CLR_BROWN))
PCHAR2(43, '#', S_hcdbridge, "horizontal closed drawbridge",
PCHAR2(45, '#', S_hcdbridge, "horizontal closed drawbridge",
"raised drawbridge", CLR(CLR_BROWN))
PCHAR( 44, ' ', S_air, "air", CLR(CLR_CYAN))
PCHAR( 45, '#', S_cloud, "cloud", CLR(CLR_GRAY))
PCHAR( 46, '}', S_water, "water", CLR(CLR_BLUE))
PCHAR( 46, ' ', S_air, "air", CLR(CLR_CYAN))
PCHAR( 47, '#', S_cloud, "cloud", CLR(CLR_GRAY))
PCHAR( 48, '}', S_water, "water", CLR(CLR_BLUE))
/* end dungeon characters */
/* */
/* begin traps */
/* */
PCHAR( 47, '^', S_arrow_trap, "arrow trap", CLR(HI_METAL))
PCHAR( 48, '^', S_dart_trap, "dart trap", CLR(HI_METAL))
PCHAR( 49, '^', S_falling_rock_trap, "falling rock trap", CLR(CLR_GRAY))
PCHAR( 50, '^', S_squeaky_board, "squeaky board", CLR(CLR_BROWN))
PCHAR( 51, '^', S_bear_trap, "bear trap", CLR(HI_METAL))
PCHAR( 52, '^', S_land_mine, "land mine", CLR(CLR_RED))
PCHAR( 53, '^', S_rolling_boulder_trap, "rolling boulder trap",
PCHAR( 49, '^', S_arrow_trap, "arrow trap", CLR(HI_METAL))
PCHAR( 50, '^', S_dart_trap, "dart trap", CLR(HI_METAL))
PCHAR( 51, '^', S_falling_rock_trap, "falling rock trap", CLR(CLR_GRAY))
PCHAR( 52, '^', S_squeaky_board, "squeaky board", CLR(CLR_BROWN))
PCHAR( 53, '^', S_bear_trap, "bear trap", CLR(HI_METAL))
PCHAR( 54, '^', S_land_mine, "land mine", CLR(CLR_RED))
PCHAR( 55, '^', S_rolling_boulder_trap, "rolling boulder trap",
CLR(CLR_GRAY))
PCHAR( 54, '^', S_sleeping_gas_trap, "sleeping gas trap", CLR(HI_ZAP))
PCHAR( 55, '^', S_rust_trap, "rust trap", CLR(CLR_BLUE))
PCHAR( 56, '^', S_fire_trap, "fire trap", CLR(CLR_ORANGE))
PCHAR( 57, '^', S_pit, "pit", CLR(CLR_BLACK))
PCHAR( 58, '^', S_spiked_pit, "spiked pit", CLR(CLR_BLACK))
PCHAR( 59, '^', S_hole, "hole", CLR(CLR_BROWN))
PCHAR( 60, '^', S_trap_door, "trap door", CLR(CLR_BROWN))
PCHAR( 61, '^', S_teleportation_trap, "teleportation trap",
PCHAR( 56, '^', S_sleeping_gas_trap, "sleeping gas trap", CLR(HI_ZAP))
PCHAR( 57, '^', S_rust_trap, "rust trap", CLR(CLR_BLUE))
PCHAR( 58, '^', S_fire_trap, "fire trap", CLR(CLR_ORANGE))
PCHAR( 59, '^', S_pit, "pit", CLR(CLR_BLACK))
PCHAR( 60, '^', S_spiked_pit, "spiked pit", CLR(CLR_BLACK))
PCHAR( 61, '^', S_hole, "hole", CLR(CLR_BROWN))
PCHAR( 62, '^', S_trap_door, "trap door", CLR(CLR_BROWN))
PCHAR( 63, '^', S_teleportation_trap, "teleportation trap",
CLR(CLR_MAGENTA))
PCHAR( 62, '^', S_level_teleporter, "level teleporter", CLR(CLR_MAGENTA))
PCHAR( 63, '^', S_magic_portal, "magic portal", CLR(CLR_BRIGHT_MAGENTA))
PCHAR( 64, '"', S_web, "web", CLR(CLR_GRAY))
PCHAR( 65, '^', S_statue_trap, "statue trap", CLR(CLR_GRAY))
PCHAR( 66, '^', S_magic_trap, "magic trap", CLR(HI_ZAP))
PCHAR2(67, '^', S_anti_magic_trap, "anti magic trap", "anti-magic field",
PCHAR( 64, '^', S_level_teleporter, "level teleporter", CLR(CLR_MAGENTA))
PCHAR( 65, '^', S_magic_portal, "magic portal", CLR(CLR_BRIGHT_MAGENTA))
PCHAR( 66, '"', S_web, "web", CLR(CLR_GRAY))
PCHAR( 67, '^', S_statue_trap, "statue trap", CLR(CLR_GRAY))
PCHAR( 68, '^', S_magic_trap, "magic trap", CLR(HI_ZAP))
PCHAR2(69, '^', S_anti_magic_trap, "anti magic trap", "anti-magic field",
CLR(HI_ZAP))
PCHAR( 68, '^', S_polymorph_trap, "polymorph trap", CLR(CLR_BRIGHT_GREEN))
PCHAR( 69, '~', S_vibrating_square, "vibrating square", CLR(CLR_MAGENTA))
PCHAR( 70, '^', S_trapped_door, "trapped door", CLR(CLR_ORANGE))
PCHAR( 71, '^', S_trapped_chest, "trapped chest", CLR(CLR_ORANGE))
PCHAR( 70, '^', S_polymorph_trap, "polymorph trap", CLR(CLR_BRIGHT_GREEN))
PCHAR( 71, '~', S_vibrating_square, "vibrating square", CLR(CLR_MAGENTA))
PCHAR( 72, '^', S_trapped_door, "trapped door", CLR(CLR_ORANGE))
PCHAR( 73, '^', S_trapped_chest, "trapped chest", CLR(CLR_ORANGE))
/* end traps */
/* end cmap B */
/* */
@@ -184,22 +186,22 @@
/* */
/* zap colors are changed by reset_glyphmap() to match type of beam */
/* */
PCHAR2(72, '|', S_vbeam, "vertical beam", "", CLR(CLR_GRAY))
PCHAR2(73, '-', S_hbeam, "horizontal beam", "", CLR(CLR_GRAY))
PCHAR2(74, '\\', S_lslant, "left slant beam", "", CLR(CLR_GRAY))
PCHAR2(75, '/', S_rslant, "right slant beam", "", CLR(CLR_GRAY))
PCHAR2(74, '|', S_vbeam, "vertical beam", "", CLR(CLR_GRAY))
PCHAR2(75, '-', S_hbeam, "horizontal beam", "", CLR(CLR_GRAY))
PCHAR2(76, '\\', S_lslant, "left slant beam", "", CLR(CLR_GRAY))
PCHAR2(77, '/', S_rslant, "right slant beam", "", CLR(CLR_GRAY))
/* start cmap C */
PCHAR2(76, '*', S_digbeam, "dig beam", "", CLR(CLR_WHITE))
PCHAR2(77, '!', S_flashbeam, "flash beam", "", CLR(CLR_WHITE))
PCHAR2(78, ')', S_boomleft, "boom left", "", CLR(HI_WOOD))
PCHAR2(79, '(', S_boomright, "boom right", "", CLR(HI_WOOD))
PCHAR2(78, '*', S_digbeam, "dig beam", "", CLR(CLR_WHITE))
PCHAR2(79, '!', S_flashbeam, "flash beam", "", CLR(CLR_WHITE))
PCHAR2(80, ')', S_boomleft, "boom left", "", CLR(HI_WOOD))
PCHAR2(81, '(', S_boomright, "boom right", "", CLR(HI_WOOD))
/* 4 magic shield symbols */
PCHAR2(80, '0', S_ss1, "shield1", "", CLR(HI_ZAP))
PCHAR2(81, '#', S_ss2, "shield2", "", CLR(HI_ZAP))
PCHAR2(82, '@', S_ss3, "shield3", "", CLR(HI_ZAP))
PCHAR2(83, '*', S_ss4, "shield4", "", CLR(HI_ZAP))
PCHAR( 84, '#', S_poisoncloud, "poison cloud", CLR(CLR_BRIGHT_GREEN))
PCHAR( 85, '?', S_goodpos, "valid position", CLR(CLR_BRIGHT_GREEN))
PCHAR2(82, '0', S_ss1, "shield1", "", CLR(HI_ZAP))
PCHAR2(83, '#', S_ss2, "shield2", "", CLR(HI_ZAP))
PCHAR2(84, '@', S_ss3, "shield3", "", CLR(HI_ZAP))
PCHAR2(85, '*', S_ss4, "shield4", "", CLR(HI_ZAP))
PCHAR( 86, '#', S_poisoncloud, "poison cloud", CLR(CLR_BRIGHT_GREEN))
PCHAR( 87, '?', S_goodpos, "valid position", CLR(CLR_BRIGHT_GREEN))
/* end cmap C */
/* */
/* The 8 swallow symbols. Do NOT separate. */
@@ -213,14 +215,14 @@
/* 4 5 6 */
/* 7 8 9 */
/* */
PCHAR2(86, '/', S_sw_tl, "swallow top left", "", CLR(CLR_GREEN)) /*1*/
PCHAR2(87, '-', S_sw_tc, "swallow top center", "", CLR(CLR_GREEN)) /*2*/
PCHAR2(88, '\\', S_sw_tr, "swallow top right", "", CLR(CLR_GREEN)) /*3*/
PCHAR2(89, '|', S_sw_ml, "swallow middle left", "", CLR(CLR_GREEN)) /*4*/
PCHAR2(90, '|', S_sw_mr, "swallow middle right", "", CLR(CLR_GREEN)) /*6*/
PCHAR2(91, '\\', S_sw_bl, "swallow bottom left", "", CLR(CLR_GREEN)) /*7*/
PCHAR2(92, '-', S_sw_bc, "swallow bottom center", "", CLR(CLR_GREEN))/*8*/
PCHAR2(93, '/', S_sw_br, "swallow bottom right", "", CLR(CLR_GREEN)) /*9*/
PCHAR2(88, '/', S_sw_tl, "swallow top left", "", CLR(CLR_GREEN)) /*1*/
PCHAR2(89, '-', S_sw_tc, "swallow top center", "", CLR(CLR_GREEN)) /*2*/
PCHAR2(90, '\\', S_sw_tr, "swallow top right", "", CLR(CLR_GREEN)) /*3*/
PCHAR2(91, '|', S_sw_ml, "swallow middle left", "", CLR(CLR_GREEN)) /*4*/
PCHAR2(92, '|', S_sw_mr, "swallow middle right", "", CLR(CLR_GREEN)) /*6*/
PCHAR2(93, '\\', S_sw_bl, "swallow bottom left", "", CLR(CLR_GREEN)) /*7*/
PCHAR2(94, '-', S_sw_bc, "swallow bottom center", "", CLR(CLR_GREEN))/*8*/
PCHAR2(95, '/', S_sw_br, "swallow bottom right", "", CLR(CLR_GREEN)) /*9*/
/* */
/* explosion colors are changed by reset_glyphmap() to match */
/* the type of expl. */
@@ -231,15 +233,15 @@
/* |@| */
/* \-/ */
/* */
PCHAR2(94, '/', S_expl_tl, "explosion top left", "", CLR(CLR_ORANGE))
PCHAR2(95, '-', S_expl_tc, "explosion top center", "", CLR(CLR_ORANGE))
PCHAR2(96, '\\', S_expl_tr, "explosion top right", "", CLR(CLR_ORANGE))
PCHAR2(97, '|', S_expl_ml, "explosion middle left", "", CLR(CLR_ORANGE))
PCHAR2(98, ' ', S_expl_mc, "explosion middle center", "", CLR(CLR_ORANGE))
PCHAR2(99, '|', S_expl_mr, "explosion middle right", "", CLR(CLR_ORANGE))
PCHAR2(100, '\\', S_expl_bl, "explosion bottom left", "", CLR(CLR_ORANGE))
PCHAR2(101, '-', S_expl_bc, "explosion bottom center", "", CLR(CLR_ORANGE))
PCHAR2(102, '/', S_expl_br, "explosion bottom right", "", CLR(CLR_ORANGE))
PCHAR2(96, '/', S_expl_tl, "explosion top left", "", CLR(CLR_ORANGE))
PCHAR2(97, '-', S_expl_tc, "explosion top center", "", CLR(CLR_ORANGE))
PCHAR2(98, '\\', S_expl_tr, "explosion top right", "", CLR(CLR_ORANGE))
PCHAR2(99, '|', S_expl_ml, "explosion middle left", "", CLR(CLR_ORANGE))
PCHAR2(100, ' ', S_expl_mc, "explosion middle center", "", CLR(CLR_ORANGE))
PCHAR2(101, '|', S_expl_mr, "explosion middle right", "", CLR(CLR_ORANGE))
PCHAR2(102, '\\', S_expl_bl, "explosion bottom left", "", CLR(CLR_ORANGE))
PCHAR2(103, '-', S_expl_bc, "explosion bottom center", "", CLR(CLR_ORANGE))
PCHAR2(104, '/', S_expl_br, "explosion bottom right", "", CLR(CLR_ORANGE))
#undef PCHAR
#undef PCHAR2
#endif /* PCHAR_S_ENUM || PCHAR_PARSE || PCHAR_DRAWING || PCHAR_TILES */

View File

@@ -630,6 +630,9 @@ enum glyph_offsets {
#define trap_to_glyph(trap) \
cmap_to_glyph(trap_to_defsym(((int) (trap)->ttyp)))
#define engraving_to_glyph(ep) \
cmap_to_glyph(engraving_to_defsym(ep))
/* Not affected by hallucination. Gives a generic body for CORPSE */
/* MRKR: ...and the generic statue */
#define objnum_to_glyph(onum) ((int) (onum) + GLYPH_OBJ_OFF)

View File

@@ -6,11 +6,14 @@
#ifndef ENGRAVE_H
#define ENGRAVE_H
enum engraving_texts { actual_text, remembered_text, pristine_text, text_states };
struct engr {
struct engr *nxt_engr;
char *engr_txt;
char *engr_txt[text_states];
coordxy engr_x, engr_y;
unsigned engr_lth; /* for save & restore; not length of text */
unsigned engr_szeach; /* length of text including trailing NUL */
unsigned engr_alloc; /* for save & restore; not length of text */
long engr_time; /* moment engraving was (will be) finished */
xint8 engr_type;
#define DUST 1
@@ -25,11 +28,15 @@ struct engr {
* even when hero isn't (so behaves similarly
* to how Elbereth did in 3.4.3) */
Bitfield(nowipeout, 1); /* this engraving will not degrade */
/* 6 free bits */
Bitfield(eread, 1); /* the engraving text has been read or felt */
/* 5 free bits */
};
#define newengr(lth) \
(struct engr *) alloc((unsigned) (lth) + (unsigned) sizeof (struct engr))
#define dealloc_engr(engr) free((genericptr_t) (engr))
#define engraving_to_defsym(ep) \
(levl[(ep)->engr_x][(ep)->engr_y].typ == CORR ? S_engrcorr : S_engroom)
#endif /* ENGRAVE_H */

View File

@@ -832,6 +832,9 @@ extern void del_engr(struct engr *);
extern void rloc_engr(struct engr *);
extern void make_grave(coordxy, coordxy, const char *);
extern void disturb_grave(coordxy, coordxy);
extern void map_engraving(struct engr *, int);
extern void see_engraving(struct engr *);
extern void feel_engraving(struct engr *);
/* ### exper.c ### */

View File

@@ -1216,12 +1216,14 @@ wiz_makemap(void)
return ECMD_OK;
}
/* the #wizmap command - reveal the level map and any traps on it */
/* the #wizmap command - reveal the level map
and any traps or engravings on it */
static int
wiz_map(void)
{
if (wizard) {
struct trap *t;
struct engr *ep;
long save_Hconf = HConfusion, save_Hhallu = HHallucination;
HConfusion = HHallucination = 0L;
@@ -1229,6 +1231,9 @@ wiz_map(void)
t->tseen = 1;
map_trap(t, TRUE);
}
for (ep = head_engr; ep != 0; ep = ep->nxt_engr) {
map_engraving(ep, TRUE);
}
do_mapping();
HConfusion = save_Hconf;
HHallucination = save_Hhallu;

View File

@@ -1328,6 +1328,7 @@ show_map_spot(coordxy x, coordxy y)
{
struct rm *lev;
struct trap *t;
struct engr *ep;
int oldglyph;
if (Confusion && rn2(7))
@@ -1359,6 +1360,8 @@ show_map_spot(coordxy x, coordxy y)
if (!IS_FURNITURE(lev->typ)) {
if ((t = t_at(x, y)) != 0 && t->tseen) {
map_trap(t, 1);
} else if ((ep = engr_at(x,y)) != 0) {
map_engraving(ep, 1);
} else if (glyph_is_trap(oldglyph) || glyph_is_object(oldglyph)) {
show_glyph(x, y, oldglyph);
if (gl.level.flags.hero_memory)

View File

@@ -60,7 +60,7 @@
*
* map_background
* map_object
* map_trap
* map_trap or map_engraving
* map_invisible
* unmap_object
*
@@ -304,6 +304,23 @@ map_trap(register struct trap *trap, register int show)
show_glyph(x, y, glyph);
}
/*
* map_engraving()
*
* Map the engraving and print it out if directed.
*/
void
map_engraving(struct engr *ep, register int show)
{
coordxy x = ep->engr_x, y = ep->engr_y;
int glyph = engraving_to_glyph(ep);
if (gl.level.flags.hero_memory)
levl[x][y].glyph = glyph;
if (show)
show_glyph(x, y, glyph);
}
/*
* map_object()
*
@@ -392,12 +409,15 @@ void
unmap_object(register coordxy x, register coordxy y)
{
register struct trap *trap;
struct engr *ep;
if (!gl.level.flags.hero_memory)
return;
if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) {
map_trap(trap, 0);
} else if ((ep = engr_at(x, y)) != 0 && !covers_traps(x, y)) {
map_engraving(ep, 0);
} else if (levl[x][y].seenv) {
struct rm *lev = &levl[x][y];
@@ -424,11 +444,14 @@ unmap_object(register coordxy x, register coordxy y)
{ \
register struct obj *obj; \
register struct trap *trap; \
struct engr *ep; \
\
if ((obj = vobj_at(x, y)) && !covers_objects(x, y)) \
map_object(obj, show); \
else if ((trap = t_at(x, y)) && trap->tseen && !covers_traps(x, y)) \
map_trap(trap, show); \
else if ((ep = engr_at(x, y)) && !covers_traps(x, y)) \
map_engraving(ep, show); \
else \
map_background(x, y, show); \
\

View File

@@ -254,7 +254,7 @@ ceiling(coordxy x, coordxy y)
struct engr *
engr_at(coordxy x, coordxy y)
{
register struct engr *ep = head_engr;
struct engr *ep = head_engr;
while (ep) {
if (x == ep->engr_x && y == ep->engr_y)
@@ -277,8 +277,8 @@ sengr_at(const char *s, coordxy x, coordxy y, boolean strict)
struct engr *ep = engr_at(x, y);
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= gm.moves) {
if (strict ? !strcmpi(ep->engr_txt, s)
: (strstri(ep->engr_txt, s) != 0))
if (strict ? !strcmpi(ep->engr_txt[actual_text], s)
: (strstri(ep->engr_txt[actual_text], s) != 0))
return ep;
}
return (struct engr *) NULL;
@@ -304,10 +304,10 @@ wipe_engr_at(coordxy x, coordxy y, xint16 cnt, boolean magical)
cnt = rn2(1 + 50 / (cnt + 1)) ? 0 : 1;
debugpline1("actually eroding %d characters", cnt);
}
wipeout_text(ep->engr_txt, (int) cnt, 0);
while (ep->engr_txt[0] == ' ')
ep->engr_txt++;
if (!ep->engr_txt[0])
wipeout_text(ep->engr_txt[actual_text], (int) cnt, 0);
while (ep->engr_txt[actual_text][0] == ' ')
ep->engr_txt[actual_text]++;
if (!ep->engr_txt[actual_text][0])
del_engr(ep);
}
}
@@ -322,7 +322,7 @@ read_engr_at(coordxy x, coordxy y)
/* Sensing an engraving does not require sight,
* nor does it necessarily imply comprehension (literacy).
*/
if (ep && ep->engr_txt[0]) {
if (ep && ep->engr_txt[actual_text][0]) {
switch (ep->engr_type) {
case DUST:
if (!Blind) {
@@ -373,14 +373,16 @@ read_engr_at(coordxy x, coordxy y)
/* sizeof "literal" counts terminating \0 */
- sizeof "You feel the words: \"\".");
if ((int) strlen(ep->engr_txt) > maxelen) {
(void) strncpy(buf, ep->engr_txt, maxelen);
if ((int) strlen(ep->engr_txt[actual_text]) > maxelen) {
(void) strncpy(buf, ep->engr_txt[actual_text], maxelen);
buf[maxelen] = '\0';
et = buf;
} else {
et = ep->engr_txt;
et = ep->engr_txt[actual_text];
}
You("%s: \"%s\".", (Blind) ? "feel the words" : "read", et);
Strcpy(ep->engr_txt[remembered_text], ep->engr_txt[actual_text]);
ep->eread = 1;
if (gc.context.run > 0)
nomul(0);
}
@@ -390,19 +392,24 @@ read_engr_at(coordxy x, coordxy y)
void
make_engr_at(coordxy x, coordxy y, const char *s, long e_time, xint16 e_type)
{
int i;
struct engr *ep;
unsigned smem = Strlen(s) + 1;
if ((ep = engr_at(x, y)) != 0)
del_engr(ep);
ep = newengr(smem);
(void) memset((genericptr_t) ep, 0, smem + sizeof (struct engr));
ep = newengr(smem * 3);
(void) memset((genericptr_t) ep, 0, (smem * 3) + sizeof (struct engr));
ep->nxt_engr = head_engr;
head_engr = ep;
ep->engr_x = x;
ep->engr_y = y;
ep->engr_txt = (char *) (ep + 1);
Strcpy(ep->engr_txt, s);
ep->engr_txt[actual_text] = (char *) (ep + 1);
ep->engr_txt[remembered_text] = ep->engr_txt[actual_text] + smem;
ep->engr_txt[pristine_text] = ep->engr_txt[remembered_text] + smem;
for(i = 0; i < text_states; ++i)
Strcpy(ep->engr_txt[i], s);
if (!strcmp(s, "Elbereth")) {
/* engraving "Elbereth": if done when making a level, it creates
an old-style Elbereth that deters monsters when any objects are
@@ -414,7 +421,9 @@ make_engr_at(coordxy x, coordxy y, const char *s, long e_time, xint16 e_type)
}
ep->engr_time = e_time;
ep->engr_type = e_type > 0 ? e_type : rnd(N_ENGRAVE - 1);
ep->engr_lth = smem;
ep->engr_szeach = smem;
ep->engr_alloc = smem * 3;
/* we do not set ep->eread; the caller will need to if required */
}
/* delete any engraving at location <x,y> */
@@ -536,6 +545,8 @@ doengrave(void)
boolean ptext = TRUE; /* TRUE if we must prompt for engrave text */
boolean teleengr = FALSE; /* TRUE if we move the old engraving */
boolean zapwand = FALSE; /* TRUE if we remove a wand charge */
boolean disprefresh = FALSE; /* TRUE if the display needs a refresh */
xint16 type = DUST; /* Type of engraving made */
xint16 oetype = 0; /* will be set to type of current engraving */
char buf[BUFSZ]; /* Buffer for final/poly engraving text */
@@ -937,17 +948,28 @@ doengrave(void)
}
if (teleengr) {
rloc_engr(oep);
oep->eread = 0;
disprefresh = TRUE;
oep = (struct engr *) 0;
}
if (dengr) {
del_engr(oep);
oep = (struct engr *) 0;
disprefresh = TRUE;
}
/* Something has changed the engraving here */
if (*buf) {
struct engr *tmp_ep;
make_engr_at(u.ux, u.uy, buf, gm.moves, type);
if (!Blind)
pline_The("engraving now reads: \"%s\".", buf);
tmp_ep = engr_at(u.ux, u.uy);
if (!Blind) {
if (tmp_ep != 0) {
pline_The("engraving now reads: \"%s\".", buf);
tmp_ep->eread = 1;
disprefresh = TRUE;
}
}
ptext = FALSE;
}
if (zapwand && (otmp->spe < 0)) {
@@ -965,6 +987,8 @@ doengrave(void)
if (!ptext) {
if (otmp && otmp->oclass == WAND_CLASS && !can_reach_floor(TRUE))
cant_reach_floor(u.ux, u.uy, FALSE, TRUE);
if (disprefresh)
newsym(u.ux, u.uy);
return ECMD_TIME;
}
/*
@@ -1004,6 +1028,7 @@ doengrave(void)
: "written");
del_engr(oep);
oep = (struct engr *) 0;
disprefresh = TRUE;
} else {
/* defer deletion until after we *know* we're engraving */
eow = TRUE;
@@ -1020,7 +1045,7 @@ doengrave(void)
You("will overwrite the current message.");
eow = TRUE;
}
} else if (oep && (int) strlen(oep->engr_txt) >= BUFSZ - 1) {
} else if (oep && (int) strlen(oep->engr_txt[actual_text]) >= BUFSZ - 1) {
There("is no room to add anything else here.");
return ECMD_TIME;
}
@@ -1107,6 +1132,7 @@ doengrave(void)
if (eow) {
del_engr(oep);
oep = (struct engr *) 0;
disprefresh = TRUE;
}
Strcpy(gc.context.engraving.text, ebuf);
@@ -1129,6 +1155,8 @@ doengrave(void)
/* Engraving will always take at least one action via being run as an
* occupation, so do not count this setup as taking time. */
if (disprefresh)
newsym(u.ux, u.uy);
return ECMD_OK;
}
@@ -1144,6 +1172,7 @@ engrave(void)
boolean firsttime = (gc.context.engraving.actionct == 0);
int rate = 10; /* # characters that can be engraved in this action */
boolean truncate = FALSE;
boolean neweng = (gc.context.engraving.actionct == 0);
boolean carving = (gc.context.engraving.type == ENGRAVE
|| gc.context.engraving.type == HEADSTONE);
@@ -1282,7 +1311,7 @@ engrave(void)
buf[0] = '\0';
oep = engr_at(u.ux, u.uy);
if (oep) /* add to existing engraving */
Strcpy(buf, oep->engr_txt);
Strcpy(buf, oep->engr_txt[actual_text]);
space_left = (int) (sizeof buf - strlen(buf) - 1U);
if (endc - gc.context.engraving.nextc > space_left) {
@@ -1305,9 +1334,15 @@ engrave(void)
(void) strncat(buf, gc.context.engraving.nextc,
min(space_left, endc - gc.context.engraving.nextc));
make_engr_at(u.ux, u.uy, buf, gm.moves - gm.multi, gc.context.engraving.type);
oep = engr_at(u.ux, u.uy);
if (oep)
oep->eread = 1;
if (*endc) {
gc.context.engraving.nextc = endc;
if (neweng) {
newsym(gc.context.engraving.pos.x, gc.context.engraving.pos.y);
}
return 1; /* not yet finished this turn */
} else { /* finished engraving */
/* actions that happen after the engraving is finished go here */
@@ -1324,6 +1359,8 @@ engrave(void)
gc.context.engraving.nextc = (char *) 0;
gc.context.engraving.stylus = (struct obj *) 0;
}
if (neweng)
newsym(gc.context.engraving.pos.x, gc.context.engraving.pos.y);
return 0;
}
@@ -1335,7 +1372,7 @@ sanitize_engravings(void)
struct engr *ep;
for (ep = head_engr; ep; ep = ep->nxt_engr) {
sanitize_name(ep->engr_txt);
sanitize_name(ep->engr_txt[actual_text]);
}
}
@@ -1347,12 +1384,13 @@ save_engravings(NHFILE *nhfp)
for (ep = head_engr; ep; ep = ep2) {
ep2 = ep->nxt_engr;
if (ep->engr_lth && ep->engr_txt[0] && perform_bwrite(nhfp)) {
if (ep->engr_alloc
&& ep->engr_txt[actual_text][0] && perform_bwrite(nhfp)) {
if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t)&(ep->engr_lth),
sizeof ep->engr_lth);
bwrite(nhfp->fd, (genericptr_t)&(ep->engr_alloc),
sizeof ep->engr_alloc);
bwrite(nhfp->fd, (genericptr_t)ep,
sizeof (struct engr) + ep->engr_lth);
sizeof (struct engr) + ep->engr_alloc);
}
}
if (release_data(nhfp))
@@ -1385,7 +1423,13 @@ rest_engravings(NHFILE *nhfp)
}
ep->nxt_engr = head_engr;
head_engr = ep;
ep->engr_txt = (char *) (ep + 1); /* Andreas Bormann */
ep->engr_txt[actual_text] = (char *) (ep + 1); /* Andreas Bormann */
ep->engr_txt[remembered_text] = ep->engr_txt[actual_text] + ep->engr_szeach;
ep->engr_txt[pristine_text] = ep->engr_txt[remembered_text] + ep->engr_szeach;
while (ep->engr_txt[actual_text][0] == ' ')
ep->engr_txt[actual_text]++;
while (ep->engr_txt[remembered_text][0] == ' ')
ep->engr_txt[remembered_text]++;
/* mark as finished for bones levels -- no problem for
* normal levels as the player must have finished engraving
* to be able to move again */
@@ -1409,7 +1453,7 @@ engr_stats(
*count = *size = 0L;
for (ep = head_engr; ep; ep = ep->nxt_engr) {
++*count;
*size += (long) sizeof *ep + (long) ep->engr_lth;
*size += (long) sizeof *ep + (long) ep->engr_alloc;
}
}
@@ -1451,6 +1495,7 @@ rloc_engr(struct engr *ep)
ep->engr_x = tx;
ep->engr_y = ty;
newsym(tx, ty); /* caller took care of the old location */
}
/* Create a headstone at the given location.
@@ -1493,6 +1538,23 @@ disturb_grave(coordxy x, coordxy y)
}
}
void
see_engraving(struct engr *ep)
{
newsym(ep->engr_x, ep->engr_y);
}
/* like see_engravings() but overrides vision, but
only for some types of engravings that can be felt */
void
feel_engraving(struct engr *ep)
{
ep->eread = 1;
map_engraving(ep, 1);
/* in case it's beneath something, redisplay the something */
newsym(ep->engr_x, ep->engr_y);
}
static const char blind_writing[][21] = {
{0x44, 0x66, 0x6d, 0x69, 0x62, 0x65, 0x22, 0x45, 0x7b, 0x71,
0x65, 0x6d, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },

View File

@@ -43,6 +43,7 @@ static void domenucontrols(void);
extern void port_help(void);
#endif
static char *setopt_cmd(char *);
static boolean add_quoted_engraving(coordxy, coordxy, char *);
static const char invisexplain[] = "remembered, unseen, creature",
altinvisexplain[] = "unseen creature"; /* for clairvoyance */
@@ -653,6 +654,10 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf)
case S_ice: /* for hallucination; otherwise defsyms[] would be fine */
Strcpy(buf, waterbody_name(x, y));
break;
case S_engroom:
case S_engrcorr:
Strcpy(buf, "engraving");
break;
case S_stone:
if (!levl[x][y].seenv) {
Strcpy(buf, "unexplored");
@@ -1266,6 +1271,12 @@ do_screen_description(coord cc, boolean looked, int sym, char *out_str,
: !(alt_i == S_stone
|| strcmp(x_str, "air") == 0
|| strcmp(x_str, "land") == 0);
if (alt_i == S_engroom || alt_i == S_engrcorr) {
article = 1;
x_str = "engraving";
need_to_look = TRUE;
}
found = add_cmap_descr(found, alt_i, glyph, article,
cc, x_str, prefix,
&hit_trap, firstmatch, out_str);
@@ -1393,9 +1404,11 @@ do_screen_description(coord cc, boolean looked, int sym, char *out_str,
if (look_buf[0] != '\0')
*firstmatch = look_buf;
if (*(*firstmatch)) {
Snprintf(temp_buf, sizeof temp_buf, " (%s)", *firstmatch);
(void) strncat(out_str, temp_buf,
BUFSZ - strlen(out_str) - 1);
if (strncmp(look_buf, "engraving", 9) != 0) {
Snprintf(temp_buf, sizeof temp_buf, " (%s)", *firstmatch);
(void) strncat(out_str, temp_buf,
BUFSZ - strlen(out_str) - 1);
}
found = 1; /* we have something to look up */
}
if (monbuf[0]) {
@@ -1409,6 +1422,24 @@ do_screen_description(coord cc, boolean looked, int sym, char *out_str,
return found;
}
static boolean
add_quoted_engraving(coordxy x, coordxy y, char *buf)
{
char temp_buf[BUFSZ];
struct engr *ep = engr_at(x, y);
if (ep) {
if (ep->eread)
Snprintf(temp_buf, sizeof temp_buf, " with remembered text: \"%s\"",
ep->engr_txt[remembered_text]);
else
Snprintf(temp_buf, sizeof temp_buf, " that you've never read");
(void) strncat(buf, temp_buf, BUFSZ - strlen(buf) - 1);
return TRUE;
}
return FALSE;
}
/* also used by getpos hack in do_name.c */
const char what_is_an_unknown_object[] = "an unknown object";
@@ -1604,6 +1635,18 @@ do_look(int mode, coord *click_cc)
/* Finally, print out our explanation. */
if (found) {
if (ans != LOOK_QUICK && ans != LOOK_ONCE
&& (ans == LOOK_VERBOSE || (flags.help && !quick))
&& !clicklook
&& !strncmp(firstmatch, "engraving", 9)) {
char engbuf[BUFSZ];
engbuf[0] = '\0';
if (add_quoted_engraving(cc.x, cc.y, engbuf)) {
Snprintf(eos(out_str), BUFSZ - strlen(out_str) - 1,
engbuf);
}
}
/* use putmixed() because there may be an encoded glyph present */
putmixed(WIN_MESSAGE, 0, out_str);
#ifdef DUMPLOG

File diff suppressed because it is too large Load Diff