diff --git a/doc/fixes36.3 b/doc/fixes36.3 index aacc0e8de..ea02fdf39 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.100 $ $NHDT-Date: 1565090653 2019/08/06 11:24:13 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.102 $ $NHDT-Date: 1565574993 2019/08/12 01:56:33 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -116,6 +116,10 @@ when a boulder was teleported, if it landed in a pit or trap door or hole its former location wasn't updated to show that it wasn't there anymore (noticed in Sokoban but not limited to there) Terry Pratchett tribute, fix typo in passage #4 for Mort ("the" -> "they") +fix typo in end_of_input() present since 3.6.0 that would prevent compilation + for NOSAVEONHANGUP+INSURANCE configuration +when a status condition becomes fatal, keep it listed as an active condition + during disclosure and/or dumplog rather than having it already reset Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/cmd.c b/src/cmd.c index 7fdfedd08..f37f62cbe 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1562838823 2019/07/11 09:53:43 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.340 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1565574994 2019/08/12 01:56:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.343 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2328,26 +2328,50 @@ int final; youhiding(TRUE, final); /* internal troubles, mostly in the order that prayer ranks them */ - if (Stoned) - you_are("turning to stone", ""); - if (Slimed) - you_are("turning into slime", ""); + if (Stoned) { + if (final && (Stoned & I_SPECIAL)) + enlght_out(" You turned into stone."); + else + you_are("turning to stone", ""); + } + if (Slimed) { + if (final && (Slimed & I_SPECIAL)) + enlght_out(" You turned into slime."); + else + you_are("turning into slime", ""); + } if (Strangled) { if (u.uburied) { you_are("buried", ""); } else { - Strcpy(buf, "being strangled"); - if (wizard) - Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT)); - you_are(buf, from_what(STRANGLED)); + if (final && (Strangled & I_SPECIAL)) { + enlght_out(" You died from strangulation."); + } else { + Strcpy(buf, "being strangled"); + if (wizard) + Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT)); + you_are(buf, from_what(STRANGLED)); + } } } if (Sick) { - /* prayer lumps these together; botl puts Ill before FoodPois */ - if (u.usick_type & SICK_NONVOMITABLE) - you_are("terminally sick from illness", ""); - if (u.usick_type & SICK_VOMITABLE) - you_are("terminally sick from food poisoning", ""); + /* the two types of sickness are lumped together; hero can be + afflicted by both but there is only one timeout; botl status + puts TermIll before FoodPois and death due to timeout reports + terminal illness if both are in effect, so do the same here */ + if (final && (Sick & I_SPECIAL)) { + Sprintf(buf, " %sdied from %s.", You_, /* has trailing space */ + (u.usick_type & SICK_NONVOMITABLE) + ? "terminal illness" : "food poisoning"); + enlght_out(buf); + } else { + /* unlike death due to sickness, report the two cases separately + because it is possible to cure one without curing the other */ + if (u.usick_type & SICK_NONVOMITABLE) + you_are("terminally sick from illness", ""); + if (u.usick_type & SICK_VOMITABLE) + you_are("terminally sick from food poisoning", ""); + } } if (Vomiting) you_are("nauseated", ""); @@ -5843,7 +5867,7 @@ end_of_input() #ifdef NOSAVEONHANGUP #ifdef INSURANCE if (flags.ins_chkpt && g.program_state.something_worth_saving) - program_statue.preserve_locks = 1; /* keep files for recovery */ + program_state.preserve_locks = 1; /* keep files for recovery */ #endif g.program_state.something_worth_saving = 0; /* don't save */ #endif diff --git a/src/hack.c b/src/hack.c index 1c1e29391..abd288968 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 hack.c $NHDT-Date: 1559664951 2019/06/04 16:15:51 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.213 $ */ +/* NetHack 3.6 hack.c $NHDT-Date: 1565288730 2019/08/08 18:25:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.215 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2640,9 +2640,9 @@ dopickup(VOID_ARGS) ? g.multi + 1 : 0; g.multi = 0; /* always reset */ - if ((ret = pickup_checks() >= 0)) + if ((ret = pickup_checks()) >= 0) { return ret; - else if (ret == -2) { + } else if (ret == -2) { tmpcount = -count; return loot_mon(u.ustuck, &tmpcount, (boolean *) 0); } /* else ret == -1 */ diff --git a/src/timeout.c b/src/timeout.c index c4a059839..ae9b52e69 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 timeout.c $NHDT-Date: 1564269133 2019/07/27 23:12:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.91 $ */ +/* NetHack 3.6 timeout.c $NHDT-Date: 1565574996 2019/08/12 01:56:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.92 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -13,7 +13,8 @@ static void NDECL(vomiting_dialogue); static void NDECL(choke_dialogue); static void NDECL(levitation_dialogue); static void NDECL(slime_dialogue); -static void FDECL(slimed_to_death, (struct kinfo *)); +static void NDECL(phaze_dialogue); +static void FDECL(done_timeout, (int, int)); static void NDECL(slip_or_trip); static void FDECL(see_lamp_flicker, (struct obj *, const char *)); static void FDECL(lantern_message, (struct obj *)); @@ -408,7 +409,7 @@ struct kinfo *kptr; /* become a green slime; also resets youmonst.m_ap_type+.mappearance */ (void) polymon(PM_GREEN_SLIME); g.mvitals[PM_GREEN_SLIME].mvflags = save_mvflags; - done(TURNED_SLIME); + done_timeout(TURNED_SLIME, SLIMED); /* life-saved; even so, hero still has turned into green slime; player may have genocided green slimes after being infected */ @@ -427,7 +428,7 @@ struct kinfo *kptr; /* follows "The medallion crumbles to dust." */ pline("Unfortunately, %s", slimebuf); /* die again; no possibility of amulet this time */ - done(GENOCIDED); + done(GENOCIDED); /* [should it be done_timeout(GENOCIDED, SLIMED)?] */ /* could be life-saved again (only in explore or wizard mode) but green slimes are gone; just stay in current form */ } @@ -458,6 +459,23 @@ phaze_dialogue() pline1(phaze_texts[SIZE(phaze_texts) - i]); } +/* when a status timeout is fatal, keep the status line indicator shown + during end of game rundown (and potential dumplog); + timeout has already counted down to 0 by the time we get here */ +static void +done_timeout(how, which) +int how, which; +{ + long *intrinsic_p = &u.uprops[which].intrinsic; + + *intrinsic_p |= I_SPECIAL; /* affects final disclosure */ + done(how); + + /* life-saved */ + *intrinsic_p &= ~I_SPECIAL; + g.context.botl = TRUE; +} + void nh_timeout() { @@ -543,10 +561,10 @@ nh_timeout() } dealloc_killer(kptr); /* (unlike sliming, you aren't changing form here) */ - done(STONING); + done_timeout(STONING, STONED); break; case SLIMED: - slimed_to_death(kptr); /* done(TURNED_SLIME) */ + slimed_to_death(kptr); /* done_timeout(TURNED_SLIME,SLIMED) */ break; case VOMITING: make_vomiting(0L, TRUE); @@ -570,8 +588,8 @@ nh_timeout() g.killer.format = KILLED_BY; } } + done_timeout(POISONING, SICK); u.usick_type = 0; - done(POISONING); break; case FAST: if (!Very_fast) @@ -674,7 +692,7 @@ nh_timeout() g.killer.format = KILLED_BY; Strcpy(g.killer.name, (u.uburied) ? "suffocation" : "strangulation"); - done(DIED); + done_timeout(DIED, STRANGLED); /* must be declining to die in explore|wizard mode; treat like being cured of strangulation by prayer */ if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) {