diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 3c514a8a4..a8202713e 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -117,6 +117,9 @@ for hilite_status of string status fields (title, dungeon-level, alignment), jumping into or over a Sokoban pit, or over a fire trap, triggers trap twice mimics created by #wizgenesis could block or not block vision incorrectly handle monsters inside the invocation area +give monsters who have had a worn item stolen or who have been life-saved + (used up amulet) a chance to wear replacement gear on next move + instead of having to wait until they pick something up Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/mhitm.c b/src/mhitm.c index 3b0f11855..95413843c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1268,6 +1268,9 @@ register struct attack *mattk; mwepgone(mdef); otmp->owornmask = 0L; update_mon_intrinsics(mdef, otmp, FALSE, FALSE); + /* give monster a chance to wear other equipment on its next + move instead of waiting until it picks something up */ + mdef->misc_worn_check |= I_SPECIAL; } /* add_to_minv() might free otmp [if it merges] */ if (vis) diff --git a/src/mon.c b/src/mon.c index 39e777a26..335e5b6b8 100644 --- a/src/mon.c +++ b/src/mon.c @@ -731,6 +731,17 @@ movemon() if (minliquid(mtmp)) continue; + /* after losing equipment, try to put on replacement */ + if (mtmp->misc_worn_check & I_SPECIAL) { + long oldworn; + + mtmp->misc_worn_check &= ~I_SPECIAL; + oldworn = mtmp->misc_worn_check; + m_dowear(mtmp, FALSE); + if (mtmp->misc_worn_check != oldworn || !mtmp->mcanmove) + continue; + } + if (is_hider(mtmp->data)) { /* unwatched mimics and piercers may hide again [MRS] */ if (restrap(mtmp)) @@ -1796,6 +1807,8 @@ struct monst *mtmp; pline_The("medallion crumbles to dust!"); } m_useup(mtmp, lifesave); + /* equip replacement amulet, if any, on next move */ + mtmp->misc_worn_check |= I_SPECIAL; surviver = !(mvitals[monsndx(mtmp->data)].mvflags & G_GENOD); mtmp->mcanmove = 1; @@ -1806,13 +1819,14 @@ struct monst *mtmp; if (mtmp->mhpmax <= 0) mtmp->mhpmax = 10; mtmp->mhp = mtmp->mhpmax; - 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; + if (!surviver) { + /* 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; + } } } diff --git a/src/uhitm.c b/src/uhitm.c index 0e482d6ec..b240eef26 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1484,6 +1484,9 @@ struct attack *mattk; setmnotwielded(mdef, otmp); otmp->owornmask = 0L; update_mon_intrinsics(mdef, otmp, FALSE, FALSE); + /* give monster a chance to wear other equipment on its next + move instead of waiting until it picks something up */ + mdef->misc_worn_check |= I_SPECIAL; if (otmp == stealoid) /* special message for final item */ pline("%s finishes taking off %s suit.", Monnam(mdef),