Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git c/include/display.h w/include/display.h
- index 233b840..09d36b3 100644
- --- c/include/display.h
- +++ w/include/display.h
- @@ -61,13 +61,13 @@
- #if 0
- #define mon_visible(mon) \
- (/* The hero can see the monster IF the monster */ \
- - (!mon->minvis || See_invisible) /* 1. is not invisible */ \
- + (!minvisible(mon) || See_invisible) /* 1. is not invisible */ \
- && !mon->mundetected /* AND 2. not an undetected hider */ \
- && !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */
- #else /* without 'mburied' and 'uburied' */
- #define mon_visible(mon) \
- (/* The hero can see the monster IF the monster */ \
- - (!mon->minvis || See_invisible) /* 1. is not invisible */ \
- + (!minvisible(mon) || See_invisible) /* 1. is not invisible */ \
- && !mon->mundetected) /* AND 2. not an undetected hider */
- #endif
- @@ -117,7 +117,8 @@
- */
- #define knowninvisible(mon) \
- (mtmp->minvis \
- - && ((cansee(mon->mx, mon->my) && (See_invisible || Detect_monsters)) \
- + && ((cansee(mon->mx, mon->my) && (See_invisible || Detect_monsters \
- + || candetect(mon->mx, mon->my))) \
- || (!Blind && (HTelepat & ~INTRINSIC) \
- && distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))
- diff --git c/include/extern.h w/include/extern.h
- index a1b32f7..d4448a2 100644
- --- c/include/extern.h
- +++ w/include/extern.h
- @@ -292,6 +292,7 @@ E void FDECL(use_crystal_ball, (struct obj **));
- E void NDECL(do_mapping);
- E void FDECL(do_vicinity_map, (struct obj *));
- E void FDECL(cvt_sdoor_to_door, (struct rm *));
- +E int FDECL(findone_core, (int, int));
- #ifdef USE_TRAMPOLI
- E void FDECL(findone, (int, int, genericptr_t));
- E void FDECL(openone, (int, int, genericptr_t));
- @@ -1094,7 +1095,7 @@ E void FDECL(obj_split_light_source, (struct obj *, struct obj *));
- E void FDECL(obj_merge_light_sources, (struct obj *, struct obj *));
- E void FDECL(obj_adjust_light_radius, (struct obj *, int));
- E int FDECL(candle_light_range, (struct obj *));
- -E int FDECL(arti_light_radius, (struct obj *));
- +E int FDECL(dynamic_light_radius, (struct obj *));
- E const char *FDECL(arti_light_description, (struct obj *));
- E int NDECL(wiz_light_sources);
- @@ -1451,6 +1452,7 @@ E void FDECL(setmangry, (struct monst *, BOOLEAN_P));
- E void FDECL(wakeup, (struct monst *, BOOLEAN_P));
- E void NDECL(wake_nearby);
- E void FDECL(wake_nearto, (int, int, int));
- +E void FDECL(seemimic_noredraw, (struct monst *));
- E void FDECL(seemimic, (struct monst *));
- E void NDECL(rescham);
- E void NDECL(restartcham);
- diff --git c/include/mkroom.h w/include/mkroom.h
- index 3439889..00de981 100644
- --- c/include/mkroom.h
- +++ w/include/mkroom.h
- @@ -34,7 +34,7 @@ struct shclass {
- struct itp {
- int iprob; /* probability of an item type */
- int itype; /* item type: if >=0 a class, if < 0 a specific item */
- - } iprobs[6];
- + } iprobs[7];
- const char *const *shknms; /* list of shopkeeper names for this type */
- };
- diff --git c/include/mondata.h w/include/mondata.h
- index 155ebfa..19e64d5 100644
- --- c/include/mondata.h
- +++ w/include/mondata.h
- @@ -86,6 +86,7 @@
- (lays_eggs(ptr) && (ptr)->mlet == S_EEL && is_swimmer(ptr))
- #define regenerates(ptr) (((ptr)->mflags1 & M1_REGEN) != 0L)
- #define perceives(ptr) (((ptr)->mflags1 & M1_SEE_INVIS) != 0L)
- +#define perceives_you(ptr) (perceives(ptr) || candetect(u.ux, u.uy))
- #define can_teleport(ptr) (((ptr)->mflags1 & M1_TPORT) != 0L)
- #define control_teleport(ptr) (((ptr)->mflags1 & M1_TPORT_CNTRL) != 0L)
- #define telepathic(ptr) \
- diff --git c/include/monst.h w/include/monst.h
- index 3a2c40c..63d234b 100644
- --- c/include/monst.h
- +++ w/include/monst.h
- @@ -187,6 +187,9 @@ struct monst {
- ((mon)->cham == PM_VAMPIRE || (mon)->cham == PM_VAMPIRE_LORD \
- || (mon)->cham == PM_VLAD_THE_IMPALER)
- +/* guiding candle makes monsters effectively visible */
- +#define minvisible(mon) ((mon)->minvis && !candetect((mon)->mx, (mon)->my))
- +
- /* mimic appearances that block vision/light */
- #define is_lightblocker_mappear(mon) \
- (is_obj_mappear(mon, BOULDER) \
- diff --git c/include/obj.h w/include/obj.h
- index 62e20b7..6796141 100644
- --- c/include/obj.h
- +++ w/include/obj.h
- @@ -302,7 +302,9 @@ struct obj {
- /* Light sources */
- #define Is_candle(otmp) \
- - (otmp->otyp == TALLOW_CANDLE || otmp->otyp == WAX_CANDLE)
- + (otmp->otyp == TALLOW_CANDLE || otmp->otyp == WAX_CANDLE \
- + || otmp->otyp == GUIDING_CANDLE)
- +#define candle_burn_time(otmp) ((otmp)->otyp == TALLOW_CANDLE ? 200L : 400L)
- #define MAX_OIL_IN_FLASK 400 /* maximum amount of oil in a potion of oil */
- /* MAGIC_LAMP intentionally excluded below */
- diff --git c/include/rm.h w/include/rm.h
- index 37b3fff..3602ef4 100644
- --- c/include/rm.h
- +++ w/include/rm.h
- @@ -395,6 +395,19 @@ extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
- #define W_NONDIGGABLE 0x08
- #define W_NONPASSWALL 0x10
- +/*
- + * Filled trapdoors in the Castle can be dug out again.
- + * Won't work on trapdoors under doorways because doors have their own flags,
- + * but currently this combination doesn't occur.
- + */
- +
- +#define FL_DIGGABLE 0x10
- +#define Can_dig_hole(x,y,z) (Can_dig_down(z) \
- + || Can_fall_thru(z) \
- + && level.locations[x][y].flags & FL_DIGGABLE \
- + && (level.locations[x][y].typ == ROOM \
- + || level.locations[x][y].typ == CORR))
- +
- /*
- * Ladders (in Vlad's tower) may be up or down.
- */
- @@ -426,7 +439,7 @@ struct rm {
- Bitfield(roomno, 6); /* room # for special rooms */
- Bitfield(edge, 1); /* marks boundaries for special rooms*/
- - Bitfield(candig, 1); /* Exception to Can_dig_down; was a trapdoor */
- + Bitfield(buried, 1); /* true iff there are buried objects here */
- };
- #define SET_TYPLIT(x, y, ttyp, llit) \
- diff --git c/include/vision.h w/include/vision.h
- index 4b1f1a7..e426a36 100644
- --- c/include/vision.h
- +++ w/include/vision.h
- @@ -14,12 +14,14 @@ extern char *viz_rmax; /* max could see indices */
- #define COULD_SEE 0x1 /* location could be seen, if it were lit */
- #define IN_SIGHT 0x2 /* location can be seen */
- #define TEMP_LIT 0x4 /* location is temporarily lit */
- +#define TEMP_DETECT 0x8 /* lit by a guiding candle */
- /*
- * Light source sources
- */
- #define LS_OBJECT 0
- #define LS_MONSTER 1
- +#define LS_DETECT 2 /* guiding candle */
- /*
- * cansee() - Returns true if the hero can see the location.
- @@ -30,6 +32,7 @@ extern char *viz_rmax; /* max could see indices */
- #define cansee(x, y) (viz_array[y][x] & IN_SIGHT)
- #define couldsee(x, y) (viz_array[y][x] & COULD_SEE)
- #define templit(x, y) (viz_array[y][x] & TEMP_LIT)
- +#define candetect(x, y) (viz_array[y][x] & TEMP_DETECT)
- /*
- * The following assume the monster is not blind.
- @@ -45,12 +48,12 @@ extern char *viz_rmax; /* max could see indices */
- #if 0
- #define m_canseeu(m) \
- - ((!Invis || perceives((m)->data)) \
- + ((!Invis || perceives_you((m)->data)) \
- && !(Underwater || u.uburied || (m)->mburied) \
- && couldsee((m)->mx, (m)->my))
- #else /* without 'uburied' and 'mburied' */
- #define m_canseeu(m) \
- - ((!Invis || perceives((m)->data)) \
- + ((!Invis || perceives_you((m)->data)) \
- && !Underwater \
- && couldsee((m)->mx, (m)->my))
- #endif
- diff --git c/include/youprop.h w/include/youprop.h
- index c9656aa..faae14f 100644
- --- c/include/youprop.h
- +++ w/include/youprop.h
- @@ -177,7 +177,7 @@
- #define EInvis u.uprops[INVIS].extrinsic
- #define BInvis u.uprops[INVIS].blocked
- #define Invis ((HInvis || EInvis) && !BInvis)
- -#define Invisible (Invis && !See_invisible)
- +#define Invisible (Invis && !See_invisible && !candetect(u.ux, u.uy))
- /* Note: invisibility also hides inventory and steed */
- #define EDisplaced u.uprops[DISPLACED].extrinsic
- diff --git c/src/allmain.c w/src/allmain.c
- index 5111c69..2757b0d 100644
- --- c/src/allmain.c
- +++ w/src/allmain.c
- @@ -336,6 +336,16 @@ boolean resuming;
- /* when/if hero escapes from lava, he can't just stay there */
- else if (!u.umoved)
- (void) pooleffects(FALSE);
- + if (candetect(u.ux, u.uy)
- + && (u.uundetected || U_AP_TYPE != M_AP_NOTHING)) {
- + if (multi < 0 && U_AP_TYPE == M_AP_OBJECT
- + && youmonst.data->mlet != S_MIMIC)
- + /* must be under effect of a mimic corpse */
- + unmul("Your disguise is disrupted!");
- + u.uundetected = 0;
- + youmonst.m_ap_type = M_AP_NOTHING;
- + newsym(u.ux, u.uy);
- + }
- } /* actual time passed */
- diff --git c/src/apply.c w/src/apply.c
- index e77984d..535bb71 100644
- --- c/src/apply.c
- +++ w/src/apply.c
- @@ -844,7 +844,7 @@ struct obj *obj;
- if (!getdir((char *) 0))
- return 0;
- - invis_mirror = Invis;
- + invis_mirror = Invis && !candetect(u.ux, u.uy);
- useeit = !Blind && (!invis_mirror || See_invisible);
- uvisage = beautiful();
- mirror = simpleonames(obj); /* "mirror" or "looking glass" */
- @@ -919,7 +919,7 @@ struct obj *obj;
- #define SEENMON (MONSEEN_NORMAL | MONSEEN_SEEINVIS | MONSEEN_INFRAVIS)
- how_seen = vis ? howmonseen(mtmp) : 0;
- /* whether monster is able to use its vision-based capabilities */
- - monable = !mtmp->mcan && (!mtmp->minvis || perceives(mtmp->data));
- + monable = !mtmp->mcan && (!minvisible(mtmp) || perceives(mtmp->data));
- mlet = mtmp->data->mlet;
- if (mtmp->msleeping) {
- if (vis)
- @@ -976,7 +976,7 @@ struct obj *obj;
- if (!tele_restrict(mtmp))
- (void) rloc(mtmp, TRUE);
- } else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
- - && (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
- + && (!minvisible(mtmp) || perceives(mtmp->data)) && rn2(5)) {
- boolean do_react = TRUE;
- if (mtmp->mfrozen) {
- @@ -992,9 +992,9 @@ struct obj *obj;
- monflee(mtmp, d(2, 4), FALSE, FALSE);
- }
- } else if (!Blind) {
- - if (mtmp->minvis && !See_invisible)
- + if (minvisible(mtmp) && !See_invisible)
- ;
- - else if ((mtmp->minvis && !perceives(mtmp->data))
- + else if ((minvisible(mtmp) && !perceives(mtmp->data))
- /* redundant: can't get here if these are true */
- || !haseyes(mtmp->data) || notonhead || !mtmp->mcansee)
- pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
- @@ -1232,6 +1232,9 @@ struct obj **optr;
- *optr = 0;
- You("attach %ld%s %s to %s.", obj->quan, !otmp->spe ? "" : " more", s,
- the(xname(otmp)));
- + if (objects[obj->otyp].oc_magic) /* hello SLASH'EM */
- + pline("%s very ordinary.", (obj->quan > 1L) ? "They look"
- + : "It looks");
- if (!otmp->spe || otmp->age > obj->age)
- otmp->age = obj->age;
- otmp->spe += (int) obj->quan;
- @@ -1330,6 +1333,12 @@ struct obj *obj;
- if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
- || obj->otyp == BRASS_LANTERN) && obj->cursed && !rn2(2))
- return FALSE;
- + if (obj->otyp == GUIDING_CANDLE && !obj->cursed) {
- + if (obj->age <= 10)
- + return FALSE;
- + else
- + obj->age -= 10;
- + }
- if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
- pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
- if (obj->otyp == POT_OIL)
- @@ -1352,6 +1361,7 @@ use_lamp(obj)
- struct obj *obj;
- {
- char buf[BUFSZ];
- + boolean wontburn = FALSE;
- if (obj->lamplit) {
- if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
- @@ -1376,7 +1386,15 @@ struct obj *obj;
- pline("This %s has no oil.", xname(obj));
- return;
- }
- - if (obj->cursed && !rn2(2)) {
- + if (obj->otyp == GUIDING_CANDLE && !obj->cursed) {
- + /* don't allow the candle to last the entire game
- + * by lighting it one turn at a time */
- + if (obj->age <= 10)
- + wontburn = TRUE;
- + else
- + obj->age -= 10;
- + }
- + if (wontburn || obj->cursed && !rn2(2)) {
- if (!Blind)
- pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
- otense(obj, "die"));
- @@ -1389,7 +1407,7 @@ struct obj *obj;
- pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
- otense(obj, "burn"), Blind ? "." : " brightly!");
- if (obj->unpaid && costly_spot(u.ux, u.uy)
- - && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
- + && obj->age == candle_burn_time(obj)) {
- const char *ithem = (obj->quan > 1L) ? "them" : "it";
- verbalize("You burn %s, you bought %s!", ithem, ithem);
- @@ -2131,7 +2149,7 @@ long timeout;
- /* [m_monnam() yields accurate mon type, overriding hallucination] */
- Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
- and_vanish[0] = '\0';
- - if ((mtmp->minvis && !See_invisible)
- + if ((minvisible(mtmp) && !See_invisible)
- || (mtmp->data->mlet == S_MIMIC
- && M_AP_TYPE(mtmp) != M_AP_NOTHING))
- suppress_see = TRUE;
- @@ -3437,8 +3455,7 @@ struct obj *obj;
- fillmsg = TRUE;
- } else
- digactualhole(x, y, BY_OBJECT, (rn2(obj->spe) < 3
- - || (!Can_dig_down(&u.uz)
- - && !levl[x][y].candig))
- + || !Can_dig_hole(x, y, &u.uz))
- ? PIT
- : HOLE);
- }
- @@ -3687,6 +3704,7 @@ doapply()
- break;
- case WAX_CANDLE:
- case TALLOW_CANDLE:
- + case GUIDING_CANDLE:
- use_candle(&obj);
- break;
- case OIL_LAMP:
- diff --git c/src/detect.c w/src/detect.c
- index dfac26a..89d2586 100644
- --- c/src/detect.c
- +++ w/src/detect.c
- @@ -1455,9 +1455,22 @@ STATIC_PTR void
- findone(zx, zy, num)
- int zx, zy;
- genericptr_t num;
- +{
- + int hits = findone_core(zx, zy);
- + if (hits > 0) {
- + (*(int *) num) += hits;
- + newsym(zx, zy);
- + }
- +}
- +
- +/* also used in display.c */
- +int
- +findone_core(zx, zy)
- +int zx, zy;
- {
- register struct trap *ttmp;
- register struct monst *mtmp;
- + int result = 0;
- /*
- * This used to use if/else-if/else-if/else/end-if but that only
- @@ -1469,42 +1482,41 @@ genericptr_t num;
- if (levl[zx][zy].typ == SDOOR) {
- cvt_sdoor_to_door(&levl[zx][zy]); /* .typ = DOOR */
- magic_map_background(zx, zy, 0);
- - newsym(zx, zy);
- - (*(int *) num)++;
- + result++;
- } else if (levl[zx][zy].typ == SCORR) {
- levl[zx][zy].typ = CORR;
- unblock_point(zx, zy);
- magic_map_background(zx, zy, 0);
- - newsym(zx, zy);
- - (*(int *) num)++;
- + result++;
- }
- if ((ttmp = t_at(zx, zy)) != 0 && !ttmp->tseen
- /* [shouldn't successful 'find' reveal and activate statue traps?] */
- && ttmp->ttyp != STATUE_TRAP) {
- ttmp->tseen = 1;
- - newsym(zx, zy);
- - (*(int *) num)++;
- + result++;
- }
- if ((mtmp = m_at(zx, zy)) != 0
- /* brings hidden monster out of hiding even if already sensed */
- && (!canspotmon(mtmp) || mtmp->mundetected || M_AP_TYPE(mtmp))) {
- if (M_AP_TYPE(mtmp)) {
- - seemimic(mtmp);
- - (*(int *) num)++;
- + seemimic_noredraw(mtmp);
- + result++;
- } else if (mtmp->mundetected && (is_hider(mtmp->data)
- || hides_under(mtmp->data)
- || mtmp->data->mlet == S_EEL)) {
- mtmp->mundetected = 0;
- newsym(zx, zy);
- - (*(int *) num)++;
- + result++;
- }
- if (!canspotmon(mtmp) && !glyph_is_invisible(levl[zx][zy].glyph))
- map_invisible(zx, zy);
- - } else if (unmap_invisible(zx, zy)) {
- - (*(int *) num)++;
- + } else if (glyph_is_invisible(levl[zx][zy].glyph)) {
- + unmap_object(zx, zy);
- + result++;
- }
- + return result;
- }
- STATIC_PTR void
- diff --git c/src/dig.c w/src/dig.c
- index 9b91f98..bd9e670 100644
- --- c/src/dig.c
- +++ w/src/dig.c
- @@ -219,7 +219,7 @@ int x, y;
- || (ttmp
- && (ttmp->ttyp == MAGIC_PORTAL
- || ttmp->ttyp == VIBRATING_SQUARE
- - || (!Can_dig_down(&u.uz) && !levl[x][y].candig)))) {
- + || !Can_dig_hole(x, y, &u.uz)))) {
- if (verbose)
- pline_The("%s here is too hard to %s.", surface(x, y), verb);
- return FALSE;
- @@ -579,7 +579,7 @@ int ttyp;
- return;
- }
- - if (ttyp != PIT && (!Can_dig_down(&u.uz) && !lev->candig)) {
- + if (ttyp != PIT && !Can_dig_hole(x, y, &u.uz)) {
- impossible("digactualhole: can't dig %s on this level.",
- defsyms[trap_to_defsym(ttyp)].explanation);
- ttyp = PIT;
- @@ -783,7 +783,7 @@ coord *cc;
- ttmp = t_at(dig_x, dig_y);
- lev = &levl[dig_x][dig_y];
- - nohole = (!Can_dig_down(&u.uz) && !lev->candig);
- + nohole = !Can_dig_hole(dig_x, dig_y, &u.uz);
- if ((ttmp && (ttmp->ttyp == MAGIC_PORTAL
- || ttmp->ttyp == VIBRATING_SQUARE || nohole))
- @@ -866,9 +866,9 @@ coord *cc;
- } else {
- typ = fillholetyp(dig_x, dig_y, FALSE);
- - lev->flags = 0;
- if (typ != ROOM) {
- lev->typ = typ;
- + lev->flags = 0;
- liquid_flow(dig_x, dig_y, typ, ttmp,
- "As you dig, the hole fills with %s!");
- return TRUE;
- @@ -1931,23 +1931,27 @@ int x, y;
- coord cc;
- debugpline2("unearth_objs: at <%d,%d>", x, y);
- - cc.x = x;
- - cc.y = y;
- - bball = buried_ball(&cc);
- - for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
- - otmp2 = otmp->nobj;
- - if (otmp->ox == x && otmp->oy == y) {
- - if (bball && otmp == bball
- - && u.utrap && u.utraptype == TT_BURIEDBALL) {
- - buried_ball_to_punishment();
- - } else {
- - obj_extract_self(otmp);
- - if (otmp->timed)
- - (void) stop_timer(ROT_ORGANIC, obj_to_any(otmp));
- - place_object(otmp, x, y);
- - stackobj(otmp);
- +
- + if (levl[x][y].buried) {
- + cc.x = x;
- + cc.y = y;
- + bball = buried_ball(&cc);
- + for (otmp = level.buriedobjlist; otmp; otmp = otmp2) {
- + otmp2 = otmp->nobj;
- + if (otmp->ox == x && otmp->oy == y) {
- + if (bball && otmp == bball
- + && u.utrap && u.utraptype == TT_BURIEDBALL) {
- + buried_ball_to_punishment();
- + } else {
- + obj_extract_self(otmp);
- + if (otmp->timed)
- + (void) stop_timer(ROT_ORGANIC, obj_to_any(otmp));
- + place_object(otmp, x, y);
- + stackobj(otmp);
- + }
- }
- }
- + levl[x][y].buried = 0;
- }
- del_engr_at(x, y);
- newsym(x, y);
- diff --git c/src/display.c w/src/display.c
- index 722c258..d021f03 100644
- --- c/src/display.c
- +++ w/src/display.c
- @@ -123,6 +123,7 @@
- */
- #include "hack.h"
- +STATIC_DCL void FDECL(map_buried, (int, int, int));
- STATIC_DCL void FDECL(show_mon_or_warn, (int, int, int));
- STATIC_DCL void FDECL(display_monster,
- (XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P));
- @@ -265,6 +266,26 @@ register int show;
- show_glyph(x, y, glyph);
- }
- +/*
- + * map_buried()
- + * Map the object buried under the specified tile.
- + * If there are several, we need to display the very last one
- + * to be consistent with object_detect().
- + */
- +
- +STATIC_OVL void
- +map_buried(x, y, show)
- +int x, y;
- +int show;
- +{
- + struct obj *obj, *last_obj = NULL;
- + for (obj = level.buriedobjlist; obj; obj = obj->nobj)
- + if (obj->ox == x && obj->oy == y)
- + last_obj = obj;
- + if (last_obj)
- + map_object(last_obj, show);
- +}
- +
- /*
- * map_invisible()
- *
- @@ -345,8 +366,11 @@ register int x, y;
- register struct obj *obj; \
- register struct trap *trap; \
- \
- - if ((obj = vobj_at(x, y)) && !covers_objects(x, y)) \
- + if ((obj = vobj_at(x, y)) && (!covers_objects(x, y) \
- + || candetect(x, y) && cansee(x, y))) \
- map_object(obj, show); \
- + else if (levl[x][y].buried && candetect(x, y) && cansee(x, y)) \
- + map_buried(x, y, show); \
- else if ((trap = t_at(x, y)) && trap->tseen && !covers_traps(x, y)) \
- map_trap(trap, show); \
- else \
- @@ -792,6 +816,10 @@ register int x, y;
- return;
- }
- + /* guiding candle! */
- + if (candetect(x,y))
- + findone_core(x,y);
- +
- if (x == u.ux && y == u.uy) {
- int see_self = canspotself();
- diff --git c/src/do_name.c w/src/do_name.c
- index f1d8d5b..7f23606 100644
- --- c/src/do_name.c
- +++ w/src/do_name.c
- @@ -1151,7 +1151,7 @@ do_mname()
- && (!(cansee(cx, cy) || see_with_infrared(mtmp))
- || mtmp->mundetected || M_AP_TYPE(mtmp) == M_AP_FURNITURE
- || M_AP_TYPE(mtmp) == M_AP_OBJECT
- - || (mtmp->minvis && !See_invisible)))) {
- + || (minvisible(mtmp) && !See_invisible)))) {
- pline("I see no monster there.");
- return;
- }
- diff --git c/src/do_wear.c w/src/do_wear.c
- index b48c69d..e2adbb9 100644
- --- c/src/do_wear.c
- +++ w/src/do_wear.c
- @@ -303,8 +303,9 @@ Cloak_on(VOID_ARGS)
- /* Note: it's already being worn, so we have to cheat here. */
- if ((HInvis || EInvis) && !Blind) {
- newsym(u.ux, u.uy);
- - You("can %s!", See_invisible ? "no longer see through yourself"
- - : see_yourself);
- + You("can %s!", See_invisible || candetect(u.ux, u.uy)
- + ? "no longer see through yourself"
- + : see_yourself);
- }
- break;
- case CLOAK_OF_INVISIBILITY:
- @@ -314,7 +315,7 @@ Cloak_on(VOID_ARGS)
- makeknown(uarmc->otyp);
- newsym(u.ux, u.uy);
- pline("Suddenly you can%s yourself.",
- - See_invisible ? " see through" : "not see");
- + !Invisible ? " see through" : "not see");
- }
- break;
- case OILSKIN_CLOAK:
- @@ -360,8 +361,8 @@ Cloak_off(VOID_ARGS)
- case MUMMY_WRAPPING:
- if (Invis && !Blind) {
- newsym(u.ux, u.uy);
- - You("can %s.", See_invisible ? "see through yourself"
- - : "no longer see yourself");
- + You("can %s.", !Invisible ? "see through yourself"
- + : "no longer see yourself");
- }
- break;
- case CLOAK_OF_INVISIBILITY:
- @@ -369,8 +370,9 @@ Cloak_off(VOID_ARGS)
- makeknown(CLOAK_OF_INVISIBILITY);
- newsym(u.ux, u.uy);
- pline("Suddenly you can %s.",
- - See_invisible ? "no longer see through yourself"
- - : see_yourself);
- + See_invisible || candetect(u.ux, u.uy)
- + ? "no longer see through yourself"
- + : see_yourself);
- }
- break;
- /* Alchemy smock gives poison _and_ acid resistance */
- @@ -932,7 +934,8 @@ register struct obj *obj;
- set_mimic_blocking(); /* do special mimic handling */
- see_monsters();
- - if (Invis && !oldprop && !HSee_invisible && !Blind) {
- + if (Invis && !oldprop && !HSee_invisible
- + && !Blind && !candetect(u.ux, u.uy)) {
- newsym(u.ux, u.uy);
- pline("Suddenly you are transparent, but there!");
- learnring(obj, TRUE);
- @@ -1056,7 +1059,8 @@ boolean gone;
- if (!Invis && !BInvis && !Blind) {
- newsym(u.ux, u.uy);
- Your("body seems to unfade%s.",
- - See_invisible ? " completely" : "..");
- + See_invisible || candetect(u.ux, u.uy) ? " completely"
- + : "..");
- learnring(obj, TRUE);
- }
- break;
- diff --git c/src/dogmove.c w/src/dogmove.c
- index df3452f..d3e55aa 100644
- --- c/src/dogmove.c
- +++ w/src/dogmove.c
- @@ -649,7 +649,7 @@ int maxdist;
- if ((targ = m_at(curx, cury)) != 0) {
- /* Is the monster visible to the pet? */
- - if ((!targ->minvis || perceives(mtmp->data))
- + if ((!minvisible(targ) || perceives(mtmp->data))
- && !targ->mundetected)
- break;
- /* If the pet can't see it, it assumes it aint there */
- @@ -692,7 +692,7 @@ int maxdist;
- if (pal) {
- if (pal->mtame) {
- /* Pet won't notice invisible pets */
- - if (!pal->minvis || perceives(mtmp->data))
- + if (!minvisible(pal) || perceives(mtmp->data))
- return 1;
- } else {
- /* Quest leaders and guardians are always seen */
- @@ -1007,7 +1007,7 @@ int after; /* this is extra fast monster movement */
- if ((int) mtmp2->m_lev >= (int) mtmp->m_lev + 2
- || (mtmp2->data == &mons[PM_FLOATING_EYE] && rn2(10)
- && mtmp->mcansee && haseyes(mtmp->data) && mtmp2->mcansee
- - && (perceives(mtmp->data) || !mtmp2->minvis))
- + && (perceives(mtmp->data) || !minvisible(mtmp2)))
- || (mtmp2->data == &mons[PM_GELATINOUS_CUBE] && rn2(10))
- || (max_passive_dmg(mtmp2, mtmp) >= mtmp->mhp)
- || ((mtmp->mhp * 4 < mtmp->mhpmax
- diff --git c/src/eat.c w/src/eat.c
- index 5e2aa1a..2fd812a 100644
- --- c/src/eat.c
- +++ w/src/eat.c
- @@ -1030,6 +1030,10 @@ int pm;
- /* A pile of gold can't ride. */
- if (u.usteed)
- dismount_steed(DISMOUNT_FELL);
- + if (candetect(u.ux, u.uy)) {
- + pline("But you can't stay hidden!");
- + break;
- + }
- nomul(-tmp);
- multi_reason = "pretending to be a pile of gold";
- Sprintf(buf,
- @@ -1972,15 +1976,14 @@ struct obj *otmp;
- set_mimic_blocking();
- see_monsters();
- if (Invis && !oldprop && !ESee_invisible
- - && !perceives(youmonst.data) && !Blind) {
- + && !perceives_you(youmonst.data) && !Blind) {
- newsym(u.ux, u.uy);
- pline("Suddenly you can see yourself.");
- makeknown(typ);
- }
- break;
- case RIN_INVISIBILITY:
- - if (!oldprop && !EInvis && !BInvis && !See_invisible
- - && !Blind) {
- + if (!oldprop && !EInvis && !BInvis && Invisible && !Blind) {
- newsym(u.ux, u.uy);
- Your("body takes on a %s transparency...",
- Hallucination ? "normal" : "strange");
- diff --git c/src/hack.c w/src/hack.c
- index 79fe740..6475486 100644
- --- c/src/hack.c
- +++ w/src/hack.c
- @@ -238,8 +238,10 @@ moverock()
- deltrap(ttmp);
- delobj(otmp);
- bury_objs(rx, ry);
- - levl[rx][ry].wall_info &= ~W_NONDIGGABLE;
- - levl[rx][ry].candig = 1;
- + if (!Can_dig_down(&u.uz)
- + && (levl[rx][ry].typ == ROOM
- + || levl[rx][ry].typ == CORR))
- + levl[rx][ry].flags |= FL_DIGGABLE;
- if (cansee(rx, ry))
- newsym(rx, ry);
- return sobj_at(BOULDER, sx, sy) ? -1 : 0;
- @@ -2707,7 +2709,8 @@ lookaround()
- if ((mtmp = m_at(x, y)) != 0
- && M_AP_TYPE(mtmp) != M_AP_FURNITURE
- && M_AP_TYPE(mtmp) != M_AP_OBJECT
- - && (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
- + && (!minvisible(mtmp) || See_invisible)
- + && !mtmp->mundetected) {
- if ((context.run != 1 && !mtmp->mtame)
- || (x == u.ux + u.dx && y == u.uy + u.dy
- && !context.travel)) {
- diff --git c/src/invent.c w/src/invent.c
- index 7e7e3b2..fc78123 100644
- --- c/src/invent.c
- +++ w/src/invent.c
- @@ -4438,6 +4438,9 @@ boolean as_if_seen;
- menu_item *selected = 0;
- int n;
- + if (!levl[x][y].buried)
- + return 0; /* nothing to do here */
- +
- /* count # of objects here */
- for (n = 0, obj = level.buriedobjlist; obj; obj = obj->nobj)
- if (obj->ox == x && obj->oy == y) {
- diff --git c/src/light.c w/src/light.c
- index 7c2dc1f..71ce7a3 100644
- --- c/src/light.c
- +++ w/src/light.c
- @@ -41,6 +41,7 @@
- /* flags */
- #define LSF_SHOW 0x1 /* display the light source */
- #define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
- +#define LSF_DETECT 0x4 /* guiding candle */
- static light_source *light_base = 0;
- @@ -71,9 +72,9 @@ anything *id;
- ls->x = x;
- ls->y = y;
- ls->range = range;
- - ls->type = type;
- + ls->type = type & ~LS_DETECT;
- ls->id = *id;
- - ls->flags = 0;
- + ls->flags = type & LS_DETECT ? LSF_DETECT : 0;
- light_base = ls;
- vision_full_recalc = 1; /* make the source show up */
- @@ -157,9 +158,10 @@ char **cs_rows;
- /* minor optimization: don't bother with duplicate light sources
- at hero */
- if (ls->x == u.ux && ls->y == u.uy) {
- - if (at_hero_range >= ls->range)
- - ls->flags &= ~LSF_SHOW;
- - else
- + if (at_hero_range >= ls->range) {
- + if (!(ls->flags & LSF_DETECT))
- + ls->flags &= ~LSF_SHOW;
- + } else
- at_hero_range = ls->range;
- }
- @@ -197,13 +199,19 @@ char **cs_rows;
- * does this.
- */
- for (x = min_x; x <= max_x; x++)
- - if (row[x] & COULD_SEE)
- + if (row[x] & COULD_SEE) {
- row[x] |= TEMP_LIT;
- + if (ls->flags & LSF_DETECT)
- + row[x] |= TEMP_DETECT;
- + }
- } else {
- for (x = min_x; x <= max_x; x++)
- if ((ls->x == x && ls->y == y)
- - || clear_path((int) ls->x, (int) ls->y, x, y))
- + || clear_path((int) ls->x, (int) ls->y, x, y)) {
- row[x] |= TEMP_LIT;
- + if (ls->flags & LSF_DETECT)
- + row[x] |= TEMP_DETECT;
- + }
- }
- }
- }
- @@ -676,10 +684,18 @@ struct obj *obj;
- int new_radius;
- {
- light_source *ls;
- + short old_flags;
- for (ls = light_base; ls; ls = ls->next)
- if (ls->type == LS_OBJECT && ls->id.a_obj == obj) {
- - if (new_radius != ls->range)
- + old_flags = ls->flags;
- + if (obj->otyp == GUIDING_CANDLE) {
- + if (obj->cursed)
- + ls->flags &= ~LSF_DETECT;
- + else
- + ls->flags |= LSF_DETECT;
- + }
- + if (new_radius != ls->range || ls->flags != old_flags)
- vision_full_recalc = 1;
- ls->range = new_radius;
- return;
- @@ -720,6 +736,8 @@ struct obj *obj;
- radius++;
- n /= 7L;
- } while (n > 0L);
- + if (obj->otyp == GUIDING_CANDLE && obj->blessed)
- + radius++; /* make them less useless in late game */
- } else {
- /* we're only called for lit candelabrum or candles */
- /* impossible("candlelight for %d?", obj->otyp); */
- @@ -730,7 +748,7 @@ struct obj *obj;
- /* light emitting artifact's range depends upon its curse/bless state */
- int
- -arti_light_radius(obj)
- +dynamic_light_radius(obj)
- struct obj *obj;
- {
- /*
- @@ -741,9 +759,12 @@ struct obj *obj;
- */
- /* sanity check [simplifies usage by bless()/curse()/&c] */
- - if (!obj->lamplit || !artifact_light(obj))
- + if (!obj->lamplit || !artifact_light(obj) && obj->otyp != GUIDING_CANDLE)
- return 0;
- + if (obj->otyp == GUIDING_CANDLE)
- + return candle_light_range(obj);
- +
- /* cursed radius of 1 is not noticeable for an item that's
- carried by the hero but is if it's carried by a monster
- or left lit on the floor (not applicable for Sunsword) */
- @@ -755,7 +776,7 @@ const char *
- arti_light_description(obj)
- struct obj *obj;
- {
- - switch (arti_light_radius(obj)) {
- + switch (dynamic_light_radius(obj)) {
- case 3:
- return "brilliantly"; /* blessed */
- case 2:
- diff --git c/src/mcastu.c w/src/mcastu.c
- index 1b2fb63..5d10ac1 100644
- --- c/src/mcastu.c
- +++ w/src/mcastu.c
- @@ -59,7 +59,7 @@ boolean undirected;
- if (undirected)
- point_msg = "all around, then curses";
- - else if ((Invis && !perceives(mtmp->data)
- + else if ((Invis && !perceives_you(mtmp->data)
- && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- || is_obj_mappear(&youmonst, STRANGE_OBJECT)
- || u.uundetected)
- @@ -264,7 +264,7 @@ boolean foundyou;
- canspotmon(mtmp) ? Monnam(mtmp) : "Something",
- is_undirected_spell(mattk->adtyp, spellnum)
- ? ""
- - : (Invis && !perceives(mtmp->data)
- + : (Invis && !perceives_you(mtmp->data)
- && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- ? " at a spot near you"
- : (Displaced
- @@ -414,7 +414,7 @@ int spellnum;
- /* messages not quite right if plural monsters created but
- only a single monster is seen */
- - if (Invis && !perceives(mtmp->data)
- + if (Invis && !perceives_you(mtmp->data)
- && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- pline("%s around a spot near you!", mappear);
- else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- @@ -463,7 +463,8 @@ int spellnum;
- if (!mtmp->minvis && !mtmp->invis_blkd) {
- if (canseemon(mtmp))
- pline("%s suddenly %s!", Monnam(mtmp),
- - !See_invisible ? "disappears" : "becomes transparent");
- + !See_invisible && !candetect(mtmp->mx, mtmp->my)
- + ? "disappears" : "becomes transparent");
- mon_set_minvis(mtmp);
- if (cansee(mtmp->mx, mtmp->my) && !canspotmon(mtmp))
- map_invisible(mtmp->mx, mtmp->my);
- @@ -640,7 +641,7 @@ int spellnum;
- fmt = "%s casts at a clump of sticks, but nothing happens.";
- else if (let == S_SNAKE)
- fmt = "%s transforms a clump of sticks into snakes!";
- - else if (Invis && !perceives(mtmp->data)
- + else if (Invis && !perceives_you(mtmp->data)
- && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- fmt = "%s summons insects around a spot near you!";
- else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy))
- diff --git c/src/mhitm.c w/src/mhitm.c
- index 5ebbd84..b58946c 100644
- --- c/src/mhitm.c
- +++ w/src/mhitm.c
- @@ -658,7 +658,7 @@ struct attack *mattk;
- }
- if (magr->mcan || !magr->mcansee || !mdef->mcansee
- - || (magr->minvis && !perceives(mdef->data)) || mdef->msleeping) {
- + || (minvisible(magr) && !perceives(mdef->data)) || mdef->msleeping) {
- if (vis && canspotmon(mdef))
- pline("but nothing happens.");
- return MM_MISS;
- @@ -674,7 +674,7 @@ struct attack *mattk;
- "The gaze is reflected away by %s %s.");
- return MM_MISS;
- }
- - if (mdef->minvis && !perceives(magr->data)) {
- + if (minvisible(mdef) && !perceives(magr->data)) {
- if (canseemon(magr)) {
- pline(
- "%s doesn't seem to notice that %s gaze was reflected.",
- @@ -1645,7 +1645,7 @@ int mdead;
- if (!rn2(4))
- tmp = 127;
- if (magr->mcansee && haseyes(madat) && mdef->mcansee
- - && (perceives(madat) || !mdef->minvis)) {
- + && (perceives(madat) || !minvisible(mdef))) {
- /* construct format string; guard against '%' in Monnam */
- Strcpy(buf, s_suffix(Monnam(mdef)));
- (void) strNsubst(buf, "%", "%%", 0);
- diff --git c/src/mhitu.c w/src/mhitu.c
- index 849ddb1..e5743d7 100644
- --- c/src/mhitu.c
- +++ w/src/mhitu.c
- @@ -159,7 +159,7 @@ struct attack *mattk;
- ? could_seduce(mtmp, &youmonst, mattk) : 0);
- Monst_name = Monnam(mtmp);
- - if (!mtmp->mcansee || (Invis && !perceives(mtmp->data))) {
- + if (!mtmp->mcansee || (Invis && !perceives_you(mtmp->data))) {
- const char *swings = (mattk->aatyp == AT_BITE) ? "snaps"
- : (mattk->aatyp == AT_KICK) ? "kicks"
- : (mattk->aatyp == AT_STNG
- @@ -573,7 +573,7 @@ register struct monst *mtmp;
- tmp += mtmp->m_lev;
- if (multi < 0)
- tmp += 4;
- - if ((Invis && !perceives(mdat)) || !mtmp->mcansee)
- + if ((Invis && !perceives_you(mdat)) || !mtmp->mcansee)
- tmp -= 2;
- if (mtmp->mtrapped)
- tmp -= 2;
- @@ -2392,16 +2392,18 @@ struct attack *mattk; /* non-Null: current attack; Null: general capability */
- pagr = youmonst.data;
- agrinvis = (Invis != 0);
- genagr = poly_gender();
- + defperc = candetect(u.ux, u.uy);
- } else {
- pagr = magr->data;
- agrinvis = magr->minvis;
- genagr = gender(magr);
- + defperc = candetect(magr->mx, magr->my);
- }
- if (mdef == &youmonst) {
- - defperc = (See_invisible != 0);
- + defperc = defperc || See_invisible;
- gendef = poly_gender();
- } else {
- - defperc = perceives(mdef->data);
- + defperc = defperc || perceives(mdef->data);
- gendef = gender(mdef);
- }
- @@ -2883,7 +2885,7 @@ struct attack *mattk;
- if (!rn2(4))
- tmp = 127;
- if (mtmp->mcansee && haseyes(mtmp->data) && rn2(3)
- - && (perceives(mtmp->data) || !Invis)) {
- + && (perceives_you(mtmp->data) || !Invis)) {
- if (Blind)
- pline("As a blind %s, you cannot defend yourself.",
- youmonst.data->mname);
- diff --git c/src/mkobj.c w/src/mkobj.c
- index 17265ff..b80cfde 100644
- --- c/src/mkobj.c
- +++ w/src/mkobj.c
- @@ -10,6 +10,7 @@ STATIC_DCL unsigned FDECL(nextoid, (struct obj *, struct obj *));
- STATIC_DCL void FDECL(maybe_adjust_light, (struct obj *, int));
- STATIC_DCL void FDECL(obj_timer_checks, (struct obj *,
- XCHAR_P, XCHAR_P, int));
- +STATIC_DCL void FDECL(recheck_buried, (int, int));
- STATIC_DCL void FDECL(container_weight, (struct obj *));
- STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *));
- STATIC_DCL void FDECL(objlist_sanity, (struct obj *, int, const char *));
- @@ -898,11 +899,12 @@ boolean artif;
- switch (otmp->otyp) {
- case TALLOW_CANDLE:
- case WAX_CANDLE:
- - otmp->spe = 1;
- - otmp->age = 20L * /* 400 or 200 */
- - (long) objects[otmp->otyp].oc_cost;
- - otmp->lamplit = 0;
- otmp->quan = 1L + (long) (rn2(2) ? rn2(7) : 0);
- + /*FALLTHRU*/
- + case GUIDING_CANDLE:
- + otmp->spe = 1;
- + otmp->age = candle_burn_time(otmp);
- + otmp->lamplit = 0;
- blessorcurse(otmp, 5);
- break;
- case BRASS_LANTERN:
- @@ -1230,12 +1232,13 @@ int old_range;
- {
- char buf[BUFSZ];
- xchar ox, oy;
- - int new_range = arti_light_radius(obj), delta = new_range - old_range;
- + int new_range = dynamic_light_radius(obj), delta = new_range - old_range;
- /* radius of light emitting artifact varies by curse/bless state
- so will change after blessing or cursing */
- - if (delta) {
- + if (new_range)
- obj_adjust_light_radius(obj, new_range);
- + if (delta) {
- /* simplifying assumptions: hero is wielding this object;
- artifacts have to be in use to emit light and monsters'
- gear won't change bless or curse state */
- @@ -1252,7 +1255,8 @@ int old_range;
- when changing intensity, using "less brightly" is
- straightforward for dimming, but we need "brighter"
- rather than "more brightly" for brightening; ugh */
- - pline("%s %s %s%s.", buf, otense(obj, "shine"),
- + pline("%s %s %s%s.", buf, otense(obj, Is_candle(obj)
- + ? "burn" : "shine"),
- (abs(delta) > 1) ? "much " : "",
- (delta > 0) ? "brighter" : "less brightly");
- }
- @@ -1275,7 +1279,7 @@ register struct obj *otmp;
- if (otmp->oclass == COIN_CLASS)
- return;
- if (otmp->lamplit)
- - old_light = arti_light_radius(otmp);
- + old_light = dynamic_light_radius(otmp);
- otmp->cursed = 0;
- otmp->blessed = 1;
- if (carried(otmp) && confers_luck(otmp))
- @@ -1296,7 +1300,7 @@ register struct obj *otmp;
- int old_light = 0;
- if (otmp->lamplit)
- - old_light = arti_light_radius(otmp);
- + old_light = dynamic_light_radius(otmp);
- otmp->blessed = 0;
- if (carried(otmp) && confers_luck(otmp))
- set_moreluck();
- @@ -1316,7 +1320,7 @@ register struct obj *otmp;
- if (otmp->oclass == COIN_CLASS)
- return;
- if (otmp->lamplit)
- - old_light = arti_light_radius(otmp);
- + old_light = dynamic_light_radius(otmp);
- already_cursed = otmp->cursed;
- otmp->blessed = 0;
- otmp->cursed = 1;
- @@ -1353,7 +1357,7 @@ register struct obj *otmp;
- int old_light = 0;
- if (otmp->lamplit)
- - old_light = arti_light_radius(otmp);
- + old_light = dynamic_light_radius(otmp);
- otmp->cursed = 0;
- if (carried(otmp) && confers_luck(otmp))
- set_moreluck();
- @@ -1808,7 +1812,7 @@ boolean do_buried;
- if (otmp->timed)
- obj_timer_checks(otmp, x, y, 0);
- }
- - if (do_buried) {
- + if (do_buried && levl[x][y].buried) {
- for (otmp = level.buriedobjlist; otmp; otmp = otmp->nobj) {
- if (otmp->ox == x && otmp->oy == y) {
- if (otmp->timed)
- @@ -1995,6 +1999,7 @@ struct obj *obj;
- break;
- case OBJ_BURIED:
- extract_nobj(obj, &level.buriedobjlist);
- + recheck_buried(obj->ox, obj->oy);
- break;
- case OBJ_ONBILL:
- extract_nobj(obj, &billobjs);
- @@ -2135,6 +2140,25 @@ struct obj *obj;
- obj->where = OBJ_BURIED;
- obj->nobj = level.buriedobjlist;
- level.buriedobjlist = obj;
- + levl[obj->ox][obj->oy].buried = 1;
- +}
- +
- +/*
- + * Revalidate the buried flag. Useful e.g. if we just removed
- + * a single buried object and don't know if there are others here.
- + */
- +STATIC_OVL void
- +recheck_buried(x, y)
- +int x, y;
- +{
- + struct obj *obj;
- + for (obj = level.buriedobjlist; obj; obj = obj->nobj)
- + if (obj->ox == x && obj->oy == y)
- + {
- + levl[x][y].buried = 1;
- + return;
- + }
- + levl[x][y].buried = 0;
- }
- /* Recalculate the weight of this container and all of _its_ containers. */
- diff --git c/src/mon.c w/src/mon.c
- index 4f0a13d..46aea52 100644
- --- c/src/mon.c
- +++ w/src/mon.c
- @@ -1415,7 +1415,7 @@ long flag;
- && (lavaok || !is_lava(nx, ny))) {
- int dispx, dispy;
- boolean monseeu = (mon->mcansee
- - && (!Invis || perceives(mdat)));
- + && (!Invis || perceives_you(mdat)));
- boolean checkobj = OBJ_AT(nx, ny);
- /* Displacement also displaces the Elbereth/scare monster,
- @@ -3077,9 +3077,9 @@ int x, y, distance;
- }
- }
- -/* NOTE: we must check for mimicry before calling this routine */
- +/* also used in detect.c */
- void
- -seemimic(mtmp)
- +seemimic_noredraw(mtmp)
- register struct monst *mtmp;
- {
- boolean is_blocker_appear = (is_lightblocker_mappear(mtmp));
- @@ -3096,7 +3096,14 @@ register struct monst *mtmp;
- if (is_blocker_appear
- && !does_block(mtmp->mx, mtmp->my, &levl[mtmp->mx][mtmp->my]))
- unblock_point(mtmp->mx, mtmp->my);
- +}
- +/* NOTE: we must check for mimicry before calling this routine */
- +void
- +seemimic(mtmp)
- +register struct monst *mtmp;
- +{
- + seemimic_noredraw(mtmp);
- newsym(mtmp->mx, mtmp->my);
- }
- @@ -3138,7 +3145,7 @@ restartcham()
- if (!mtmp->mcan)
- mtmp->cham = pm_to_cham(monsndx(mtmp->data));
- if (mtmp->data->mlet == S_MIMIC && mtmp->msleeping
- - && cansee(mtmp->mx, mtmp->my)) {
- + && cansee(mtmp->mx, mtmp->my) && !candetect(mtmp->mx, mtmp->my)) {
- set_mimic_sym(mtmp);
- newsym(mtmp->mx, mtmp->my);
- }
- @@ -3175,7 +3182,7 @@ register struct monst *mtmp;
- struct trap *t;
- if (mtmp->mcan || M_AP_TYPE(mtmp) || cansee(mtmp->mx, mtmp->my)
- - || rn2(3) || mtmp == u.ustuck
- + || candetect(mtmp->mx, mtmp->my) || rn2(3) || mtmp == u.ustuck
- /* can't hide while trapped except in pits */
- || (mtmp->mtrapped && (t = t_at(mtmp->mx, mtmp->my)) != 0
- && !is_pit(t->ttyp))
- @@ -3208,6 +3215,8 @@ struct monst *mtmp;
- : (mtmp->mtrapped && (t = t_at(x, y)) != 0
- && !is_pit(t->ttyp))) {
- ; /* can't hide while stuck in a non-pit trap */
- + } else if (candetect(x, y)) {
- + ; /* guiding candle blocks hiding */
- } else if (mtmp->data->mlet == S_EEL) {
- undetected = (is_pool(x, y) && !Is_waterlevel(&u.uz));
- } else if (hides_under(mtmp->data) && OBJ_AT(x, y)) {
- diff --git c/src/monmove.c w/src/monmove.c
- index cd6ca98..a5a0a4d 100644
- --- c/src/monmove.c
- +++ w/src/monmove.c
- @@ -330,7 +330,7 @@ int *inrange, *nearby, *scared;
- * running into you by accident but possibly attacking the spot
- * where it guesses you are.
- */
- - if (!mtmp->mcansee || (Invis && !perceives(mtmp->data))) {
- + if (!mtmp->mcansee || (Invis && !perceives_you(mtmp->data))) {
- seescaryx = mtmp->mux;
- seescaryy = mtmp->muy;
- } else {
- @@ -913,7 +913,7 @@ register int after;
- && (dist2(omx, omy, gx, gy) <= 36));
- if (!mtmp->mcansee
- - || (should_see && Invis && !perceives(ptr) && rn2(11))
- + || (should_see && Invis && !perceives_you(ptr) && rn2(11))
- || is_obj_mappear(&youmonst,STRANGE_OBJECT) || u.uundetected
- || (is_obj_mappear(&youmonst,GOLD_PIECE) && !likes_gold(ptr))
- || (mtmp->mpeaceful && !mtmp->isshk) /* allow shks to follow */
- @@ -1550,7 +1550,7 @@ register struct monst *mtmp;
- if (mx == u.ux && my == u.uy)
- goto found_you;
- - notseen = (!mtmp->mcansee || (Invis && !perceives(mtmp->data)));
- + notseen = (!mtmp->mcansee || (Invis && !perceives_you(mtmp->data)));
- /* add cases as required. eg. Displacement ... */
- if (notseen || Underwater) {
- /* Xorns can smell quantities of valuable metal
- diff --git c/src/mthrowu.c w/src/mthrowu.c
- index 7ecbbb2..5584e44 100644
- --- c/src/mthrowu.c
- +++ w/src/mthrowu.c
- @@ -1180,8 +1180,8 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
- break;
- case TOOL_CLASS:
- hits = (obj_type != SKELETON_KEY && obj_type != LOCK_PICK
- - && obj_type != CREDIT_CARD && obj_type != TALLOW_CANDLE
- - && obj_type != WAX_CANDLE && obj_type != LENSES
- + && obj_type != CREDIT_CARD && !Is_candle(otmp)
- + && obj_type != LENSES
- && obj_type != TIN_WHISTLE && obj_type != MAGIC_WHISTLE);
- break;
- case ROCK_CLASS: /* includes boulder */
- diff --git c/src/muse.c w/src/muse.c
- index 2dfb92f..8732cc6 100644
- --- c/src/muse.c
- +++ w/src/muse.c
- @@ -755,7 +755,7 @@ struct monst *mtmp;
- pline_The("digging ray is ineffective.");
- return 2;
- }
- - if (!Can_dig_down(&u.uz) && !levl[mtmp->mx][mtmp->my].candig) {
- + if (!Can_dig_hole(mtmp->mx, mtmp->my, &u.uz)) {
- if (canseemon(mtmp))
- pline_The("%s here is too hard to dig in.",
- surface(mtmp->mx, mtmp->my));
- diff --git c/src/objects.c w/src/objects.c
- index fcca3b0..a3f8c99 100644
- --- c/src/objects.c
- +++ w/src/objects.c
- @@ -658,8 +658,9 @@ TOOL("skeleton key", "key", 0, 0, 0, 0, 80, 3, 10, IRON, HI_METAL),
- TOOL("lock pick", None, 1, 0, 0, 0, 60, 4, 20, IRON, HI_METAL),
- TOOL("credit card", None, 1, 0, 0, 0, 15, 1, 10, PLASTIC, CLR_WHITE),
- /* light sources */
- -TOOL("tallow candle", "candle", 0, 1, 0, 0, 20, 2, 10, WAX, CLR_WHITE),
- +TOOL("tallow candle", "candle", 0, 1, 0, 0, 17, 2, 10, WAX, CLR_WHITE),
- TOOL("wax candle", "candle", 0, 1, 0, 0, 5, 2, 20, WAX, CLR_WHITE),
- +TOOL("guiding candle", "candle", 0, 1, 1, 0, 3, 2, 30, WAX, CLR_WHITE),
- TOOL("brass lantern", None, 1, 0, 0, 0, 30, 30, 12, COPPER, CLR_YELLOW),
- TOOL("oil lamp", "lamp", 0, 0, 0, 0, 45, 20, 10, COPPER, CLR_YELLOW),
- TOOL("magic lamp", "lamp", 0, 0, 1, 0, 15, 20, 50, COPPER, CLR_YELLOW),
- diff --git c/src/objnam.c w/src/objnam.c
- index 7205bb4..60e003d 100644
- --- c/src/objnam.c
- +++ w/src/objnam.c
- @@ -1111,8 +1111,7 @@ unsigned doname_flags;
- break;
- } else if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
- || obj->otyp == BRASS_LANTERN || Is_candle(obj)) {
- - if (Is_candle(obj)
- - && obj->age < 20L * (long) objects[obj->otyp].oc_cost)
- + if (Is_candle(obj) && obj->age < candle_burn_time(obj))
- Strcat(prefix, "partly used ");
- if (obj->lamplit)
- Strcat(bp, " (lit)");
- @@ -2754,7 +2753,7 @@ struct o_range {
- STATIC_OVL NEARDATA const struct o_range o_ranges[] = {
- { "bag", TOOL_CLASS, SACK, BAG_OF_TRICKS },
- { "lamp", TOOL_CLASS, OIL_LAMP, MAGIC_LAMP },
- - { "candle", TOOL_CLASS, TALLOW_CANDLE, WAX_CANDLE },
- + { "candle", TOOL_CLASS, TALLOW_CANDLE, GUIDING_CANDLE },
- { "horn", TOOL_CLASS, TOOLED_HORN, HORN_OF_PLENTY },
- { "shield", ARMOR_CLASS, SMALL_SHIELD, SHIELD_OF_REFLECTION },
- { "hat", ARMOR_CLASS, FEDORA, DUNCE_CAP },
- @@ -3846,7 +3845,8 @@ struct obj *no_wish;
- /* if player specified a reasonable count, maybe honor it */
- if (cnt > 0 && objects[typ].oc_merge
- - && (wizard || cnt < rnd(6) || (cnt <= 7 && Is_candle(otmp))
- + && (wizard || cnt < rnd(6) || (cnt <= 7 && Is_candle(otmp)
- + && !objects[typ].oc_magic)
- || (cnt <= 20 && ((oclass == WEAPON_CLASS && is_ammo(otmp))
- || typ == ROCK || is_missile(otmp)))))
- otmp->quan = (long) cnt;
- diff --git c/src/pager.c w/src/pager.c
- index 7f14b0f..f564387 100644
- --- c/src/pager.c
- +++ w/src/pager.c
- @@ -167,7 +167,7 @@ struct obj **obj_p;
- *obj_p = (struct obj *) 0;
- /* TODO: check inside containers in case glyph came from detection */
- - if ((otmp = sobj_at(glyphotyp, x, y)) == 0)
- + if ((otmp = sobj_at(glyphotyp, x, y)) == 0 && levl[x][y].buried)
- for (otmp = level.buriedobjlist; otmp; otmp = otmp->nobj)
- if (otmp->ox == x && otmp->oy == y && otmp->otyp == glyphotyp)
- break;
- diff --git c/src/polyself.c w/src/polyself.c
- index b053091..4158acc 100644
- --- c/src/polyself.c
- +++ w/src/polyself.c
- @@ -1355,9 +1355,9 @@ dogaze()
- continue;
- if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
- looked++;
- - if (Invis && !perceives(mtmp->data)) {
- + if (Invis && !perceives_you(mtmp->data)) {
- pline("%s seems not to notice your gaze.", Monnam(mtmp));
- - } else if (mtmp->minvis && !See_invisible) {
- + } else if (minvisible(mtmp) && !See_invisible) {
- You_cant("see where to gaze at %s.", Monnam(mtmp));
- } else if (M_AP_TYPE(mtmp) == M_AP_FURNITURE
- || M_AP_TYPE(mtmp) == M_AP_OBJECT) {
- @@ -1505,6 +1505,11 @@ dohide()
- /* TODO? inhibit floor hiding at furniture locations, or
- * else make youhiding() give smarter messages at such spots.
- */
- + if (candetect(u.ux, u.uy))
- + {
- + You("try to hide, but cannot maintain your disguise!");
- + return 1;
- + }
- if (u.uundetected || (ismimic && U_AP_TYPE != M_AP_NOTHING)) {
- youhiding(FALSE, 1); /* "you are already hiding" */
- diff --git c/src/potion.c w/src/potion.c
- index c6dffc5..dd75432 100644
- --- c/src/potion.c
- +++ w/src/potion.c
- @@ -457,7 +457,8 @@ self_invis_message()
- pline("%s %s.",
- Hallucination ? "Far out, man! You"
- : "Gee! All of a sudden, you",
- - See_invisible ? "can see right through yourself"
- + See_invisible || candetect(u.ux, u.uy)
- + ? "can see right through yourself"
- : "can't see yourself");
- }
- @@ -1707,8 +1708,9 @@ register struct obj *obj;
- if (!Blind && !Invis) {
- kn++;
- pline("For an instant you %s!",
- - See_invisible ? "could see right through yourself"
- - : "couldn't see yourself");
- + See_invisible || candetect(u.ux, u.uy)
- + ? "could see right through yourself"
- + : "couldn't see yourself");
- }
- break;
- case POT_PARALYSIS:
- diff --git c/src/priest.c w/src/priest.c
- index ab20a8d..5b1cd9d 100644
- --- c/src/priest.c
- +++ w/src/priest.c
- @@ -215,7 +215,7 @@ register struct monst *priest;
- }
- avoid = FALSE;
- }
- - } else if (Invis)
- + } else if (Invis && !perceives_you(priest->data))
- avoid = FALSE;
- return move_special(priest, FALSE, TRUE, FALSE, avoid, omx, omy, gx, gy);
- diff --git c/src/save.c w/src/save.c
- index e0af4b8..40fd0dd 100644
- --- c/src/save.c
- +++ w/src/save.c
- @@ -602,7 +602,7 @@ boolean rlecomp;
- && prm->flags == rgrm->flags && prm->lit == rgrm->lit
- && prm->waslit == rgrm->waslit
- && prm->roomno == rgrm->roomno && prm->edge == rgrm->edge
- - && prm->candig == rgrm->candig) {
- + && prm->buried == rgrm->buried) {
- match++;
- if (match > 254) {
- match = 254; /* undo this match */
- diff --git c/src/shk.c w/src/shk.c
- index 6772da4..0467acb 100644
- --- c/src/shk.c
- +++ w/src/shk.c
- @@ -580,7 +580,7 @@ char *enterstring;
- if (muteshk(shkp) || eshkp->following)
- return; /* no dialog */
- - if (Invis) {
- + if (Invis && !perceives_you(shkp->data)) {
- pline("%s senses your presence.", Shknam(shkp));
- if (!Deaf && !muteshk(shkp))
- verbalize("Invisible customers are not welcome!");
- @@ -2203,8 +2203,7 @@ boolean unpaid_only;
- if (saleable(shkp, otmp) && !otmp->unpaid
- && otmp->oclass != BALL_CLASS
- && !(otmp->oclass == FOOD_CLASS && otmp->oeaten)
- - && !(Is_candle(otmp)
- - && otmp->age < 20L * (long) objects[otmp->otyp].oc_cost))
- + && !(Is_candle(otmp) && otmp->age < candle_burn_time(otmp)))
- price += set_cost(otmp, shkp);
- } else {
- /* no_charge is only set for floor items (including
- @@ -3151,8 +3150,7 @@ xchar x, y;
- if ((!saleitem && !(container && cltmp > 0L)) || eshkp->billct == BILLSZ
- || obj->oclass == BALL_CLASS || obj->oclass == CHAIN_CLASS
- || offer == 0L || (obj->oclass == FOOD_CLASS && obj->oeaten)
- - || (Is_candle(obj)
- - && obj->age < 20L * (long) objects[obj->otyp].oc_cost)) {
- + || (Is_candle(obj) && obj->age < candle_burn_time(obj))) {
- pline("%s seems uninterested%s.", Shknam(shkp),
- cgold ? " in the rest" : "");
- if (container)
- @@ -3420,8 +3418,7 @@ boolean shk_buying;
- tmp += 10L * (long) obj->spe;
- break;
- case TOOL_CLASS:
- - if (Is_candle(obj)
- - && obj->age < 20L * (long) objects[obj->otyp].oc_cost)
- + if (Is_candle(obj) && obj->age < candle_burn_time(obj))
- tmp /= 2L;
- break;
- }
- @@ -3895,7 +3892,7 @@ struct monst *shkp;
- avoid = FALSE;
- } else {
- #define GDIST(x, y) (dist2(x, y, gx, gy))
- - if (Invis || u.usteed) {
- + if (Invis && !perceives_you(shkp->data) || u.usteed) {
- avoid = FALSE;
- } else {
- uondoor = (u.ux == eshkp->shd.x && u.uy == eshkp->shd.y);
- @@ -4225,7 +4222,7 @@ boolean cant_mollify;
- return;
- }
- - if (Invis)
- + if (Invis && !perceives_you(shkp->data))
- Your("invisibility does not fool %s!", shkname(shkp));
- Sprintf(qbuf, "%sYou did %ld %s worth of damage!%s Pay?",
- !animal ? cad(TRUE) : "", cost_of_damage,
- @@ -4679,7 +4676,8 @@ register xchar x, y;
- && shkp->mcanmove && !shkp->msleeping
- && (ESHK(shkp)->debit || ESHK(shkp)->billct || ESHK(shkp)->robbed)) {
- pline("%s%s blocks your way!", Shknam(shkp),
- - Invis ? " senses your motion and" : "");
- + Invis && !perceives_you(shkp->data) ? " senses your motion and"
- + : "");
- return TRUE;
- }
- return FALSE;
- @@ -4713,10 +4711,11 @@ register xchar x, y;
- if (shkp->mx == sx && shkp->my == sy && shkp->mcanmove && !shkp->msleeping
- && (x == sx - 1 || x == sx + 1 || y == sy - 1 || y == sy + 1)
- - && (Invis || carrying(PICK_AXE) || carrying(DWARVISH_MATTOCK)
- - || u.usteed)) {
- + && (Invis && !perceives_you(shkp->data) || carrying(PICK_AXE)
- + || carrying(DWARVISH_MATTOCK) || u.usteed)) {
- pline("%s%s blocks your way!", Shknam(shkp),
- - Invis ? " senses your motion and" : "");
- + Invis && !perceives_you(shkp->data) ? " senses your motion and"
- + : "");
- return TRUE;
- }
- return FALSE;
- diff --git c/src/shknam.c w/src/shknam.c
- index a36b67e..cb54cc7 100644
- --- c/src/shknam.c
- +++ w/src/shknam.c
- @@ -330,8 +330,9 @@ const struct shclass shtypes[] = {
- TOOL_CLASS,
- 0,
- D_SHOP,
- - { { 30, -WAX_CANDLE },
- - { 48, -TALLOW_CANDLE },
- + { { 25, -WAX_CANDLE },
- + { 38, -TALLOW_CANDLE },
- + { 15, -GUIDING_CANDLE },
- { 5, -BRASS_LANTERN },
- { 9, -OIL_LAMP },
- { 3, -MAGIC_LAMP },
- diff --git c/src/timeout.c w/src/timeout.c
- index f9df132..c8e136f 100644
- --- c/src/timeout.c
- +++ w/src/timeout.c
- @@ -624,7 +624,7 @@ nh_timeout()
- case INVIS:
- newsym(u.ux, u.uy);
- if (!Invis && !BInvis && !Blind) {
- - You(!See_invisible
- + You(!See_invisible && !candetect(u.ux, u.uy)
- ? "are no longer invisible."
- : "can no longer see through yourself.");
- stop_occupation();
- @@ -1282,6 +1282,7 @@ long timeout;
- case CANDELABRUM_OF_INVOCATION:
- case TALLOW_CANDLE:
- case WAX_CANDLE:
- + case GUIDING_CANDLE:
- switch (obj->age) {
- case 75:
- if (canseeit)
- @@ -1444,6 +1445,7 @@ boolean already_lit;
- int radius = 3;
- long turns = 0;
- boolean do_timer = TRUE;
- + boolean detect = FALSE;
- if (obj->age == 0 && obj->otyp != MAGIC_LAMP && !artifact_light(obj))
- return;
- @@ -1476,6 +1478,10 @@ boolean already_lit;
- turns = obj->age;
- break;
- + case GUIDING_CANDLE:
- + if (!obj->cursed)
- + detect = TRUE;
- + /* fall through */
- case CANDELABRUM_OF_INVOCATION:
- case TALLOW_CANDLE:
- case WAX_CANDLE:
- @@ -1494,7 +1500,7 @@ boolean already_lit;
- if (artifact_light(obj)) {
- obj->lamplit = 1;
- do_timer = FALSE;
- - radius = arti_light_radius(obj);
- + radius = dynamic_light_radius(obj);
- } else {
- impossible("begin burn: unexpected %s", xname(obj));
- turns = obj->age;
- @@ -1520,7 +1526,9 @@ boolean already_lit;
- xchar x, y;
- if (get_obj_location(obj, &x, &y, CONTAINED_TOO | BURIED_TOO))
- - new_light_source(x, y, radius, LS_OBJECT, obj_to_any(obj));
- + new_light_source(x, y, radius,
- + detect ? LS_OBJECT | LS_DETECT : LS_OBJECT,
- + obj_to_any(obj));
- else
- impossible("begin_burn: can't get obj position");
- }
- diff --git c/src/trap.c w/src/trap.c
- index b6db811..c945b3e 100644
- --- c/src/trap.c
- +++ w/src/trap.c
- @@ -411,7 +411,8 @@ int x, y, typ;
- && !context.mon_moving)
- ? SHOP_HOLE_COST
- : 0L);
- - lev->doormask = 0; /* subsumes altarmask, icedpool... */
- + if (lev->typ != ROOM && lev->typ != CORR)
- + lev->doormask = 0; /* subsumes altarmask, icedpool... */
- if (IS_ROOM(lev->typ)) /* && !IS_AIR(lev->typ) */
- lev->typ = ROOM;
- /*
- @@ -488,7 +489,7 @@ unsigned ftflags;
- if (Sokoban && Can_fall_thru(&u.uz))
- ; /* KMH -- You can't escape the Sokoban level traps */
- else if (Levitation || u.ustuck
- - || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig)
- + || !Can_fall_thru(&u.uz)
- || ((Flying || is_clinger(youmonst.data)
- || (ceiling_hider(youmonst.data) && u.uundetected))
- && !(ftflags & TOOKPLUNGE))
- diff --git c/src/uhitm.c w/src/uhitm.c
- index 2eedb18..2326d19 100644
- --- c/src/uhitm.c
- +++ w/src/uhitm.c
- @@ -3065,7 +3065,7 @@ struct monst *mtmp;
- /* cloned Wiz starts out mimicking some other monster and
- might make himself invisible before being revealed */
- - if (mtmp->minvis && !See_invisible)
- + if (minvisible(mtmp) && !See_invisible)
- what = generic;
- else
- what = a_monnam(mtmp);
- diff --git c/src/vision.c w/src/vision.c
- index b8ce2e5..c4f968f 100644
- --- c/src/vision.c
- +++ w/src/vision.c
- @@ -513,6 +513,7 @@ int control;
- int dx, dy; /* one step from a lit door or lit wall (see below) */
- register int col; /* inner loop counter */
- register struct rm *lev; /* pointer to current pos */
- + struct obj *otmp; /* for iterating through inventory */
- struct rm *flev; /* pointer to position in "front" of current pos */
- extern unsigned char seenv_matrix[3][3]; /* from display.c */
- static unsigned char colbump[COLNO + 1]; /* cols to bump sv */
- @@ -570,6 +571,18 @@ int control;
- newsym(col, row);
- }
- + /* Check if the invisible hero can be seen because of their guiding
- + * candle (normally would be checked below). We don't check for
- + * nearby candles (on the ground or held by monsters) because that's
- + * too much effort for too rare an occurence.
- + */
- + for (otmp = invent; otmp; otmp = otmp->nobj)
- + if (otmp->otyp == GUIDING_CANDLE
- + && otmp->lamplit && !otmp->cursed) {
- + viz_array[u.uy][u.ux] |= TEMP_DETECT;
- + break;
- + }
- +
- /* skip the normal update loop */
- goto skip;
- } else if (Is_rogue_level(&u.uz)) {
- @@ -737,8 +750,10 @@ int control;
- lev->seenv |=
- new_angle(lev, sv, row, col); /* update seen angle */
- - /* Update pos if previously not in sight or new angle. */
- - if (!(old_row[col] & IN_SIGHT) || oldseenv != lev->seenv)
- + /* Update pos if previously not in sight or new angle
- + * or when entering/leaving the radius of guiding candle. */
- + if (!(old_row[col] & IN_SIGHT) || oldseenv != lev->seenv
- + || (old_row[col] ^ next_row[col]) & TEMP_DETECT)
- newsym(col, row);
- } else if ((next_row[col] & COULD_SEE)
- @@ -766,9 +781,11 @@ int control;
- lev->seenv |= new_angle(lev, sv, row, col);
- /* Update pos if previously not in sight or new
- - * angle.*/
- + * angle or when entering/leaving the radius of
- + * guiding candle. */
- if (!(old_row[col] & IN_SIGHT)
- - || oldseenv != lev->seenv)
- + || oldseenv != lev->seenv
- + || (old_row[col] ^ next_row[col]) & TEMP_DETECT)
- newsym(col, row);
- } else
- goto not_in_sight; /* we don't see it */
- @@ -779,8 +796,10 @@ int control;
- oldseenv = lev->seenv;
- lev->seenv |= new_angle(lev, sv, row, col);
- - /* Update pos if previously not in sight or new angle. */
- - if (!(old_row[col] & IN_SIGHT) || oldseenv != lev->seenv)
- + /* Update pos if previously not in sight or new angle or
- + * when entering/leaving the radius of guiding candle. */
- + if (!(old_row[col] & IN_SIGHT) || oldseenv != lev->seenv
- + || (old_row[col] ^ next_row[col]) & TEMP_DETECT)
- newsym(col, row);
- }
- } else if ((next_row[col] & COULD_SEE) && lev->waslit) {
- @@ -2806,7 +2825,7 @@ struct monst *mon;
- if (useemon && mon->minvis)
- how_seen |= MONSEEN_SEEINVIS;
- /* infravision */
- - if ((!mon->minvis || See_invisible) && see_with_infrared(mon))
- + if ((!minvisible(mon) || See_invisible) && see_with_infrared(mon))
- how_seen |= MONSEEN_INFRAVIS;
- /* telepathy */
- if (tp_sensemon(mon))
- diff --git c/src/worn.c w/src/worn.c
- index 1a966b7..05328b3 100644
- --- c/src/worn.c
- +++ w/src/worn.c
- @@ -522,7 +522,7 @@ boolean racialexception;
- return; /* probably putting previous item on */
- /* Get a copy of monster's name before altering its visibility */
- - Strcpy(nambuf, See_invisible ? Monnam(mon) : mon_nam(mon));
- + Strcpy(nambuf, mon_nam(mon));
- old = which_armor(mon, flag);
- if (old && old->cursed)
- @@ -640,7 +640,7 @@ outer_break:
- update_mon_intrinsics(mon, best, TRUE, creation);
- /* if couldn't see it but now can, or vice versa, */
- if (!creation && (unseen ^ !canseemon(mon))) {
- - if (mon->minvis && !See_invisible) {
- + if (minvisible(mon) && !See_invisible) {
- pline("Suddenly you cannot see %s.", nambuf);
- makeknown(best->otyp);
- } /* else if (!mon->minvis) pline("%s suddenly appears!",
- diff --git c/src/zap.c w/src/zap.c
- index 1c7a5de..70470c2 100644
- --- c/src/zap.c
- +++ w/src/zap.c
- @@ -3386,7 +3386,7 @@ struct obj **pobj; /* object tossed/used, set to NULL
- prepared for multiple hits so just get first one
- that's either visible or could see its invisible
- self. [No tmp_at() cleanup is needed here.] */
- - if (!mtmp->minvis || perceives(mtmp->data)) {
- + if (!minvisible(mtmp) || perceives(mtmp->data)) {
- result = mtmp;
- goto bhit_done;
- }
Add Comment
Please, Sign In to add comment