fix #H2225 - death by poison after life-saving (trunk only)
From a bug report, when falling into a spiked pit and being killed and then life-saved, you could immediately die from fatal poison. It isn't necessarily a bug and there are other ways to be killed, life-saved, and re-killed (such as zaps that bounce off walls or reflecting targets), but it does seem to be somewhat unfair. This patch makes life-saving be more effective: in a damage-plus-poison situation, if the damage triggers life-saving then the poison won't deal out any further damage (including its nasty chance for instant death). The poison still matters, but it will always target an attribute stat--which is already one possible random outcome--instead of maybe doing damage. [It is actually possible to get damage if stat loss tries to take hero's strength below 3, but now there's no chance of that being fatal immediately after savelife() has restored full hit points.]
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
/* 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. */
|
||||
|
||||
@@ -245,7 +244,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
||||
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;
|
||||
@@ -346,6 +345,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
||||
potionhit(&youmonst, singleobj, FALSE);
|
||||
break;
|
||||
}
|
||||
oldumort = u.umortality;
|
||||
switch(singleobj->otyp) {
|
||||
int dam, hitv;
|
||||
case EGG:
|
||||
@@ -383,7 +383,10 @@ struct obj *obj; /* missile (or stack providing it) */
|
||||
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user