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.
This commit is contained in:
nethack.rankin
2005-12-04 04:12:45 +00:00
parent 22269488fa
commit 1bb476cfe5
4 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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 */