From 8c90e9ae7b4c89c8d5f12a99654de0728160c357 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Mon, 5 Jan 2009 00:35:39 +0000 Subject: [PATCH] fatal explosion feedback (trunk only) From the newsgroup: As you read the scroll, it disappears. The scroll erupts in a tower of flame! Your spellbook of force bolt catches fire and burns! [...] Your potion of paralysis boils and explodes! Something seems to be holding you. Do you want your possessions idenified? This character survived the burning and boiling objects then succumbed to the initial flame explosion. A fatal explosion calls done() without any explanation. Or rather, it dated to the time where it would immediately follow "the scroll erupts in flame" (or "you are caught in explosion") without the chance for intervening messages. Then when item destruction was moved sooner (for bones file purposes), message sequencing was left dangling. This patch adds a new "it was fatal" message in front of done(). --- doc/fixes35.0 | 2 ++ include/flag.h | 4 +++- src/explode.c | 16 ++++++++++------ src/read.c | 3 ++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 0ebe06601..e676aa52b 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -296,6 +296,8 @@ monsters who ate green slime corpses weren't turned into green slime hero would "gladly take off " for nymph or succubus even while asleep concealed mimic wasn't revealed if kicking attmpt yielded a clumsy miss too accurate feedback given to a blinded hero when a monster summons insects +message sequencing for fatal explosions was confusing if feedback was given + for carried items being destroyed Platform- and/or Interface-Specific Fixes diff --git a/include/flag.h b/include/flag.h index 02ad13ab9..b05629975 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)flag.h 3.5 2007/04/26 */ +/* SCCS Id: @(#)flag.h 3.5 2009/01/04 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -324,6 +324,8 @@ extern NEARDATA struct instance_flags iflags; /* last_msg values */ #define PLNMSG_UNKNOWN 0 /* arbitrary */ #define PLNMSG_ONE_ITEM_HERE 1 /* "you see here" */ +#define PLNMSG_TOWER_OF_FLAME 2 /* scroll of fire */ +#define PLNMSG_CAUGHT_IN_EXPLOSION 3 /* explode() feedback */ /* runmode options */ #define RUN_TPORT 0 /* don't update display until movement stops */ diff --git a/src/explode.c b/src/explode.c index e409cbebd..cfd1496c2 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)explode.c 3.5 2007/04/27 */ +/* SCCS Id: @(#)explode.c 3.5 2009/01/04 */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -361,6 +361,7 @@ int expltype; str = hallu_buf; } You("are caught in the %s!", str); + iflags.last_msg = PLNMSG_CAUGHT_IN_EXPLOSION; } /* do property damage first, in case we end up leaving bones */ if (adtyp == AD_FIRE) burn_away_slime(); @@ -400,14 +401,17 @@ int expltype; killer.format = NO_KILLER_PREFIX; Sprintf(killer.name, "caught %sself in %s own %s", uhim(), uhis(), str); - } else if (!strncmpi(str,"tower of flame", 8) || - !strncmpi(str,"fireball", 8)) { - killer.format = KILLED_BY_AN; - Strcpy(killer.name, str); } else { - killer.format = KILLED_BY; + killer.format = (!strcmpi(str, "tower of flame") || + !strcmpi(str, "fireball")) ? + KILLED_BY_AN : KILLED_BY; Strcpy(killer.name, str); } + if (iflags.last_msg == PLNMSG_CAUGHT_IN_EXPLOSION || + iflags.last_msg == PLNMSG_TOWER_OF_FLAME) /*seffects()*/ + pline("It is fatal."); + else + pline_The("%s is fatal.", str); /* Known BUG: BURNING suppresses corpse in bones data, but done does not handle killer reason correctly */ done((adtyp == AD_FIRE) ? BURNING : DIED); diff --git a/src/read.c b/src/read.c index bc0728445..2ca34ce4c 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)read.c 3.5 2008/02/07 */ +/* SCCS Id: @(#)read.c 3.5 2009/01/04 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1325,6 +1325,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ pline_The("water around you vaporizes violently!"); } else { pline_The("scroll erupts in a tower of flame!"); + iflags.last_msg = PLNMSG_TOWER_OF_FLAME; /* for explode() */ burn_away_slime(); } explode(u.ux, u.uy, 11, (2*(rn1(3, 3) + 2 * cval) + 1)/3,