Skip to content

Commit

Permalink
Wand of probing reveals map locations in ray path
Browse files Browse the repository at this point in the history
  • Loading branch information
paxed committed Sep 18, 2023
1 parent 4f2c913 commit 44a649b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/fixes3-7-0.txt
Expand Up @@ -1236,6 +1236,7 @@ a pet that was poison resistant but not stoning resistant would eat Medusa's
ring of hunger prevents choking on your food
paranoid_confirm:pray can be changed to require yes/no response instead of y/n
by also setting paranoid_confirm:Confirm
wand of probing reveals map locations in the ray path


Fixes to 3.7.0-x General Problems Exposed Via git Repository
Expand Down
1 change: 1 addition & 0 deletions include/extern.h
Expand Up @@ -354,6 +354,7 @@ extern int monster_detect(struct obj *, int);
extern int trap_detect(struct obj *);
extern const char *level_distance(d_level *);
extern void use_crystal_ball(struct obj **);
extern void show_map_spot(coordxy, coordxy, boolean);
extern void do_mapping(void);
extern void do_vicinity_map(struct obj *);
extern void cvt_sdoor_to_door(struct rm *);
Expand Down
11 changes: 5 additions & 6 deletions src/detect.c
Expand Up @@ -23,7 +23,6 @@ static void sense_trap(struct trap *, coordxy, coordxy, int);
static int detect_obj_traps(struct obj *, boolean, int);
static void display_trap_map(struct trap *, int);
static int furniture_detect(void);
static void show_map_spot(coordxy, coordxy);
static void findone(coordxy, coordxy, genericptr_t);
static void openone(coordxy, coordxy, genericptr_t);
static int mfind0(struct monst *, boolean);
Expand Down Expand Up @@ -1323,15 +1322,15 @@ use_crystal_ball(struct obj **optr)
return;
}

static void
show_map_spot(coordxy x, coordxy y)
void
show_map_spot(coordxy x, coordxy y, boolean cnf)
{
struct rm *lev;
struct trap *t;
struct engr *ep;
int oldglyph;

if (Confusion && rn2(7))
if (cnf && rn2(7))
return;
lev = &levl[x][y];

Expand Down Expand Up @@ -1379,7 +1378,7 @@ do_mapping(void)
unconstrained = unconstrain_map();
for (zx = 1; zx < COLNO; zx++)
for (zy = 0; zy < ROWNO; zy++)
show_map_spot(zx, zy);
show_map_spot(zx, zy, Confusion);

if (!gl.level.flags.hero_memory || unconstrained) {
flush_screen(1); /* flush temp screen */
Expand Down Expand Up @@ -1452,7 +1451,7 @@ do_vicinity_map(struct obj *sobj) /* scroll--actually fake spellbook--object */
for (zy = lo_y; zy <= hi_y; zy++) {
oldglyph = glyph_at(zx, zy);
/* this will remove 'remembered, unseen mon' (and objects) */
show_map_spot(zx, zy);
show_map_spot(zx, zy, Confusion);
/* if there are any objects here, see the top one */
if (OBJ_AT(zx, zy)) {
/* not vobj_at(); this is not vision-based access;
Expand Down
16 changes: 16 additions & 0 deletions src/zap.c
Expand Up @@ -3639,6 +3639,22 @@ bhit(
}
if (learn_it)
learnwand(obj);
} else if (weapon == ZAPPED_WAND) {
boolean learn_it = FALSE;

if (obj->otyp == WAN_PROBING) {
if (!cansee(x, y)) {
int oldglyph = glyph_at(x, y);

show_map_spot(x, y, FALSE);
if (oldglyph != glyph_at(x, y)) {
/* TODO: need to give some message */
learn_it = TRUE;
}
}
}
if (learn_it)
learnwand(obj);
}

/* [shouldn't this trap handling be in zap_over_floor()?] */
Expand Down

0 comments on commit 44a649b

Please sign in to comment.