lifesaved steed (trunk only)

From the newsgroup:  hero's steed can become untame if killed while
it is wearing an amulet of life saving, leaving the hero still mounted
and resulting in repeated "placing steed onto map?" warnings when the
steed tries to move.  Force the hero to be thrown off the mount in that
situation.
This commit is contained in:
nethack.rankin
2008-11-24 23:35:33 +00:00
parent 4b1116f4d0
commit 624df671c6
3 changed files with 23 additions and 14 deletions

View File

@@ -922,19 +922,23 @@ boolean was_dead;
}
} else {
/* chance it goes wild anyway - Pet Semetary */
if (!rn2(mtmp->mtame)) {
mtmp->mpeaceful = mtmp->mtame = 0;
}
mtmp->mtame = rn2(mtmp->mtame + 1);
if (!mtmp->mtame) mtmp->mpeaceful = rn2(2);
}
if (!mtmp->mtame) {
if (!quietly && canspotmon(mtmp))
pline("%s %s.", Monnam(mtmp),
mtmp->mpeaceful ? "is no longer tame" : "has become feral");
newsym(mtmp->mx, mtmp->my);
/* a life-saved monster might be leashed;
don't leave it that way if it's no longer tame */
if (mtmp->mleashed) m_unleash(mtmp, TRUE);
}
/* if its still a pet, start a clean pet-slate now */
if (edog && mtmp->mtame) {
#ifdef STEED
if (mtmp == u.usteed) dismount_steed(DISMOUNT_THROWN);
#endif
} else if (edog) {
/* it's still a pet; start a clean pet-slate now */
edog->revivals++;
edog->killed_by_u = 0;
edog->abuse = 0;

View File

@@ -1481,6 +1481,7 @@ STATIC_OVL void
lifesaved_monster(mtmp)
struct monst *mtmp;
{
boolean surviver;
struct obj *lifesave = mlifesaver(mtmp);
if (lifesave) {
@@ -1504,19 +1505,21 @@ struct monst *mtmp;
pline_The("medallion crumbles to dust!");
}
m_useup(mtmp, lifesave);
surviver = !(mvitals[monsndx(mtmp->data)].mvflags & G_GENOD);
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;
if (mtmp->mtame && !mtmp->isminion) {
wary_dog(mtmp, FALSE);
wary_dog(mtmp, !surviver);
}
if (mtmp->mhpmax <= 0) mtmp->mhpmax = 10;
mtmp->mhp = mtmp->mhpmax;
if (mvitals[monsndx(mtmp->data)].mvflags & G_GENOD) {
if (cansee(mtmp->mx, mtmp->my))
pline("Unfortunately %s is still genocided...",
mon_nam(mtmp));
} else
return;
if (surviver) return;
/* genocided monster can't be life-saved */
if (cansee(mtmp->mx, mtmp->my))
pline("Unfortunately, %s is still genocided...",
mon_nam(mtmp));
}
mtmp->mhp = 0;
}