Clive Crous' Dark Room patch
This patch adds a new glyph that represents dark parts of room, splitting the dual functionality of the "unexplored/dark area" glyph.
This commit is contained in:
@@ -764,11 +764,11 @@ newsym(x,y)
|
||||
* These checks and changes must be here and not in back_to_glyph().
|
||||
* They are dependent on the position being out of sight.
|
||||
*/
|
||||
else if (!lev->waslit) {
|
||||
else if (!lev->waslit || (flags.dark_room && iflags.use_color)) {
|
||||
if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR)
|
||||
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
|
||||
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM)
|
||||
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_stone));
|
||||
show_glyph(x, y, lev->glyph = cmap_to_glyph(DARKROOMSYM));
|
||||
else
|
||||
goto show_mem;
|
||||
} else {
|
||||
|
||||
@@ -238,6 +238,7 @@ const char *goal;
|
||||
if (glyph_is_cmap(k) &&
|
||||
(IS_DOOR(levl[tx][ty].typ) ||
|
||||
glyph_to_cmap(k) == S_room ||
|
||||
glyph_to_cmap(k) == S_darkroom ||
|
||||
glyph_to_cmap(k) == S_corr ||
|
||||
glyph_to_cmap(k) == S_litcorr)) {
|
||||
/* what the hero remembers to be at tx,ty */
|
||||
|
||||
@@ -156,7 +156,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'#', "iron bars", C(HI_METAL)}, /* bars */
|
||||
{'#', "tree", C(CLR_GREEN)}, /* tree */
|
||||
{'.', "floor of a room",C(CLR_GRAY)}, /* room */
|
||||
/*20*/ {'#', "corridor", C(CLR_GRAY)}, /* dark corr */
|
||||
/*20*/ {'.', "dark part of a room",C(CLR_BLACK)}, /* dark room */
|
||||
{'#', "corridor", C(CLR_GRAY)}, /* dark corr */
|
||||
{'#', "lit corridor", C(CLR_GRAY)}, /* lit corr (see mapglyph.c) */
|
||||
{'<', "staircase up", C(CLR_GRAY)}, /* upstair */
|
||||
{'>', "staircase down", C(CLR_GRAY)}, /* dnstair */
|
||||
@@ -165,8 +166,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'_', "altar", C(CLR_GRAY)}, /* altar */
|
||||
{'|', "grave", C(CLR_GRAY)}, /* grave */
|
||||
{'\\', "opulent throne",C(HI_GOLD)}, /* throne */
|
||||
{'#', "sink", C(CLR_GRAY)}, /* sink */
|
||||
/*30*/ {'{', "fountain", C(CLR_BLUE)}, /* fountain */
|
||||
/*30*/ {'#', "sink", C(CLR_GRAY)}, /* sink */
|
||||
{'{', "fountain", C(CLR_BLUE)}, /* fountain */
|
||||
{'}', "water", C(CLR_BLUE)}, /* pool */
|
||||
{'.', "ice", C(CLR_CYAN)}, /* ice */
|
||||
{'}', "molten lava", C(CLR_RED)}, /* lava */
|
||||
@@ -175,8 +176,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'#', "raised drawbridge",C(CLR_BROWN)}, /* vcdbridge */
|
||||
{'#', "raised drawbridge",C(CLR_BROWN)}, /* hcdbridge */
|
||||
{' ', "air", C(CLR_CYAN)}, /* open air */
|
||||
{'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
|
||||
/*40*/ {'}', "water", C(CLR_BLUE)}, /* under water */
|
||||
/*40*/ {'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
|
||||
{'}', "water", C(CLR_BLUE)}, /* under water */
|
||||
{'^', "arrow trap", C(HI_METAL)}, /* trap */
|
||||
{'^', "dart trap", C(HI_METAL)}, /* trap */
|
||||
{'^', "falling rock trap",C(CLR_GRAY)}, /* trap */
|
||||
@@ -185,8 +186,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'^', "land mine", C(CLR_RED)}, /* trap */
|
||||
{'^', "rolling boulder trap", C(CLR_GRAY)}, /* trap */
|
||||
{'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */
|
||||
{'^', "rust trap", C(CLR_BLUE)}, /* trap */
|
||||
/*50*/ {'^', "fire trap", C(CLR_ORANGE)}, /* trap */
|
||||
/*50*/ {'^', "rust trap", C(CLR_BLUE)}, /* trap */
|
||||
{'^', "fire trap", C(CLR_ORANGE)}, /* trap */
|
||||
{'^', "pit", C(CLR_BLACK)}, /* trap */
|
||||
{'^', "spiked pit", C(CLR_BLACK)}, /* trap */
|
||||
{'^', "hole", C(CLR_BROWN)}, /* trap */
|
||||
@@ -195,8 +196,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'^', "level teleporter", C(CLR_MAGENTA)}, /* trap */
|
||||
{'^', "magic portal", C(CLR_BRIGHT_MAGENTA)}, /* trap */
|
||||
{'"', "web", C(CLR_GRAY)}, /* web */
|
||||
{'^', "statue trap", C(CLR_GRAY)}, /* trap */
|
||||
/*60*/ {'^', "magic trap", C(HI_ZAP)}, /* trap */
|
||||
/*60*/ {'^', "statue trap", C(CLR_GRAY)}, /* trap */
|
||||
{'^', "magic trap", C(HI_ZAP)}, /* trap */
|
||||
{'^', "anti-magic field", C(HI_ZAP)}, /* trap */
|
||||
{'^', "polymorph trap", C(CLR_BRIGHT_GREEN)}, /* trap */
|
||||
{'|', "wall", C(CLR_GRAY)}, /* vbeam */
|
||||
@@ -205,8 +206,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'/', "wall", C(CLR_GRAY)}, /* rslant */
|
||||
{'*', "", C(CLR_WHITE)}, /* dig beam */
|
||||
{'!', "", C(CLR_WHITE)}, /* camera flash beam */
|
||||
{')', "", C(HI_WOOD)}, /* boomerang open left */
|
||||
/*70*/ {'(', "", C(HI_WOOD)}, /* boomerang open right */
|
||||
/*70*/ {')', "", C(HI_WOOD)}, /* boomerang open left */
|
||||
{'(', "", C(HI_WOOD)}, /* boomerang open right */
|
||||
{'0', "", C(HI_ZAP)}, /* 4 magic shield symbols */
|
||||
{'#', "", C(HI_ZAP)},
|
||||
{'@', "", C(HI_ZAP)},
|
||||
@@ -215,20 +216,20 @@ const struct symdef defsyms[MAXPCHARS] = {
|
||||
{'?', "valid position", C(CLR_BRIGHT_GREEN)}, /* valid position for targeting */
|
||||
{'/', "", C(CLR_GREEN)}, /* swallow top left */
|
||||
{'-', "", C(CLR_GREEN)}, /* swallow top center */
|
||||
{'\\', "", C(CLR_GREEN)}, /* swallow top right */
|
||||
/*80*/ {'\\', "", C(CLR_GREEN)}, /* swallow top right */
|
||||
{'|', "", C(CLR_GREEN)}, /* swallow middle left */
|
||||
{'|', "", C(CLR_GREEN)}, /* swallow middle right */
|
||||
/*80*/ {'\\', "", C(CLR_GREEN)}, /* swallow bottom left */
|
||||
{'\\', "", C(CLR_GREEN)}, /* swallow bottom left */
|
||||
{'-', "", C(CLR_GREEN)}, /* swallow bottom center*/
|
||||
{'/', "", C(CLR_GREEN)}, /* swallow bottom right */
|
||||
{'/', "", C(CLR_ORANGE)}, /* explosion top left */
|
||||
{'-', "", C(CLR_ORANGE)}, /* explosion top center */
|
||||
{'\\', "", C(CLR_ORANGE)}, /* explosion top right */
|
||||
{'|', "", C(CLR_ORANGE)}, /* explosion middle left */
|
||||
{' ', "", C(CLR_ORANGE)}, /* explosion middle center*/
|
||||
/*90*/ {' ', "", C(CLR_ORANGE)}, /* explosion middle center*/
|
||||
{'|', "", C(CLR_ORANGE)}, /* explosion middle right */
|
||||
{'\\', "", C(CLR_ORANGE)}, /* explosion bottom left */
|
||||
/*90*/ {'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
|
||||
{'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
|
||||
{'/', "", C(CLR_ORANGE)}, /* explosion bottom right */
|
||||
};
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ unsigned *ospecial;
|
||||
color = CLR_MAGENTA;
|
||||
else if (offset == S_corr || offset == S_litcorr)
|
||||
color = CLR_GRAY;
|
||||
else if (offset >= S_room && offset <= S_water)
|
||||
else if (offset >= S_room && offset <= S_water && offset != S_darkroom)
|
||||
color = CLR_GREEN;
|
||||
else
|
||||
color = NO_COLOR;
|
||||
|
||||
@@ -105,6 +105,7 @@ static struct Bool_Opt
|
||||
{"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
|
||||
# endif
|
||||
{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
|
||||
{"dark_room", &flags.dark_room, TRUE, SET_IN_GAME},
|
||||
{"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME}, /*WC*/
|
||||
#ifdef TTY_GRAPHICS
|
||||
{"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME},
|
||||
@@ -496,6 +497,35 @@ STATIC_OVL boolean FDECL(wc2_supported, (const char *));
|
||||
STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *));
|
||||
STATIC_OVL int FDECL(count_ape_maps, (int *, int *));
|
||||
|
||||
|
||||
void
|
||||
reglyph_darkroom()
|
||||
{
|
||||
xchar x,y;
|
||||
for (x = 0; x < COLNO; x++)
|
||||
for (y = 0; y < ROWNO; y++) {
|
||||
struct rm *lev = &levl[x][y];
|
||||
if (!flags.dark_room) {
|
||||
if (lev->glyph == cmap_to_glyph(S_darkroom))
|
||||
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : cmap_to_glyph(S_stone);
|
||||
} else {
|
||||
if (lev->glyph == cmap_to_glyph(S_room) &&
|
||||
lev->seenv &&
|
||||
lev->waslit && !cansee(x,y))
|
||||
lev->glyph = cmap_to_glyph(S_darkroom);
|
||||
else if (lev->glyph == cmap_to_glyph(S_stone) &&
|
||||
lev->typ == ROOM &&
|
||||
lev->seenv &&
|
||||
!cansee(x,y))
|
||||
lev->glyph = cmap_to_glyph(S_darkroom);
|
||||
}
|
||||
}
|
||||
if (flags.dark_room && iflags.use_color)
|
||||
showsyms[S_darkroom]=showsyms[S_room];
|
||||
else
|
||||
showsyms[S_darkroom]=showsyms[S_stone];
|
||||
}
|
||||
|
||||
/* check whether a user-supplied option string is a proper leading
|
||||
substring of a particular option name; option string might have
|
||||
a colon or equals sign and arbitrary value appended to it */
|
||||
@@ -704,6 +734,8 @@ initoptions_finish()
|
||||
/* result in the player's preferred fruit [better than "\033"]. */
|
||||
obj_descr[SLIME_MOLD].oc_name = "fruit";
|
||||
|
||||
reglyph_darkroom();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2810,7 +2842,8 @@ goodfruit:
|
||||
else if ((boolopt[i].addr) == &flags.invlet_constant) {
|
||||
if (flags.invlet_constant) reassign();
|
||||
}
|
||||
else if ((boolopt[i].addr) == &flags.lit_corridor) {
|
||||
else if (((boolopt[i].addr) == &flags.lit_corridor) ||
|
||||
((boolopt[i].addr) == &flags.dark_room)) {
|
||||
/*
|
||||
* All corridor squares seen via night vision or
|
||||
* candles & lamps change. Update them by calling
|
||||
@@ -2820,6 +2853,7 @@ goodfruit:
|
||||
*/
|
||||
vision_recalc(2); /* shut down vision */
|
||||
vision_full_recalc = 1; /* delayed recalc */
|
||||
if (iflags.use_color) need_redraw = TRUE; /* darkroom refresh */
|
||||
}
|
||||
else if ((boolopt[i].addr) == &iflags.use_inverse ||
|
||||
(boolopt[i].addr) == &flags.showrace ||
|
||||
@@ -3149,8 +3183,10 @@ doset()
|
||||
}
|
||||
|
||||
destroy_nhwindow(tmpwin);
|
||||
if (need_redraw)
|
||||
if (need_redraw) {
|
||||
reglyph_darkroom();
|
||||
(void) doredraw();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ lookat(x, y, buf, monbuf)
|
||||
int tnum = what_trap(glyph_to_trap(glyph));
|
||||
Strcpy(buf, defsyms[trap_to_defsym(tnum)].explanation);
|
||||
} else if(!glyph_is_cmap(glyph)) {
|
||||
Strcpy(buf,"dark part of a room");
|
||||
Strcpy(buf,"unexplored area");
|
||||
} else switch(glyph_to_cmap(glyph)) {
|
||||
case S_altar:
|
||||
Sprintf(buf, "%s %saltar",
|
||||
@@ -557,8 +557,8 @@ const char **firstmatch;
|
||||
x_str = defsyms[i].explanation;
|
||||
if (sym == ((looked) ?
|
||||
showsyms[i] : defsyms[i].sym) && *x_str) {
|
||||
/* avoid "an air", "a water", or "a floor of a room" */
|
||||
int article = (i == S_room) ? 2 : /* 2=>"the" */
|
||||
/* avoid "an air", "a water", "a floor of a room", "a dark part of a room" */
|
||||
int article = ((i == S_room)||(i == S_darkroom)) ? 2 : /* 2=>"the" */
|
||||
!(strcmp(x_str, "air") == 0 || /* 1=>"an" */
|
||||
strcmp(x_str, "water") == 0); /* 0=>(none)*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user