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:
PatR
2023-10-25 13:26:03 -07:00
parent 7bf3888118
commit 04d6789c98
10 changed files with 156 additions and 44 deletions

View File

@@ -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) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1858,7 +1858,7 @@ singular(struct obj* otmp, char* (*func)(OBJ_P))
char *
just_an(char *outbuf, const char *str)
{
char c0;
char c0, *p;
*outbuf = '\0';
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 */
Strcpy(outbuf, strchr("aefhilmnosx", c0) ? "an " : "a ");
} 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 */
} else {
/* normal case is "an <vowel>" or "a <consonant>" */