From: PatR Date: Wed, 13 Dec 2017 01:53:54 +0000 (-0800) Subject: self-genocide's "you feel dead inside" X-Git-Tag: NetHack-3.6.1_RC01~191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4540086f8b12b9daeb8c4732a937e9ce698ccb3;p=nethack self-genocide's "you feel dead inside" It seems to me that the reaction to "you feel dead inside" when you're polymorphed into an undead creature at the time would be "so what else is new?". Vary the "dead" when current form is something which gets reported as "destroyed" rather than "killed" when killed. That happens for things flagged as non-living. Now undead "feel condemned inside" and golems "feel empty inside". Neither of those are ideal but they're more interesting than "feel dead inside". After becoming dead inside, give a reminder about that during enlightenment and if you restore a saved game in that condition. It was the latter that set this in motion: I wanted to confirm that restoring with u.uhp == -1 didn't give "you aren't healthy enough to survive restoration" when polymorphed. (It doesn't; the game resumes and you'll die if/when you rehumanize.) --- diff --git a/include/extern.h b/include/extern.h index de7c35999..6fd1df12f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 extern.h $NHDT-Date: 1508549428 2017/10/21 01:30:28 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.619 $ */ +/* NetHack 3.6 extern.h $NHDT-Date: 1513130012 2017/12/13 01:53:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.621 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1881,6 +1881,8 @@ E const char *FDECL(mbodypart, (struct monst *, int)); E const char *FDECL(body_part, (int)); E int NDECL(poly_gender); E void FDECL(ugolemeffects, (int, int)); +E boolean NDECL(ugenocided); +E const char *NDECL(udeadinside); /* ### potion.c ### */ diff --git a/include/mondata.h b/include/mondata.h index cdb299007..2b186dc62 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 mondata.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */ +/* NetHack 3.6 mondata.h $NHDT-Date: 1513130015 2017/12/13 01:53:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.32 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -175,9 +175,10 @@ #define is_vampire(ptr) ((ptr)->mlet == S_VAMPIRE) -#define nonliving(ptr) \ - (is_golem(ptr) || is_undead(ptr) || (ptr)->mlet == S_VORTEX \ - || (ptr) == &mons[PM_MANES]) +/* used to vary a few messages */ +#define weirdnonliving(ptr) (is_golem(ptr) || (ptr)->mlet == S_VORTEX) +#define nonliving(ptr) \ + (is_undead(ptr) || (ptr) == &mons[PM_MANES] || weirdnonliving(ptr)) /* Used for conduct with corpses, tins, and digestion attacks */ /* G_NOCORPSE monsters might still be swallowed as a purple worm */ diff --git a/src/allmain.c b/src/allmain.c index 8834c6a60..4a0cfaf8f 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 allmain.c $NHDT-Date: 1463217182 2016/05/14 09:13:02 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.72 $ */ +/* NetHack 3.6 allmain.c $NHDT-Date: 1513130016 2017/12/13 01:53:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -640,6 +640,13 @@ boolean new_game; /* false => restoring an old game */ char buf[BUFSZ]; boolean currentgend = Upolyd ? u.mfemale : flags.female; + /* skip "welcome back" if restoring a doomed character */ + if (!new_game && Upolyd && ugenocided()) { + /* death via self-genocide is pending */ + pline("You're back, but you still feel %s inside.", udeadinside()); + return; + } + /* * The "welcome back" message always describes your innate form * even when polymorphed or wearing a helm of opposite alignment. diff --git a/src/cmd.c b/src/cmd.c index 4da0509d2..dc62c0ed3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1508880573 2017/10/24 21:29:33 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.275 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1513130017 2017/12/13 01:53:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.277 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1887,8 +1887,13 @@ int final; Strcpy(youtoo, You_); /* not a traditional status but inherently obvious to player; more detail given below (attributes section) for magic enlightenment */ - if (Upolyd) - you_are("transformed", ""); + if (Upolyd) { + Strcpy(buf, "transformed"); + if (ugenocided()) + Sprintf(eos(buf), " and %s %s inside", + final ? "felt" : "feel", udeadinside()); + you_are(buf, ""); + } /* not a trouble, but we want to display riding status before maybe reporting steed as trapped or hero stuck to cursed saddle */ if (Riding) { diff --git a/src/polyself.c b/src/polyself.c index a7febb3b1..e66c522b6 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 polyself.c $NHDT-Date: 1497485548 2017/06/15 00:12:28 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.112 $ */ +/* NetHack 3.6 polyself.c $NHDT-Date: 1513130017 2017/12/13 01:53:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.115 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -189,12 +189,7 @@ const char *fmt, *arg; You(fmt, arg); /* check whether player foolishly genocided self while poly'd */ - if ((mvitals[urole.malenum].mvflags & G_GENOD) - || (urole.femalenum != NON_PM - && (mvitals[urole.femalenum].mvflags & G_GENOD)) - || (mvitals[urace.malenum].mvflags & G_GENOD) - || (urace.femalenum != NON_PM - && (mvitals[urace.femalenum].mvflags & G_GENOD))) { + if (ugenocided()) { /* intervening activity might have clobbered genocide info */ struct kinfo *kptr = find_delayed_killer(POLYMORPH); @@ -1813,4 +1808,31 @@ polysense() } } +/* True iff hero's role or race has been genocided */ +boolean +ugenocided() +{ + return (boolean) ((mvitals[urole.malenum].mvflags & G_GENOD) + || (urole.femalenum != NON_PM + && (mvitals[urole.femalenum].mvflags & G_GENOD)) + || (mvitals[urace.malenum].mvflags & G_GENOD) + || (urace.femalenum != NON_PM + && (mvitals[urace.femalenum].mvflags & G_GENOD))); +} + +/* how hero feels "inside" after self-genocide of role or race */ +const char * +udeadinside() +{ + /* self-genocide used to always say "you feel dead inside" but that + seems silly when you're polymorphed into something undead; + monkilled() distinguishes between living (killed) and non (destroyed) + for monster death message; we refine the nonliving aspect a bit */ + return !nonliving(youmonst.data) + ? "dead" /* living, including demons */ + : !weirdnonliving(youmonst.data) + ? "condemned" /* undead plus manes */ + : "empty"; /* golems plus vortices */ +} + /*polyself.c*/ diff --git a/src/read.c b/src/read.c index 69d588427..e452bf33a 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 read.c $NHDT-Date: 1508479721 2017/10/20 06:08:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.148 $ */ +/* NetHack 3.6 read.c $NHDT-Date: 1513130018 2017/12/13 01:53:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.149 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2088,7 +2088,7 @@ do_class_genocide() u.uhp = -1; if (Upolyd) { if (!feel_dead++) - You_feel("dead inside."); + You_feel("%s inside.", udeadinside()); } else { if (!feel_dead++) You("die."); @@ -2269,7 +2269,7 @@ int how; /* KMH -- Unchanging prevents rehumanization */ if (Upolyd && ptr != youmonst.data) { delayed_killer(POLYMORPH, killer.format, killer.name); - You_feel("dead inside."); + You_feel("%s inside.", udeadinside()); } else done(GENOCIDED); } else if (ptr == youmonst.data) {