When asked for a location, the key to go to previous closest unexplored location. Default is 'X'.
.lp getpos.valid
When asked for a location, the key to go to show valid target locations. Default is '$'.
+.lp getpos.valid.next
+When asked for a location, the key to go to next closest valid location. Default is 'z'.
+.lp getpos.valid.prev
+When asked for a location, the key to go to previous closest valid location. Default is 'Z'.
.lp nopickup
Prefix key to move without picking up items. Default is 'm'.
.lp redraw
\item{\bb{getpos.valid}}
When asked for a location, the key to go to show valid target locations. Default is ``{\tt \$}''.
%.lp
+\item{\bb{getpos.valid.next}}
+When asked for a location, the key to go to next closest valid location. Default is ``{\tt z}''.
+%.lp
+\item{\bb{getpos.valid.prev}}
+When asked for a location, the key to go to previous closest valid location. Default is ``{\tt Z}''.
+%.lp
\item{\bb{nopickup}}
Prefix key to move without picking up items. Default is ``{\tt m}''.
%.lp
give feedback just before timed levitation runs out
travel accepts 'm' (request menu) prefix
pressing a or A when cursor positioning shows menu of "interesting" features
+pressing z or Z when cursor positioning cycles through valid locations for
+ jumping, hitting with polearm, or casting a stinking cloud
+when moving a cursor for a jump, polearm, or stinking cloud targeting, show
+ if the location is illegal, if "autodescribe" is on
wizard-mode command #wizmakemap to recreate the current level
'goldX' boolean option to treat gold pieces as X (vs U) during BUCX filtering
(should be persistent but is reset each save/restore cycle in order
E char *FDECL(coord_desc, (int, int, char *, CHAR_P));
E boolean FDECL(getpos_menu, (coord *, int));
E int FDECL(getpos, (coord *, BOOLEAN_P, const char *));
-E void FDECL(getpos_sethilite, (void (*f)(int)));
+E void FDECL(getpos_sethilite, (void (*f)(int), boolean (*d)(int,int)));
E void FDECL(new_mname, (struct monst *, int));
E void FDECL(free_mname, (struct monst *));
E void FDECL(new_oname, (struct obj *, int));
NHKF_GETPOS_UNEX_PREV,
NHKF_GETPOS_INTERESTING_NEXT,
NHKF_GETPOS_INTERESTING_PREV,
+ NHKF_GETPOS_VALID_NEXT,
+ NHKF_GETPOS_VALID_PREV,
NHKF_GETPOS_HELP,
NHKF_GETPOS_MENU,
NHKF_GETPOS_LIMITVIEW,
GLOC_DOOR,
GLOC_EXPLORE,
GLOC_INTERESTING,
+ GLOC_VALID,
NUM_GLOCS
};
static int jumping_is_magic;
+boolean
+get_valid_jump_position(x,y)
+int x,y;
+{
+ return (isok(x, y)
+ && (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
+ && is_valid_jump_pos(x, y, jumping_is_magic, FALSE));
+}
+
void
display_jump_positions(state)
int state;
for (dy = -4; dy <= 4; dy++) {
x = dx + (int) u.ux;
y = dy + (int) u.uy;
- if (isok(x, y)
- && (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
- && is_valid_jump_pos(x, y, jumping_is_magic, FALSE))
+ if (get_valid_jump_position(x, y))
tmp_at(x, y);
}
} else {
cc.x = u.ux;
cc.y = u.uy;
jumping_is_magic = magic;
- getpos_sethilite(display_jump_positions);
+ getpos_sethilite(display_jump_positions, get_valid_jump_position);
if (getpos(&cc, TRUE, "the desired position") < 0)
return 0; /* user pressed ESC */
if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) {
static int polearm_range_min = -1;
static int polearm_range_max = -1;
+boolean
+get_valid_polearm_position(x,y)
+int x,y;
+{
+ return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
+ && distu(x, y) >= polearm_range_min
+ && distu(x, y) <= polearm_range_max);
+}
+
void
display_polearm_positions(state)
int state;
for (dy = -4; dy <= 4; dy++) {
x = dx + (int) u.ux;
y = dy + (int) u.uy;
- if (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
- && distu(x, y) >= polearm_range_min
- && distu(x, y) <= polearm_range_max) {
+ if (get_valid_polearm_position(x, y)) {
tmp_at(x, y);
}
}
cc.x = hitm->mx;
cc.y = hitm->my;
}
- getpos_sethilite(display_polearm_positions);
+ getpos_sethilite(display_polearm_positions, get_valid_polearm_position);
if (getpos(&cc, TRUE, "the spot to hit") < 0)
return res; /* ESC; uses turn iff polearm became wielded */
{ NHKF_GETPOS_DOOR_PREV, 'D', "getpos.door.prev" },
{ NHKF_GETPOS_UNEX_NEXT, 'x', "getpos.unexplored.next" },
{ NHKF_GETPOS_UNEX_PREV, 'X', "getpos.unexplored.prev" },
+ { NHKF_GETPOS_VALID_NEXT, 'z', "getpos.valid.next" },
+ { NHKF_GETPOS_VALID_PREV, 'Z', "getpos.valid.prev" },
{ NHKF_GETPOS_INTERESTING_NEXT, 'a', "getpos.all.next" },
{ NHKF_GETPOS_INTERESTING_PREV, 'A', "getpos.all.prev" },
{ NHKF_GETPOS_HELP, '?', "getpos.help" },
* parameter value 0 = initialize, 1 = highlight, 2 = done
*/
static void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0;
+static boolean FDECL((*getpos_getvalid), (int,int)) = (boolean FDECL((*), (int,int))) 0;
void
-getpos_sethilite(f)
+getpos_sethilite(f, d)
void FDECL((*f), (int));
+boolean FDECL((*d), (int,int));
{
getpos_hilitefunc = f;
+ getpos_getvalid = d;
}
const char *const gloc_descr[NUM_GLOCS][4] = {
putstr(tmpwin, 0, sbuf);
if (!iflags.terrainmode) {
char kbuf[BUFSZ];
+ if (getpos_getvalid) {
+ Sprintf(sbuf, "Use '%s' or '%s' to move to valid locations.",
+ visctrl(Cmd.spkeys[NHKF_GETPOS_VALID_NEXT]),
+ visctrl(Cmd.spkeys[NHKF_GETPOS_VALID_PREV]));
+ putstr(tmpwin, 0, sbuf);
+ }
if (getpos_hilitefunc) {
Sprintf(sbuf, "Use '%s' to display valid locations.",
visctrl(Cmd.spkeys[NHKF_GETPOS_SHOWVALID]));
|| glyph_to_cmap(glyph) == S_darkroom
|| glyph_to_cmap(glyph) == S_corr
|| glyph_to_cmap(glyph) == S_litcorr));
+ case GLOC_VALID:
+ return (getpos_getvalid && getpos_getvalid(x,y));
}
/*NOTREACHED*/
return FALSE;
if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) {
(void) coord_desc(cx, cy, tmpbuf, iflags.getpos_coords);
custompline(SUPPRESS_HISTORY,
- "%s%s%s%s", firstmatch, *tmpbuf ? " " : "", tmpbuf,
+ "%s%s%s%s%s", firstmatch, *tmpbuf ? " " : "", tmpbuf,
+ (iflags.autodescribe && getpos_getvalid && !getpos_getvalid(cx,cy))
+ ? " (illegal)" : "",
(iflags.getloc_travelmode && !is_valid_travelpt(cx, cy))
? " (no travel path)" : "");
curs(WIN_MAP, cx, cy);
NHKF_GETPOS_UNEX_NEXT,
NHKF_GETPOS_UNEX_PREV,
NHKF_GETPOS_INTERESTING_NEXT,
- NHKF_GETPOS_INTERESTING_PREV
+ NHKF_GETPOS_INTERESTING_PREV,
+ NHKF_GETPOS_VALID_NEXT,
+ NHKF_GETPOS_VALID_PREV
};
char pick_chars[6];
- char mMoOdDxX[11];
+ char mMoOdDxX[13];
int result = 0;
int cx, cy, i, c;
int sidx, tx, ty;
if (garr[i])
free((genericptr_t) garr[i]);
getpos_hilitefunc = (void FDECL((*), (int))) 0;
+ getpos_getvalid = (boolean FDECL((*), (int,int))) 0;
return result;
}
return 0;
}
+boolean
+get_valid_stinking_cloud_pos(x,y)
+int x,y;
+{
+ return (!(!isok(x,y) || !cansee(x, y)
+ || !ACCESSIBLE(levl[x][y].typ)
+ || distu(x, y) >= 32));
+}
+
boolean
is_valid_stinking_cloud_pos(x, y, showmsg)
int x, y;
boolean showmsg;
{
- if (!cansee(x, y) || !ACCESSIBLE(levl[x][y].typ) || distu(x, y) >= 32) {
+ if (get_valid_stinking_cloud_pos(x,y)) {
if (showmsg)
You("smell rotten eggs.");
return FALSE;
for (dy = -dist; dy <= dist; dy++) {
x = u.ux + dx;
y = u.uy + dy;
- if (isok(x, y) && is_valid_stinking_cloud_pos(x, y, FALSE))
+ if (get_valid_stinking_cloud_pos(x,y))
tmp_at(x, y);
}
} else {
already_known ? "stinking " : "");
cc.x = u.ux;
cc.y = u.uy;
- getpos_sethilite(display_stinking_cloud_positions);
+ getpos_sethilite(display_stinking_cloud_positions, get_valid_stinking_cloud_pos);
if (getpos(&cc, TRUE, "the desired position") < 0) {
pline1(Never_mind);
break;