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 <some kind of> 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().
This commit is contained in:
nethack.rankin
2009-01-05 00:35:39 +00:00
parent 76350a5348
commit 8c90e9ae7b
4 changed files with 17 additions and 8 deletions

View File

@@ -296,6 +296,8 @@ monsters who ate green slime corpses weren't turned into green slime
hero would "gladly take off <armor>" 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

View File

@@ -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 <single item> 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 */

View File

@@ -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);

View File

@@ -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,