From: nethack.rankin Date: Sun, 4 Dec 2005 04:12:45 +0000 (+0000) Subject: demon graft X-Git-Tag: MOVE2GIT~1193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bb476cfe54c70e6924214709e00d3cef45e3ef3;p=nethack demon graft From a bug report, bribeable demons will demand money when hero has fainted from lack of food and hero can pay while unconscious. I decided to just borrow from vault guard behavior and have the hero regain consciousness. It turns out that reset_faint() has been broken since a long ago (before my time...) change to nomul() [nomul(0) is a no-op while fainted since multi is negative then]. Now fixed; both bribe-demanding demons and vault guards will cause fainted hero to wake up when they arrive. If hero can't move for some reason other than fainting, demons will skip the bribe demand and immediately become hostile (vault guard in that case goes away after saying that he'll return). There is no deafness handling; perhaps the bribe demand is accompanied by sufficient pantomiming for the hero to figure it out? ;-) Also fix an unintended potential alignment hit against the player if bribeable demon is killed after becoming hostile due to misjudging displaced hero's location. --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 4194bde52..ce7cf491c 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -164,6 +164,7 @@ tombstone's reason for death from kicking an object could include so much detail about the object that is was too verbose several quest messages were worded inappropriately if the hero was blind a samurai quest guardian message used "ninja" where "ronin" was intended +revive from fainting if vault guard or bribe-demanding demon approaches Platform- and/or Interface-Specific Fixes diff --git a/src/eat.c b/src/eat.c index a439021b6..064c9aedc 100644 --- a/src/eat.c +++ b/src/eat.c @@ -2514,7 +2514,7 @@ is_fainted() void reset_faint() /* call when a faint must be prematurely terminated */ { - if(is_fainted()) nomul(0); + if (afternmv == unfaint) unmul("You revive."); } void diff --git a/src/minion.c b/src/minion.c index 0480ea1d2..f66cd1b7d 100644 --- a/src/minion.c +++ b/src/minion.c @@ -156,6 +156,13 @@ register struct monst *mtmp; return 0; } + if (is_fainted()) { + reset_faint(); /* if fainted - wake up */ + } else { + stop_occupation(); + if (multi > 0) { nomul(0); unmul((char *)0); } + } + /* Slight advantage given. */ if (is_dprince(mtmp->data) && mtmp->minvis) { mtmp->minvis = mtmp->perminvis = 0; @@ -176,7 +183,7 @@ register struct monst *mtmp; demand = (cash * (rnd(80) + 20 * Athome)) / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); - if (!demand) { /* you have no gold */ + if (!demand || multi < 0) { /* you have no gold or can't move */ mtmp->mpeaceful = 0; set_malign(mtmp); return 0; diff --git a/src/monmove.c b/src/monmove.c index 1fb1d4934..a247d1f3d 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -396,6 +396,7 @@ register struct monst *mtmp; /* Why? For the same reason in real demon talk */ pline("%s gets angry!", Amonnam(mtmp)); mtmp->mpeaceful = 0; + set_malign(mtmp); /* since no way is an image going to pay it off */ } } else if(demon_talk(mtmp)) return(1); /* you paid it off */