patch cleanup (trunk only)
My #terrain patch had a typo on the command line and was going to include doc/fixes35.0 as the log text for a half-dozen files. I aborted the commit but most of them had already made it into the cvs repository. This reverts those changes so that the entire patch can be re-comitted with the right log text. Ugh...
This commit is contained in:
@@ -17,6 +17,7 @@ Debug-Mode Quick Reference:
|
|||||||
#polyself == polymorph self
|
#polyself == polymorph self
|
||||||
#seenv == show seen vectors
|
#seenv == show seen vectors
|
||||||
#stats == show memory statistics
|
#stats == show memory statistics
|
||||||
|
#terrain == show map topology
|
||||||
#timeout == look at timeout queue
|
#timeout == look at timeout queue
|
||||||
#vision == show vision array
|
#vision == show vision array
|
||||||
#wmode == show wall modes
|
#wmode == show wall modes
|
||||||
|
|||||||
@@ -843,10 +843,8 @@ Ride (or stop riding) a monster.
|
|||||||
Rub a lamp or a stone.
|
Rub a lamp or a stone.
|
||||||
.lp "#sit "
|
.lp "#sit "
|
||||||
Sit down.
|
Sit down.
|
||||||
.lp #terrain
|
|
||||||
Show bare map without displaying monsters, objects, or traps.
|
|
||||||
.lp "#tip "
|
.lp "#tip "
|
||||||
Tip over a container (bag or box) to pour out its contents.
|
Tip over a container to pour out its contents.
|
||||||
.lp #turn
|
.lp #turn
|
||||||
Turn undead.
|
Turn undead.
|
||||||
.lp #twoweapon
|
.lp #twoweapon
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
\begin{document}
|
\begin{document}
|
||||||
%
|
%
|
||||||
% input file: guidebook.mn
|
% input file: guidebook.mn
|
||||||
% $Revision: 1.117 $ $Date: 2011/09/15 04:16:22 $
|
% $Revision: 1.118 $ $Date: 2011/12/05 09:15:45 $
|
||||||
%
|
%
|
||||||
%.ds h0 "
|
%.ds h0 "
|
||||||
%.ds h1 %.ds h2 \%
|
%.ds h1 %.ds h2 \%
|
||||||
@@ -1053,10 +1053,8 @@ Rub a lamp or a stone.
|
|||||||
\item[\tb{\#sit}]
|
\item[\tb{\#sit}]
|
||||||
Sit down.
|
Sit down.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{\#terrain}]
|
|
||||||
Show bare map without displaying monsters, objects, or traps.
|
|
||||||
\item[\tb{\#tip}]
|
\item[\tb{\#tip}]
|
||||||
Tip over a container (bag or box) to pour out its contents.
|
Tip over a container to pour out its contents.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{\#turn}]
|
\item[\tb{\#turn}]
|
||||||
Turn undead.
|
Turn undead.
|
||||||
|
|||||||
@@ -261,7 +261,6 @@ E void FDECL(find_trap, (struct trap *));
|
|||||||
E int FDECL(dosearch0, (int));
|
E int FDECL(dosearch0, (int));
|
||||||
E int NDECL(dosearch);
|
E int NDECL(dosearch);
|
||||||
E void NDECL(sokoban_detect);
|
E void NDECL(sokoban_detect);
|
||||||
E void FDECL(reveal_terrain, (BOOLEAN_P));
|
|
||||||
|
|
||||||
/* ### dig.c ### */
|
/* ### dig.c ### */
|
||||||
|
|
||||||
|
|||||||
165
src/cmd.c
165
src/cmd.c
@@ -126,7 +126,6 @@ STATIC_PTR int NDECL(domonability);
|
|||||||
STATIC_PTR int NDECL(dooverview_or_wiz_where);
|
STATIC_PTR int NDECL(dooverview_or_wiz_where);
|
||||||
#endif /* DUNGEON_OVERVIEW */
|
#endif /* DUNGEON_OVERVIEW */
|
||||||
STATIC_PTR int NDECL(dotravel);
|
STATIC_PTR int NDECL(dotravel);
|
||||||
STATIC_PTR int NDECL(doterrain);
|
|
||||||
# ifdef WIZARD
|
# ifdef WIZARD
|
||||||
STATIC_PTR int NDECL(wiz_wish);
|
STATIC_PTR int NDECL(wiz_wish);
|
||||||
STATIC_PTR int NDECL(wiz_identify);
|
STATIC_PTR int NDECL(wiz_identify);
|
||||||
@@ -143,8 +142,7 @@ STATIC_PTR int NDECL(wiz_show_vision);
|
|||||||
STATIC_PTR int NDECL(wiz_smell);
|
STATIC_PTR int NDECL(wiz_smell);
|
||||||
STATIC_PTR int NDECL(wiz_mon_polycontrol);
|
STATIC_PTR int NDECL(wiz_mon_polycontrol);
|
||||||
STATIC_PTR int NDECL(wiz_show_wmodes);
|
STATIC_PTR int NDECL(wiz_show_wmodes);
|
||||||
STATIC_DCL void NDECL(wiz_map_levltyp);
|
STATIC_PTR int NDECL(wiz_map_terrain);
|
||||||
STATIC_DCL void NDECL(wiz_levltyp_legend);
|
|
||||||
#if defined(__BORLANDC__) && !defined(_WIN32)
|
#if defined(__BORLANDC__) && !defined(_WIN32)
|
||||||
extern void FDECL(show_borlandc_stats, (winid));
|
extern void FDECL(show_borlandc_stats, (winid));
|
||||||
#endif
|
#endif
|
||||||
@@ -822,9 +820,9 @@ wiz_show_wmodes(VOID_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wizard mode variant of #terrain; internal levl[][].typ values in base-36 */
|
/* #terrain command */
|
||||||
STATIC_OVL void
|
STATIC_PTR int
|
||||||
wiz_map_levltyp(VOID_ARGS)
|
wiz_map_terrain(VOID_ARGS)
|
||||||
{
|
{
|
||||||
winid win;
|
winid win;
|
||||||
int x, y, terrain;
|
int x, y, terrain;
|
||||||
@@ -923,91 +921,10 @@ wiz_map_levltyp(VOID_ARGS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
display_nhwindow(win, TRUE);
|
display_nhwindow(win, TRUE);
|
||||||
|
/* TODO? create legend of levl[][].typ codes and allow switching
|
||||||
|
back and forth between it and coded map display */
|
||||||
destroy_nhwindow(win);
|
destroy_nhwindow(win);
|
||||||
return;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
/* temporary? hack, since level type codes aren't the same as screen
|
|
||||||
symbols and only the latter have easily accessible descriptions */
|
|
||||||
static const char *levltyp[] = {
|
|
||||||
"stone",
|
|
||||||
"vertical wall",
|
|
||||||
"horizontal wall",
|
|
||||||
"top-left corner wall",
|
|
||||||
"top-right corner wall",
|
|
||||||
"bottom-left corner wall",
|
|
||||||
"bottom-right corner wall",
|
|
||||||
"cross wall",
|
|
||||||
"tee-up wall",
|
|
||||||
"tee-down wall",
|
|
||||||
"tee-left wall",
|
|
||||||
"tee-right wall",
|
|
||||||
"drawbridge wall",
|
|
||||||
"tree",
|
|
||||||
"secret door",
|
|
||||||
"secret corridor",
|
|
||||||
"pool",
|
|
||||||
"moat",
|
|
||||||
"water",
|
|
||||||
"drawbridge up",
|
|
||||||
"lava pool",
|
|
||||||
"iron bars",
|
|
||||||
"door",
|
|
||||||
"corridor",
|
|
||||||
"room",
|
|
||||||
"stairs",
|
|
||||||
"ladder",
|
|
||||||
"fountain",
|
|
||||||
"throne",
|
|
||||||
"sink",
|
|
||||||
"grave",
|
|
||||||
"altar",
|
|
||||||
"ice",
|
|
||||||
"drawbridge down",
|
|
||||||
"air",
|
|
||||||
"cloud",
|
|
||||||
/* not a real terrain type, but used for undiggable stone
|
|
||||||
by wiz_map_levltyp() */
|
|
||||||
"unreachable/undiggable",
|
|
||||||
/* padding in case the number of entries above is odd */
|
|
||||||
""
|
|
||||||
};
|
|
||||||
|
|
||||||
/* explanation of base-36 output from wiz_map_levltyp() */
|
|
||||||
STATIC_OVL void
|
|
||||||
wiz_levltyp_legend(VOID_ARGS)
|
|
||||||
{
|
|
||||||
winid win;
|
|
||||||
int i, j, last, c;
|
|
||||||
const char *dsc, *fmt;
|
|
||||||
char buf[BUFSZ];
|
|
||||||
|
|
||||||
win = create_nhwindow(NHW_TEXT);
|
|
||||||
putstr(win, 0, "#terrain encodings:");
|
|
||||||
putstr(win, 0, "");
|
|
||||||
fmt = " %c - %-28s"; /* TODO: include tab-separated variant for win32 */
|
|
||||||
*buf = '\0';
|
|
||||||
/* output in pairs, left hand column holds [0],[1],...,[N/2-1]
|
|
||||||
and right hand column holds [N/2],[N/2+1],...,[N-1];
|
|
||||||
N ('last') will always be even, and may or may not include
|
|
||||||
the empty string entry to pad out the final pair, depending
|
|
||||||
upon how many other entries are present in levltyp[] */
|
|
||||||
last = SIZE(levltyp) & ~1;
|
|
||||||
for (i = 0; i < last / 2; ++i)
|
|
||||||
for (j = i; j < last; j += last / 2) {
|
|
||||||
dsc = levltyp[j];
|
|
||||||
c = !*dsc ? ' ' : !strncmp(dsc, "unreachable", 11) ? '*' :
|
|
||||||
/* same int-to-char conversion as wiz_map_levltyp() */
|
|
||||||
(j < 10) ? '0' + j : (j < 36) ? 'a' + j - 10 : 'A' + j - 36;
|
|
||||||
Sprintf(eos(buf), fmt, c, dsc);
|
|
||||||
if (j > i) {
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
*buf = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
display_nhwindow(win, TRUE);
|
|
||||||
destroy_nhwindow(win);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #wizsmell command - test usmellmon(). */
|
/* #wizsmell command - test usmellmon(). */
|
||||||
@@ -1066,71 +983,6 @@ wiz_rumor_check(VOID_ARGS)
|
|||||||
}
|
}
|
||||||
#endif /* WIZARD */
|
#endif /* WIZARD */
|
||||||
|
|
||||||
/* #terrain command */
|
|
||||||
STATIC_PTR int
|
|
||||||
doterrain(VOID_ARGS)
|
|
||||||
{
|
|
||||||
int which = 1; /* show known map, ala crawl's '|' command */
|
|
||||||
|
|
||||||
if (discover || wizard) {
|
|
||||||
/* explore mode #terrain: choose between known map and full map;
|
|
||||||
wizard mode #terrain: choose between known map, full map,
|
|
||||||
a dump of the internal levl[][].typ codes w/ level flags,
|
|
||||||
and a legend for the levl[][].typ codes */
|
|
||||||
winid men;
|
|
||||||
menu_item *sel;
|
|
||||||
anything any;
|
|
||||||
int n;
|
|
||||||
|
|
||||||
men = create_nhwindow(NHW_MENU);
|
|
||||||
any = zeroany;
|
|
||||||
any.a_int = 1;
|
|
||||||
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
|
||||||
"known map without monsters, objects, and traps",
|
|
||||||
MENU_SELECTED);
|
|
||||||
any.a_int = 2;
|
|
||||||
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
|
||||||
"full map without monsters, objects, and traps",
|
|
||||||
MENU_UNSELECTED);
|
|
||||||
#ifdef WIZARD
|
|
||||||
if (wizard) {
|
|
||||||
any.a_int = 3;
|
|
||||||
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
|
||||||
"internal levl[][].typ codes in base-36",
|
|
||||||
MENU_UNSELECTED);
|
|
||||||
any.a_int = 4;
|
|
||||||
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
|
||||||
"legend of base-36 levl[][].typ codes",
|
|
||||||
MENU_UNSELECTED);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
end_menu(men, "View which?");
|
|
||||||
|
|
||||||
n = select_menu(men, PICK_ONE, &sel);
|
|
||||||
destroy_nhwindow(men);
|
|
||||||
/*
|
|
||||||
* n < 0: player used ESC to cancel;
|
|
||||||
* n == 0: preselected entry was explicitly chosen and got toggled off;
|
|
||||||
* n == 1: preselected entry was implicitly chosen via <space>|<enter>;
|
|
||||||
* n == 2: another entry was explicitly chosen, so skip preselected one
|
|
||||||
*/
|
|
||||||
which = (n < 0) ? -1 : (n == 0) ? 1 : sel[0].item.a_int;
|
|
||||||
if (n > 1 && which == 1) which = sel[1].item.a_int;
|
|
||||||
if (n > 0) free((genericptr_t)sel);
|
|
||||||
} /* discover || wizard */
|
|
||||||
|
|
||||||
switch (which) {
|
|
||||||
case 1: reveal_terrain(FALSE); break; /* known map */
|
|
||||||
case 2: reveal_terrain(TRUE); break; /* full map */
|
|
||||||
#ifdef WIZARD
|
|
||||||
case 3: wiz_map_levltyp(); break; /* map internals */
|
|
||||||
case 4: wiz_levltyp_legend(); break; /* internal details */
|
|
||||||
#endif
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
return 0; /* no time elapses */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -enlightenment and conduct- */
|
/* -enlightenment and conduct- */
|
||||||
static winid en_win = WIN_ERR;
|
static winid en_win = WIN_ERR;
|
||||||
@@ -2478,7 +2330,6 @@ struct ext_func_tab extcmdlist[] = {
|
|||||||
#endif
|
#endif
|
||||||
{"rub", "rub a lamp or a stone", dorub, FALSE},
|
{"rub", "rub a lamp or a stone", dorub, FALSE},
|
||||||
{"sit", "sit down", dosit, FALSE},
|
{"sit", "sit down", dosit, FALSE},
|
||||||
{"terrain", "show map without obstructions", doterrain, TRUE},
|
|
||||||
{"tip", "empty a container", dotip, FALSE},
|
{"tip", "empty a container", dotip, FALSE},
|
||||||
{"turn", "turn undead", doturn, TRUE},
|
{"turn", "turn undead", doturn, TRUE},
|
||||||
{"twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE},
|
{"twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE},
|
||||||
@@ -2505,6 +2356,7 @@ struct ext_func_tab extcmdlist[] = {
|
|||||||
#endif
|
#endif
|
||||||
{(char *)0, (char *)0, donull, TRUE}, /* seenv */
|
{(char *)0, (char *)0, donull, TRUE}, /* seenv */
|
||||||
{(char *)0, (char *)0, donull, TRUE}, /* stats */
|
{(char *)0, (char *)0, donull, TRUE}, /* stats */
|
||||||
|
{(char *)0, (char *)0, donull, TRUE}, /* terrain */
|
||||||
{(char *)0, (char *)0, donull, TRUE}, /* timeout */
|
{(char *)0, (char *)0, donull, TRUE}, /* timeout */
|
||||||
{(char *)0, (char *)0, donull, TRUE}, /* vanquished */
|
{(char *)0, (char *)0, donull, TRUE}, /* vanquished */
|
||||||
{(char *)0, (char *)0, donull, TRUE}, /* vision */
|
{(char *)0, (char *)0, donull, TRUE}, /* vision */
|
||||||
@@ -2534,6 +2386,7 @@ static const struct ext_func_tab debug_extcmdlist[] = {
|
|||||||
#endif
|
#endif
|
||||||
{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
|
{"seenv", "show seen vectors", wiz_show_seenv, TRUE},
|
||||||
{"stats", "show memory statistics", wiz_show_stats, TRUE},
|
{"stats", "show memory statistics", wiz_show_stats, TRUE},
|
||||||
|
{"terrain", "show map topology", wiz_map_terrain, TRUE},
|
||||||
{"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
|
{"timeout", "look at timeout queue", wiz_timeout_queue, TRUE},
|
||||||
{"vanquished", "list vanquished monsters", dovanquished, TRUE},
|
{"vanquished", "list vanquished monsters", dovanquished, TRUE},
|
||||||
{"vision", "show vision array", wiz_show_vision, TRUE},
|
{"vision", "show vision array", wiz_show_vision, TRUE},
|
||||||
|
|||||||
Reference in New Issue
Block a user