From eca287ab89cf71ffbfd6cfdb18f4d6652d79f42e Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 25 Aug 2007 00:32:10 +0000 Subject: [PATCH] feedback from exploding potions of acid (trunk only) water_damage() gave "A potion explodes!" when destroying potions of acid even when it was a stack of multiple potions exploding. The vague fixes entry "grammar, spelling and other typos" covers this one.... --- src/trap.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/trap.c b/src/trap.c index 220cf2f60..e22f15a32 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)trap.c 3.5 2007/06/18 */ +/* SCCS Id: @(#)trap.c 3.5 2007/08/24 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3074,7 +3074,7 @@ struct obj **objp; boolean force, here; { register struct obj *obj = *objp, *otmp; - boolean loose_obj = (obj && obj->where == OBJ_FREE); + boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; if (loose_obj && (obj->nobj || obj->nexthere)) { /* [this should actually be a panic()] */ @@ -3121,8 +3121,17 @@ boolean force, here; else obj->otyp = SPE_BLANK_PAPER; } else if (obj->oclass == POTION_CLASS) { if (obj->otyp == POT_ACID) { + char *bufp, buf[BUFSZ]; + boolean one = (obj->quan == 1L); + + bufp = strcpy(buf, "potion"); + if (!one) bufp = makeplural(bufp); /* [should we damage player/monster?] */ - pline("A potion explodes!"); + pline("%s %s %s!", /* "A potion explodes!" */ + !exploded ? (one ? "A" : "Some") : + (one ? "Another" : "More"), + bufp, vtense(bufp, "explode")); + exploded = TRUE; /* let caller know that obj has gone away [when obj is part of a list, delobj()'s obj_extract_self() takes care of this;