Merge branch 'NetHack-3.6.2'
This commit is contained in:
37
src/mhitu.c
37
src/mhitu.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1547118629 2019/01/10 11:10:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.161 $ */
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1555720104 2019/04/20 00:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.162 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -921,7 +921,7 @@ register struct attack *mattk;
|
||||
{
|
||||
struct permonst *mdat = mtmp->data;
|
||||
int uncancelled, ptmp;
|
||||
int dmg, armpro, permdmg;
|
||||
int dmg, armpro, permdmg, tmphp;
|
||||
char buf[BUFSZ];
|
||||
struct permonst *olduasmon = g.youmonst.data;
|
||||
int res;
|
||||
@@ -1396,8 +1396,39 @@ register struct attack *mattk;
|
||||
hitmsg(mtmp, mattk);
|
||||
if (uncancelled) {
|
||||
if (flags.verbose)
|
||||
Your("position suddenly seems very uncertain!");
|
||||
Your("position suddenly seems %suncertain!",
|
||||
(Teleport_control && !Stunned && !unconscious()) ? ""
|
||||
: "very ");
|
||||
tele();
|
||||
/* 3.6.2: make sure damage isn't fatal; previously, it
|
||||
was possible to be teleported and then drop dead at
|
||||
the destination when QM's 1d4 damage gets applied below;
|
||||
even though that wasn't "wrong", it seemed strange,
|
||||
particularly if the teleportation had been controlled
|
||||
[applying the damage first and not teleporting if fatal
|
||||
is another alternative but it has its own complications] */
|
||||
if ((Half_physical_damage ? (dmg - 1) / 2 : dmg)
|
||||
>= (tmphp = (Upolyd ? u.mh : u.uhp))) {
|
||||
dmg = tmphp - 1;
|
||||
if (Half_physical_damage)
|
||||
dmg *= 2; /* doesn't actually increase damage; we only
|
||||
* get here if half the original damage would
|
||||
* would have been fatal, so double reduced
|
||||
* damage will be less than original damage */
|
||||
if (dmg < 1) { /* implies (tmphp <= 1) */
|
||||
dmg = 1;
|
||||
/* this might increase current HP beyond maximum HP but
|
||||
it will be immediately reduced below, so that should
|
||||
be indistinguishable from zero damage; we don't drop
|
||||
damage all the way to zero because that inhibits any
|
||||
passive counterattack if poly'd hero has one */
|
||||
if (Upolyd && u.mh == 1)
|
||||
++u.mh;
|
||||
else if (!Upolyd && u.uhp == 1)
|
||||
++u.uhp;
|
||||
/* [don't set context.botl here] */
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AD_RUST:
|
||||
|
||||
Reference in New Issue
Block a user