From 624df671c61d806805bfaffd70c975aa3c9fb4bf Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Mon, 24 Nov 2008 23:35:33 +0000 Subject: [PATCH] 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. --- doc/fixes34.4 | 2 ++ src/dog.c | 18 +++++++++++------- src/mon.c | 17 ++++++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 990092552..7e6c7f494 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -374,6 +374,8 @@ archeologist shouldn't start with sling skill by carrying slingable touchstone ensure current_fruit gets set to the correct index when setting fruit option to existing entry whose fid is not the highest monsters already wearing suits can't put on shirts +if life-saved steed became untame, repeated "placing steed onto map?" warnings + would be given as long as the hero remained mounted Platform- and/or Interface-Specific Fixes diff --git a/src/dog.c b/src/dog.c index 9c8099fd4..f20a1fd8e 100644 --- a/src/dog.c +++ b/src/dog.c @@ -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; diff --git a/src/mon.c b/src/mon.c index 96a8fc135..bac721185 100644 --- a/src/mon.c +++ b/src/mon.c @@ -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; }