report ice's thaw state
Classify nearby ice as "solid" (no melt timer), "sturdy" (more than 1000 turns left), "steady" (101 to 1000 turns left), "unsteady" (51 to 100 turns left), "thin" (15 to 50 turns left), or "slushy" (1 to 14 turns left, matching walking on ice with the Warning attribute). [I'm not thrilled with "steady" and particularly "unsteady".] I was originally going to do this just for probing downward, but ended up also doing it for look-here and getpos's autodescribe. It nearly got out of hand and touched more files than anticipated. 'mention_decor' ought to treat moving from ice firmer than thin to thin or slushy, from thin to slushy, from slushy to any other, and from thin to firmer as if moving onto different terrain but I haven't attempted to tackle that. The melt timer could work more like a candle's burn timer, triggering at intermediate stages and resetting itself, so that ice which changes to a weaker state under the hero could be reported to the player. But this doesn't implement that.
This commit is contained in:
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1268 $ $NHDT-Date: 1698090922 2023/10/23 19:55:22 $
|
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1271 $ $NHDT-Date: 1698264796 2023/10/25 20:13:16 $
|
||||||
|
|
||||||
General Fixes and Modified Features
|
General Fixes and Modified Features
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
@@ -2284,6 +2284,7 @@ applying gold pieces will flip one and report "heads" or "tails"; with a stack
|
|||||||
of more than one, normally the flipped coin will rejoin the stack
|
of more than one, normally the flipped coin will rejoin the stack
|
||||||
during enlightenment and end-of-game disclosure, use contraction "<verb>n't"
|
during enlightenment and end-of-game disclosure, use contraction "<verb>n't"
|
||||||
for "<verb> not"
|
for "<verb> not"
|
||||||
|
give feedback about the thaw status of ice terrain
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific New Features
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
+5
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 decl.h $NHDT-Date: 1686726249 2023/06/14 07:04:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.333 $ */
|
/* NetHack 3.7 decl.h $NHDT-Date: 1698264758 2023/10/25 20:12:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.339 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2007. */
|
/*-Copyright (c) Michael Allison, 2007. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -322,6 +322,10 @@ struct instance_globals_d {
|
|||||||
but that would require all xname() and doname() calls to be modified */
|
but that would require all xname() and doname() calls to be modified */
|
||||||
int distantname;
|
int distantname;
|
||||||
|
|
||||||
|
/* pickup.c */
|
||||||
|
boolean decor_fumble_override;
|
||||||
|
boolean decor_levitate_override;
|
||||||
|
|
||||||
boolean havestate;
|
boolean havestate;
|
||||||
unsigned long magic; /* validate that structure layout is preserved */
|
unsigned long magic; /* validate that structure layout is preserved */
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 extern.h $NHDT-Date: 1695159584 2023/09/19 21:39:44 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1287 $ */
|
/* NetHack 3.7 extern.h $NHDT-Date: 1698264776 2023/10/25 20:12:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1296 $ */
|
||||||
/* Copyright (c) Steve Creps, 1988. */
|
/* Copyright (c) Steve Creps, 1988. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -2099,6 +2099,7 @@ extern char *monhealthdescr(struct monst *mon, boolean, char *);
|
|||||||
extern void mhidden_description(struct monst *, boolean, char *);
|
extern void mhidden_description(struct monst *, boolean, char *);
|
||||||
extern boolean object_from_map(int, coordxy, coordxy, struct obj **);
|
extern boolean object_from_map(int, coordxy, coordxy, struct obj **);
|
||||||
extern const char *waterbody_name(coordxy, coordxy);
|
extern const char *waterbody_name(coordxy, coordxy);
|
||||||
|
extern const char *ice_descr(coordxy, coordxy, char *);
|
||||||
extern boolean ia_checkfile(struct obj *);
|
extern boolean ia_checkfile(struct obj *);
|
||||||
extern int do_screen_description(coord, boolean, int, char *, const char **,
|
extern int do_screen_description(coord, boolean, int, char *, const char **,
|
||||||
struct permonst **);
|
struct permonst **);
|
||||||
@@ -2162,6 +2163,7 @@ extern void getlock(void);
|
|||||||
extern int collect_obj_classes(char *, struct obj *, boolean,
|
extern int collect_obj_classes(char *, struct obj *, boolean,
|
||||||
boolean(*)(struct obj *), int *);
|
boolean(*)(struct obj *), int *);
|
||||||
extern boolean rider_corpse_revival(struct obj *, boolean);
|
extern boolean rider_corpse_revival(struct obj *, boolean);
|
||||||
|
extern void force_decor(boolean);
|
||||||
extern void deferred_decor(boolean);
|
extern void deferred_decor(boolean);
|
||||||
extern boolean menu_class_present(int);
|
extern boolean menu_class_present(int);
|
||||||
extern void add_valid_menu_class(int);
|
extern void add_valid_menu_class(int);
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 flag.h $NHDT-Date: 1684791761 2023/05/22 21:42:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ */
|
/* NetHack 3.7 flag.h $NHDT-Date: 1698264779 2023/10/25 20:12:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.224 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2006. */
|
/*-Copyright (c) Michael Allison, 2006. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -290,6 +290,7 @@ struct instance_flags {
|
|||||||
boolean zerocomp; /* write zero-compressed save files */
|
boolean zerocomp; /* write zero-compressed save files */
|
||||||
boolean rlecomp; /* alternative to zerocomp; run-length encoding
|
boolean rlecomp; /* alternative to zerocomp; run-length encoding
|
||||||
* compression of levels when writing savefile */
|
* compression of levels when writing savefile */
|
||||||
|
schar ice_rating; /* ice_descr()'s classification of ice terrain */
|
||||||
schar prev_decor; /* 'mention_decor' just mentioned this */
|
schar prev_decor; /* 'mention_decor' just mentioned this */
|
||||||
uchar num_pad_mode;
|
uchar num_pad_mode;
|
||||||
uchar bouldersym; /* symbol for boulder display */
|
uchar bouldersym; /* symbol for boulder display */
|
||||||
|
|||||||
+4
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 decl.c $NHDT-Date: 1686726255 2023/06/14 07:04:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.286 $ */
|
/* NetHack 3.7 decl.c $NHDT-Date: 1698264780 2023/10/25 20:13:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.293 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2009. */
|
/*-Copyright (c) Michael Allison, 2009. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -328,6 +328,9 @@ const struct instance_globals_d g_init_d = {
|
|||||||
DUMMY, /* disco */
|
DUMMY, /* disco */
|
||||||
/* objname.c */
|
/* objname.c */
|
||||||
0, /* distantname */
|
0, /* distantname */
|
||||||
|
/* pickup.c */
|
||||||
|
FALSE, /* decor_fumble_override */
|
||||||
|
FALSE, /* decor_levitate_override */
|
||||||
TRUE, /* havestate*/
|
TRUE, /* havestate*/
|
||||||
IVMAGIC /* d_magic to validate that structure layout has been preserved */
|
IVMAGIC /* d_magic to validate that structure layout has been preserved */
|
||||||
};
|
};
|
||||||
|
|||||||
+19
-10
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 invent.c $NHDT-Date: 1698090922 2023/10/23 19:55:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.456 $ */
|
/* NetHack 3.7 invent.c $NHDT-Date: 1698264784 2023/10/25 20:13:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.457 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -4224,7 +4224,7 @@ dfeature_at(coordxy x, coordxy y, char *buf)
|
|||||||
else if (is_lava(x, y))
|
else if (is_lava(x, y))
|
||||||
cmap = S_lava; /* "molten lava" */
|
cmap = S_lava; /* "molten lava" */
|
||||||
else if (is_ice(x, y))
|
else if (is_ice(x, y))
|
||||||
cmap = S_ice; /* "ice" */
|
dfeature = ice_descr(x, y, altbuf), cmap = -1; /* "ice" */
|
||||||
else if (is_pool(x, y))
|
else if (is_pool(x, y))
|
||||||
dfeature = "pool of water";
|
dfeature = "pool of water";
|
||||||
else if (IS_SINK(ltyp))
|
else if (IS_SINK(ltyp))
|
||||||
@@ -4330,19 +4330,28 @@ look_here(
|
|||||||
if (dfeature && !strncmp(dfeature, "altar ", 6)) {
|
if (dfeature && !strncmp(dfeature, "altar ", 6)) {
|
||||||
/* don't say "altar" twice, dfeature has more info */
|
/* don't say "altar" twice, dfeature has more info */
|
||||||
You("try to feel what is here.");
|
You("try to feel what is here.");
|
||||||
|
} else if (SURFACE_AT(u.ux, u.uy) == ICE) {
|
||||||
|
/* using describe_decor() to handle ice is simpler than
|
||||||
|
replicating it in the conditional message construction */
|
||||||
|
if (!flags.mention_decor || iflags.prev_decor == ICE)
|
||||||
|
force_decor(FALSE);
|
||||||
|
/* plain "ice" if blind and levitating, otherwise "solid ice" &c;
|
||||||
|
"There is [thin ]ice here. You try to feel what is on it." */
|
||||||
|
You("try to feel what is on it.");
|
||||||
|
skip_dfeature = TRUE; /* ice already described */
|
||||||
} else {
|
} else {
|
||||||
const char *where = (Blind && !can_reach_floor(TRUE))
|
boolean cant_reach = !can_reach_floor(TRUE);
|
||||||
? "lying beneath you"
|
const char *surf = surface(u.ux, u.uy),
|
||||||
: "lying here on the ",
|
*where = cant_reach ? "lying beneath you"
|
||||||
*onwhat = (Blind && !can_reach_floor(TRUE))
|
: "lying here on the ",
|
||||||
? ""
|
*onwhat = cant_reach ? "" : surf;
|
||||||
: surface(u.ux, u.uy);
|
|
||||||
|
|
||||||
You("try to feel what is %s%s.", drift ? "floating here" : where,
|
You("try to feel what is %s%s.", drift ? "floating here" : where,
|
||||||
drift ? "" : onwhat);
|
drift ? "" : onwhat);
|
||||||
|
|
||||||
|
if (dfeature && !drift && !strcmp(dfeature, surf))
|
||||||
|
skip_dfeature = TRUE; /* terrain feature already identified */
|
||||||
}
|
}
|
||||||
if (dfeature && !drift && !strcmp(dfeature, surface(u.ux, u.uy)))
|
|
||||||
dfeature = 0; /* ice already identified */
|
|
||||||
trap = t_at(u.ux, u.uy);
|
trap = t_at(u.ux, u.uy);
|
||||||
if (!can_reach_floor(trap && is_pit(trap->ttyp))) {
|
if (!can_reach_floor(trap && is_pit(trap->ttyp))) {
|
||||||
pline("But you can't reach it!");
|
pline("But you can't reach it!");
|
||||||
|
|||||||
+6
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 objnam.c $NHDT-Date: 1686386790 2023/06/10 08:46:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.392 $ */
|
/* NetHack 3.7 objnam.c $NHDT-Date: 1698264786 2023/10/25 20:13:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.398 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1858,7 +1858,7 @@ singular(struct obj* otmp, char* (*func)(OBJ_P))
|
|||||||
char *
|
char *
|
||||||
just_an(char *outbuf, const char *str)
|
just_an(char *outbuf, const char *str)
|
||||||
{
|
{
|
||||||
char c0;
|
char c0, *p;
|
||||||
|
|
||||||
*outbuf = '\0';
|
*outbuf = '\0';
|
||||||
c0 = lowc(*str);
|
c0 = lowc(*str);
|
||||||
@@ -1866,7 +1866,10 @@ just_an(char *outbuf, const char *str)
|
|||||||
/* single letter; might be used for named fruit or a musical note */
|
/* single letter; might be used for named fruit or a musical note */
|
||||||
Strcpy(outbuf, strchr("aefhilmnosx", c0) ? "an " : "a ");
|
Strcpy(outbuf, strchr("aefhilmnosx", c0) ? "an " : "a ");
|
||||||
} else if (!strncmpi(str, "the ", 4) || !strcmpi(str, "molten lava")
|
} else if (!strncmpi(str, "the ", 4) || !strcmpi(str, "molten lava")
|
||||||
|| !strcmpi(str, "iron bars") || !strcmpi(str, "ice")) {
|
|| !strcmpi(str, "iron bars") || !strcmpi(str, "ice")
|
||||||
|
|| !strncmpi(str, "frozen ", 7) /* ice while hallucinating */
|
||||||
|
/* thawing ice ("solid ice", "thin ice", &c) */
|
||||||
|
|| ((p = strchr(str, ' ')) != 0 && !strcmpi(p, " ice"))) {
|
||||||
; /* no article */
|
; /* no article */
|
||||||
} else {
|
} else {
|
||||||
/* normal case is "an <vowel>" or "a <consonant>" */
|
/* normal case is "an <vowel>" or "a <consonant>" */
|
||||||
|
|||||||
+41
-6
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 pager.c $NHDT-Date: 1655120486 2022/06/13 11:41:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.225 $ */
|
/* NetHack 3.7 pager.c $NHDT-Date: 1698264788 2023/10/25 20:13:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.252 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -482,16 +482,12 @@ const char *
|
|||||||
waterbody_name(coordxy x, coordxy y)
|
waterbody_name(coordxy x, coordxy y)
|
||||||
{
|
{
|
||||||
static char pooltype[40];
|
static char pooltype[40];
|
||||||
struct rm *lev;
|
|
||||||
schar ltyp;
|
schar ltyp;
|
||||||
boolean hallucinate = Hallucination && !gp.program_state.gameover;
|
boolean hallucinate = Hallucination && !gp.program_state.gameover;
|
||||||
|
|
||||||
if (!isok(x, y))
|
if (!isok(x, y))
|
||||||
return "drink"; /* should never happen */
|
return "drink"; /* should never happen */
|
||||||
lev = &levl[x][y];
|
ltyp = SURFACE_AT(x, y);
|
||||||
ltyp = lev->typ;
|
|
||||||
if (ltyp == DRAWBRIDGE_UP)
|
|
||||||
ltyp = db_under_typ(lev->drawbridgemask);
|
|
||||||
|
|
||||||
if (ltyp == LAVAPOOL) {
|
if (ltyp == LAVAPOOL) {
|
||||||
Snprintf(pooltype, sizeof pooltype, "molten %s", hliquid("lava"));
|
Snprintf(pooltype, sizeof pooltype, "molten %s", hliquid("lava"));
|
||||||
@@ -535,6 +531,43 @@ waterbody_name(coordxy x, coordxy y)
|
|||||||
return "water"; /* don't hallucinate this as some other liquid */
|
return "water"; /* don't hallucinate this as some other liquid */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
ice_descr(coordxy x, coordxy y, char *outbuf)
|
||||||
|
{
|
||||||
|
static const char *const icetyp[] = {
|
||||||
|
"solid", /* 0: not melting */
|
||||||
|
"sturdy", /* 1: more than 1000 turns left */
|
||||||
|
"steady", /* 2: 101..1000 turns left */
|
||||||
|
"unsteady", /* 3: 51..100 turns left */
|
||||||
|
"thin", /* 4: 15..50 turns left */
|
||||||
|
"slushy", /* 5: 1..14 turns left; matches Warning on ice */
|
||||||
|
};
|
||||||
|
/* same formula as is used in distant_name() for objects */
|
||||||
|
int r = (u.xray_range > 2) ? u.xray_range : 2,
|
||||||
|
neardist = (r * r) * 2 - r; /* same as r*r + r*(r-1) */
|
||||||
|
|
||||||
|
iflags.ice_rating = -1; /* secondary output, for ' mention_decor' */
|
||||||
|
if (levl[x][y].typ != ICE) {
|
||||||
|
Sprintf(outbuf, "[ice:%d?]", (int) levl[x][y].typ);
|
||||||
|
} else if ((distu(x, y) > neardist
|
||||||
|
|| (!cansee(x, y) && (!u_at(x, y) || Levitation)))
|
||||||
|
&& !gd.decor_levitate_override) { /* probe_decor(pickup.c) */
|
||||||
|
Strcpy(outbuf, waterbody_name(x, y)); /* "ice" or "frozen <liquid>" */
|
||||||
|
} else {
|
||||||
|
long time_left = spot_time_left(x, y, MELT_ICE_AWAY);
|
||||||
|
|
||||||
|
iflags.ice_rating = !time_left ? 0 /* solid */
|
||||||
|
: (time_left > 1000L) ? 1 /* sturdy */
|
||||||
|
: (time_left > 100L) ? 2 /* steady */
|
||||||
|
: (time_left > 50L) ? 3 /* unsteady */
|
||||||
|
: (time_left > 14L) ? 4 /* thin */
|
||||||
|
: 5; /* slushy */
|
||||||
|
Sprintf(outbuf, "%s %s", icetyp[(int) iflags.ice_rating],
|
||||||
|
waterbody_name(x, y));
|
||||||
|
}
|
||||||
|
return outbuf;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the name of the glyph found at (x,y).
|
* Return the name of the glyph found at (x,y).
|
||||||
* If not hallucinating and the glyph is a monster, also monster data.
|
* If not hallucinating and the glyph is a monster, also monster data.
|
||||||
@@ -1442,6 +1475,8 @@ do_screen_description(
|
|||||||
pm = lookat(cc.x, cc.y, look_buf, monbuf);
|
pm = lookat(cc.x, cc.y, look_buf, monbuf);
|
||||||
if (pm && for_supplement)
|
if (pm && for_supplement)
|
||||||
*for_supplement = pm;
|
*for_supplement = pm;
|
||||||
|
if (!strcmp(look_buf, "ice"))
|
||||||
|
(void) ice_descr(cc.x, cc.y, look_buf);
|
||||||
|
|
||||||
if (look_buf[0] != '\0')
|
if (look_buf[0] != '\0')
|
||||||
*firstmatch = look_buf;
|
*firstmatch = look_buf;
|
||||||
|
|||||||
+41
-11
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 pickup.c $NHDT-Date: 1654760203 2022/06/09 07:36:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.310 $ */
|
/* NetHack 3.7 pickup.c $NHDT-Date: 1698264789 2023/10/25 20:13:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.339 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -291,6 +291,25 @@ rider_corpse_revival(struct obj *obj, boolean remotely)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wand of probing zapped down; perhaps hero is levitating while blind */
|
||||||
|
void
|
||||||
|
force_decor(boolean via_probing)
|
||||||
|
{
|
||||||
|
/* we don't want describe_decor() to defer feedback if hero is fumbling
|
||||||
|
with 1 turn left, or for ice_descr() to skip thawing details if hero
|
||||||
|
is probing when levitating while blind (those will be skipped for
|
||||||
|
look_here() and farlook() or autodescribe); we can't control that by
|
||||||
|
temporarily tweaking properties because that could become noticeable
|
||||||
|
if status gets updated while decor feedback is being delivered */
|
||||||
|
gd.decor_fumble_override = TRUE;
|
||||||
|
gd.decor_levitate_override = via_probing;
|
||||||
|
/* force current terrain to be different from previous location */
|
||||||
|
iflags.prev_decor = STONE;
|
||||||
|
(void) describe_decor();
|
||||||
|
gd.decor_fumble_override = gd.decor_levitate_override = FALSE;
|
||||||
|
gl.lastseentyp[u.ux][u.uy] = levl[u.ux][u.uy].typ;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
deferred_decor(boolean setup) /* True: deferring, False: catching up */
|
deferred_decor(boolean setup) /* True: deferring, False: catching up */
|
||||||
{
|
{
|
||||||
@@ -312,7 +331,8 @@ describe_decor(void)
|
|||||||
const char *dfeature;
|
const char *dfeature;
|
||||||
int ltyp;
|
int ltyp;
|
||||||
|
|
||||||
if ((HFumbling & TIMEOUT) == 1L && !iflags.defer_decor) {
|
if ((HFumbling & TIMEOUT) == 1L && !iflags.defer_decor
|
||||||
|
&& !gd.decor_fumble_override) { /* probe_decor() */
|
||||||
/*
|
/*
|
||||||
* Work around a message sequencing issue: avoid
|
* Work around a message sequencing issue: avoid
|
||||||
* |You are back on floor.
|
* |You are back on floor.
|
||||||
@@ -324,9 +344,7 @@ describe_decor(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ltyp = levl[u.ux][u.uy].typ;
|
ltyp = SURFACE_AT(u.ux, u.uy);
|
||||||
if (ltyp == DRAWBRIDGE_UP) /* surface for spot in front of closed db */
|
|
||||||
ltyp = db_under_typ(levl[u.ux][u.uy].drawbridgemask);
|
|
||||||
dfeature = dfeature_at(u.ux, u.uy, fbuf);
|
dfeature = dfeature_at(u.ux, u.uy, fbuf);
|
||||||
|
|
||||||
/* we don't mention "ordinary" doors but do mention broken ones (and
|
/* we don't mention "ordinary" doors but do mention broken ones (and
|
||||||
@@ -337,6 +355,10 @@ describe_decor(void)
|
|||||||
if (doorhere || Underwater
|
if (doorhere || Underwater
|
||||||
|| (ltyp == ICE && IS_POOL(iflags.prev_decor))) /* pooleffects() */
|
|| (ltyp == ICE && IS_POOL(iflags.prev_decor))) /* pooleffects() */
|
||||||
dfeature = 0;
|
dfeature = 0;
|
||||||
|
/*
|
||||||
|
* TODO: if on ice, report moving between thicker and thinner ice (based
|
||||||
|
* on ice_descr()'s classification) as if moving onto different terrain.
|
||||||
|
*/
|
||||||
|
|
||||||
if (ltyp == iflags.prev_decor && !IS_FURNITURE(ltyp)) {
|
if (ltyp == iflags.prev_decor && !IS_FURNITURE(ltyp)) {
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
@@ -353,18 +375,26 @@ describe_decor(void)
|
|||||||
Strcpy(fbuf, dfeature);
|
Strcpy(fbuf, dfeature);
|
||||||
Sprintf(outbuf, "%s.", upstart(fbuf));
|
Sprintf(outbuf, "%s.", upstart(fbuf));
|
||||||
}
|
}
|
||||||
pline("%s", outbuf);
|
if (ltyp == ICE)
|
||||||
|
Norep("%s", outbuf);
|
||||||
|
else
|
||||||
|
pline("%s", outbuf);
|
||||||
} else if (!Underwater) {
|
} else if (!Underwater) {
|
||||||
if (IS_POOL(iflags.prev_decor)
|
if (IS_POOL(iflags.prev_decor)
|
||||||
|| iflags.prev_decor == LAVAPOOL
|
|| IS_LAVA(iflags.prev_decor)
|
||||||
|| iflags.prev_decor == ICE) {
|
|| iflags.prev_decor == ICE) {
|
||||||
const char *ground = surface(u.ux, u.uy);
|
if (iflags.last_msg != PLNMSG_BACK_ON_GROUND) {
|
||||||
|
const char *surf = is_ice(u.ux, u.uy)
|
||||||
|
? ice_descr(u.ux, u.uy, fbuf)
|
||||||
|
: surface(u.ux, u.uy);
|
||||||
|
|
||||||
if (iflags.last_msg != PLNMSG_BACK_ON_GROUND)
|
if (!strcmpi(surf, "floor") || !strcmpi(surf, "ground"))
|
||||||
|
surf = "solid ground";
|
||||||
pline("%s %s %s.",
|
pline("%s %s %s.",
|
||||||
Verbose(2, describe_decor2) ? "You are back" : "Back",
|
Verbose(2, describe_decor2) ? "You are back" : "Back",
|
||||||
(Levitation || Flying) ? "over" : "on",
|
(Levitation || Flying) ? "over" : "on", surf);
|
||||||
ground);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iflags.prev_decor = ltyp;
|
iflags.prev_decor = ltyp;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 zap.c $NHDT-Date: 1686178723 2023/06/07 22:58:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.472 $ */
|
/* NetHack 3.7 zap.c $NHDT-Date: 1698264791 2023/10/25 20:13:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.481 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -3094,7 +3094,7 @@ cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack,
|
|||||||
static boolean
|
static boolean
|
||||||
zap_updown(struct obj *obj) /* wand or spell */
|
zap_updown(struct obj *obj) /* wand or spell */
|
||||||
{
|
{
|
||||||
boolean striking = FALSE, disclose = FALSE;
|
boolean striking = FALSE, disclose = FALSE, map_zapped = FALSE;
|
||||||
coordxy x, y, xx, yy;
|
coordxy x, y, xx, yy;
|
||||||
int ptmp;
|
int ptmp;
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
@@ -3113,9 +3113,24 @@ zap_updown(struct obj *obj) /* wand or spell */
|
|||||||
ptmp = 0;
|
ptmp = 0;
|
||||||
if (u.dz < 0) {
|
if (u.dz < 0) {
|
||||||
You("probe towards the %s.", ceiling(x, y));
|
You("probe towards the %s.", ceiling(x, y));
|
||||||
} else {
|
} else { /* down */
|
||||||
|
const char *surf;
|
||||||
|
schar ltyp, rememberedltyp = gl.lastseentyp[x][y];
|
||||||
|
|
||||||
ptmp += bhitpile(obj, bhito, x, y, u.dz);
|
ptmp += bhitpile(obj, bhito, x, y, u.dz);
|
||||||
You("probe beneath the %s.", surface(x, y));
|
/* sequencing: zap_map() calls force_decor() for ice or furniture;
|
||||||
|
we need to call it before probing for buried objects */
|
||||||
|
ltyp = SURFACE_AT(x, y);
|
||||||
|
zap_map(x, y, obj);
|
||||||
|
map_zapped = TRUE;
|
||||||
|
if (ltyp == ICE || IS_FURNITURE(ltyp)) {
|
||||||
|
surf = "it";
|
||||||
|
if (gl.lastseentyp[x][y] != rememberedltyp)
|
||||||
|
ptmp += 1;
|
||||||
|
} else {
|
||||||
|
surf = the(surface(x, y));
|
||||||
|
}
|
||||||
|
You("probe beneath %s.", surf);
|
||||||
ptmp += display_binventory(x, y, TRUE);
|
ptmp += display_binventory(x, y, TRUE);
|
||||||
}
|
}
|
||||||
if (!ptmp)
|
if (!ptmp)
|
||||||
@@ -3245,7 +3260,8 @@ zap_updown(struct obj *obj) /* wand or spell */
|
|||||||
|
|
||||||
/* note: engraving handling that used to be here has been moved
|
/* note: engraving handling that used to be here has been moved
|
||||||
to zap_map() */
|
to zap_map() */
|
||||||
zap_map(x, y, obj);
|
if (!map_zapped)
|
||||||
|
zap_map(x, y, obj);
|
||||||
|
|
||||||
} else if (u.dz < 0) {
|
} else if (u.dz < 0) {
|
||||||
/* zapping upward */
|
/* zapping upward */
|
||||||
@@ -3582,10 +3598,9 @@ zap_map(
|
|||||||
} /* !u.uz */
|
} /* !u.uz */
|
||||||
|
|
||||||
if (obj->otyp == WAN_PROBING) {
|
if (obj->otyp == WAN_PROBING) {
|
||||||
|
schar ltyp;
|
||||||
/*
|
/*
|
||||||
* Probing, either up/down or lateral.
|
* Probing, either up/down or lateral.
|
||||||
*
|
|
||||||
* TODO: if terrain is ice, report on its thaw timer.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* map unseen terrain */
|
/* map unseen terrain */
|
||||||
@@ -3598,8 +3613,9 @@ zap_map(
|
|||||||
learn_it = TRUE;
|
learn_it = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ltyp = SURFACE_AT(x, y);
|
||||||
/* secret door gets revealed, converted into regular door */
|
/* secret door gets revealed, converted into regular door */
|
||||||
if (levl[x][y].typ == SDOOR) {
|
if (ltyp == SDOOR) {
|
||||||
cvt_sdoor_to_door(&levl[x][y]); /* .typ = DOOR */
|
cvt_sdoor_to_door(&levl[x][y]); /* .typ = DOOR */
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
if (cansee(x, y)) {
|
if (cansee(x, y)) {
|
||||||
@@ -3612,12 +3628,20 @@ zap_map(
|
|||||||
/* secret corridor likewise, although only ones within view will
|
/* secret corridor likewise, although only ones within view will
|
||||||
still be secret; for the !cansee(x,y) case, show_map_spot()
|
still be secret; for the !cansee(x,y) case, show_map_spot()
|
||||||
above has already converted the spot to regular corridor */
|
above has already converted the spot to regular corridor */
|
||||||
} else if (levl[x][y].typ == SCORR) {
|
} else if (ltyp == SCORR) {
|
||||||
levl[x][y].typ = CORR;
|
levl[x][y].typ = CORR;
|
||||||
unblock_point(x, y);
|
unblock_point(x, y);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
pline("Probing exposes a secret corridor.");
|
pline("Probing exposes a secret corridor.");
|
||||||
learn_it = TRUE;
|
learn_it = TRUE;
|
||||||
|
|
||||||
|
/* if on or over ice, describe it ("solid ice", "thin ice", &c);
|
||||||
|
likewise for furniture in case hero is levitating while blind */
|
||||||
|
} else if (ltyp == ICE || IS_FURNITURE(ltyp)) {
|
||||||
|
if (u.dz > 0) { /* down, which also means x,y == u.ux,u.uy */
|
||||||
|
force_decor(TRUE);
|
||||||
|
learn_it = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Probing reveals undiscovered traps.
|
* Probing reveals undiscovered traps.
|
||||||
|
|||||||
Reference in New Issue
Block a user