using an unlocking tool on a closed door which was actually a mimic reported
that there was no door to unlock instead of exposing the mimic
purple worm could end up in wall or solid rock when swallowing ghost or xorn
+enhance life-saving by preventing subsequent poison from being fatal upon
+ rescue from death due to spiked pit, dart trap, or poisoned missile
Platform- and/or Interface-Specific Fixes
/* NetHack 3.5 attrib.c $Date$ $Revision$ */
-/* SCCS Id: @(#)attrib.c 3.5 2008/02/02 */
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
poisoned(reason, typ, pkiller, fatal, thrown_weapon)
const char *reason, /* controls what messages we display */
*pkiller; /* for score+log file if fatal */
-int typ, fatal;
+int typ, fatal; /* if fatal is 0, limit damage to adjattrib */
boolean thrown_weapon; /* thrown weapons are less deadly */
{
- int i, kprefix = KILLED_BY_AN;
+ int i, loss, kprefix = KILLED_BY_AN;
/* inform player about being poisoned unless that's already been done;
"blast" has given a "blast of poison gas" message; "poison arrow",
kprefix = KILLED_BY;
}
- i = rn2(fatal + (thrown_weapon ? 20 : 0));
+ i = !fatal ? 1 : rn2(fatal + (thrown_weapon ? 20 : 0));
if (i == 0 && typ != A_CHA) {
+ /* instant kill */
u.uhp = -1;
pline_The("poison was deadly...");
- } else if (i <= 5) {
+ } else if (i > 5) {
+ /* HP damage; more likely--but less severe--with missiles */
+ loss = thrown_weapon ? rnd(6) : rn1(10,6);
+ losehp(loss, pkiller, kprefix); /* poison damage */
+ } else {
+ /* attribute loss; if typ is A_STR, reduction in current and
+ maximum HP will occur once strength has dropped down to 3 */
+ loss = (thrown_weapon || !fatal) ? 1 : d(2, 2); /* was rn1(3,3) */
/* check that a stat change was made */
- if (adjattrib(typ, thrown_weapon ? -1 : -rn1(3,3), 1))
+ if (adjattrib(typ, -loss, 1))
poisontell(typ, TRUE);
- } else {
- i = thrown_weapon ? rnd(6) : rn1(10,6);
- losehp(i, pkiller, kprefix); /* poison damage */
}
if (u.uhp < 1) {
/* NetHack 3.5 mthrowu.c $Date$ $Revision$ */
-/* SCCS Id: @(#)mthrowu.c 3.5 2009/02/17 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
struct monst *mtmp;
struct obj *singleobj;
char sym = obj->oclass;
- int hitu, blindinc = 0;
+ int hitu, oldumort, blindinc = 0;
bhitpos.x = x;
bhitpos.y = y;
potionhit(&youmonst, singleobj, FALSE);
break;
}
+ oldumort = u.umortality;
switch(singleobj->otyp) {
int dam, hitv;
case EGG:
Strcpy(onmbuf, xname(singleobj));
Strcpy(knmbuf, killer_xname(singleobj));
- poisoned(onmbuf, A_STR, knmbuf, 10, TRUE);
+ poisoned(onmbuf, A_STR, knmbuf,
+ /* if damage triggered life-saving,
+ poison is limited to attrib loss */
+ (u.umortality > oldumort) ? 0 : 10, TRUE);
}
if(hitu &&
can_blnd((struct monst*)0, &youmonst,
forcebungle = (trflags & FORCEBUNGLE) != 0,
plunged = (trflags & TOOKPLUNGE) != 0,
adj_pit = conjoined_pits(trap, t_at(u.ux0,u.uy0), TRUE);
+ int oldumort;
#ifdef STEED
int steed_article = ARTICLE_THE;
#endif
otmp->quan = 1L;
otmp->owt = weight(otmp);
if (!rn2(6)) otmp->opoisoned = 1;
+ oldumort = u.umortality;
#ifdef STEED
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) /* nothing */;
else
#endif
if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) {
if (otmp->opoisoned)
- poisoned("dart", A_CON, "little dart", 10, TRUE);
+ poisoned("dart", A_CON, "little dart",
+ /* if damage triggered life-saving,
+ poison is limited to attrib loss */
+ (u.umortality > oldumort) ? 0 : 10, TRUE);
obfree(otmp, (struct obj *)0);
} else {
place_object(otmp, u.ux, u.uy);
if (!steedintrap(trap, (struct obj *)0)) {
#endif
if (ttype == SPIKED_PIT) {
+ oldumort = u.umortality;
losehp(Maybe_Half_Phys(rnd(adj_pit ? 6 : 10)),
plunged ? "deliberately plunged into a pit of iron spikes" :
adj_pit ? "stepped into a pit of iron spikes" :
NO_KILLER_PREFIX);
if (!rn2(6))
poisoned("spikes", A_STR,
- adj_pit ? "stepping on poison spikes" :
- "fall onto poison spikes",
- 8, FALSE);
+ adj_pit ? "stepping on poison spikes" :
+ "fall onto poison spikes",
+ /* if damage triggered life-saving,
+ poison is limited to attrib loss */
+ (u.umortality > oldumort) ? 0 : 8, FALSE);
} else {
if (!adj_pit)
losehp(Maybe_Half_Phys(rnd(6)),