-/* NetHack 3.6 cmd.c $NHDT-Date: 1543972186 2018/12/05 01:09:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.313 $ */
+/* NetHack 3.6 cmd.c $NHDT-Date: 1544050555 2018/12/05 22:55:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.314 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
}
if (Polymorph_control)
you_have("polymorph control", from_what(POLYMORPH_CONTROL));
- if (Upolyd && u.umonnum != u.ulycn) {
+ if (Upolyd && u.umonnum != u.ulycn
+ /* if we've died from turning into slime, we're polymorphed
+ right now but don't want to list it as a temporary attribute
+ [we need a more reliable way to detect this situation] */
+ && !(final == ENL_GAMEOVERDEAD
+ && u.umonnum == PM_GREEN_SLIME && !Unchanging)) {
/* foreign shape (except were-form which is handled below) */
Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
if (wizard)
-/* NetHack 3.6 timeout.c $NHDT-Date: 1544003111 2018/12/05 09:45:11 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */
+/* NetHack 3.6 timeout.c $NHDT-Date: 1544050558 2018/12/05 22:55:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.88 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
{
register long i = (Slimed & TIMEOUT) / 2L;
+ if (i == 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 */
+ youmonst.m_ap_type = M_AP_MONSTER;
+ youmonst.mappearance = PM_GREEN_SLIME;
+ }
if (((Slimed & TIMEOUT) % 2L) && i >= 0L && i < SIZE(slime_texts)) {
char buf[BUFSZ];
slimed_to_death(kptr)
struct kinfo *kptr;
{
+ uchar save_mvflags;
+
/* redundant: polymon() cures sliming when polying into green slime */
if (Upolyd && youmonst.data == &mons[PM_GREEN_SLIME]) {
dealloc_killer(kptr);
Strcpy(killer.name, "turned into green slime");
}
dealloc_killer(kptr);
- /* involuntarily break "never changed form" conduct */
- u.uconduct.polyselfs++;
+
+ /*
+ * Polymorph into a green slime, which might destroy some worn armor
+ * (potentially affecting bones) and dismount from steed.
+ * Can't be Unchanging; wouldn't have turned into slime if we were.
+ * Despite lack of Unchanging, neither done() nor savelife() calls
+ * rehumanize() if hero dies while polymorphed.
+ * polymon() undoes the slime countdown's mimick-green-slime hack
+ * but does not perform polyself()'s light source bookkeeping.
+ * No longer need to manually increment uconduct.polyselfs to reflect
+ * [formerly implicit] change of form; polymon() takes care of that.
+ * Temporarily ungenocide if necessary.
+ */
+ if (emits_light(youmonst.data))
+ del_light_source(LS_MONSTER, monst_to_any(&youmonst));
+ save_mvflags = mvitals[PM_GREEN_SLIME].mvflags;
+ mvitals[PM_GREEN_SLIME].mvflags = save_mvflags & ~G_GENOD;
+ (void) polymon(PM_GREEN_SLIME);
+ mvitals[PM_GREEN_SLIME].mvflags = save_mvflags;
done(TURNED_SLIME);
/* life-saved; even so, hero still has turned into green slime;
done(GENOCIDED);
/* could be life-saved again (only in explore or wizard mode)
but green slimes are gone; just stay in current form */
-
- /* not geno'd; survive as a green slime */
- } else {
- /* this part of polyself() isn't in polymon();
- we assume that green slimes don't emit light */
- if (emits_light(youmonst.data))
- del_light_source(LS_MONSTER, monst_to_any(&youmonst));
- /* undo the 'involuntarily break "never changed form"'
- increment so that this change isn't counted twice */
- u.uconduct.polyselfs--;
- /* can't be Unchanging even if life-saving wasn't due to amulet;
- hero infected with slime wouldn't have turned into green slime
- to get here if Unchanging */
- (void) polymon(PM_GREEN_SLIME);
}
return;
}