fix pull request #380 - turning into slime

The turn-to-slime countdown is one of the ones that uses turns/2
to stretch the sequence out longer and it was displaying the hero
as green slime when there was another turn before it happened.
(In theory anyway.  I could not get my hero to be shown as slime
and still have one move left, even when hasted.)

Make the hero mimic green slime starting on the last turn before
being polymorphed instead of next to last.

Fixes #380
This commit is contained in:
PatR
2020-08-27 16:14:17 -07:00
parent 1a11d67d58
commit 3f81bd5af6
2 changed files with 11 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.289 $ $NHDT-Date: 1597967807 2020/08/20 23:56:47 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.290 $ $NHDT-Date: 1598570054 2020/08/27 23:14:14 $
General Fixes and Modified Features
-----------------------------------
@@ -247,6 +247,7 @@ leashing or unleashing pets wasn't updating persistent inventory window
end of game inventory disclosure passed an inappropriate argument to the
inventory display routine; not noticeable for tty and curses,
noticeable but not harmful for X11, and slightly harmful for Qt
turning into slime rendered hero as slime one turn too soon
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 timeout.c $NHDT-Date: 1596498217 2020/08/03 23:43:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.118 $ */
/* NetHack 3.7 timeout.c $NHDT-Date: 1598570054 2020/08/27 23:14:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.119 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -316,16 +316,20 @@ static NEARDATA const char *const slime_texts[] = {
static void
slime_dialogue()
{
register long i = (Slimed & TIMEOUT) / 2L;
long t = (Slimed & TIMEOUT), i = t / 2L;
if (i == 1L) {
if (t == 1L) {
/* display as green slime during "You have become green slime."
but don't worry about not being able to see self; if already
mimicking something else at the time, implicitly be revealed */
g.youmonst.m_ap_type = M_AP_MONSTER;
g.youmonst.mappearance = PM_GREEN_SLIME;
/* no message given when 't' is odd, so no automatic update of
self; force one */
newsym(u.ux, u.uy);
}
if (((Slimed & TIMEOUT) % 2L) && i >= 0L && i < SIZE(slime_texts)) {
if ((t % 2L) != 0L && i >= 0L && i < SIZE(slime_texts)) {
char buf[BUFSZ];
Strcpy(buf, slime_texts[SIZE(slime_texts) - i - 1L]);
@@ -2403,7 +2407,7 @@ long adjust; /* how much to adjust timeout */
/* restore elements */
if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &count, sizeof count);
while (count-- > 0) {
curr = (timer_element *) alloc(sizeof(timer_element));
if (nhfp->structlevel)