fix issue #843 - vampire revival sequencing

Reported by Umbire:
|You kill SpaceMannSpiff!  SpaceMannSpiff puts on a dwarvish cloak.
|SpaceMannSpiff puts on a dwarvish iron helm.
|The seemingly dead SpaceMannSpiff suddenly transforms and rises as
| a Vampire.

This was tough to reproduce but I finally managed it.  The issue
text mentions that it was fixed by copperwater in xNetHack with
commit 8c4af50f0aa3e72522f3eb98df039ff25c2a1ea0 to the repository
for that variant.  My attempt to cherry-pick that failed--I'm not
even sure whether it should have been expected to work--and some of
the code has been impinged upon by changes, so I ended up applying
the contents of that commit manually.

The commit changes how/when monsters put on new armor rather than
anything directly related to vampires.  Circumstances similar to
the example above now yield:
|You kill SpaceMannSpiff!
|The seemingly dead SpaceMannSpiff suddenly transforms and rises as
| a Vampire.
on one turn, then on the next turn the revived vampire produces:
|SpaceMannSpiff puts on a dwarvish cloak.

My test case only had one item of interest; I assume that the second
item of armor gets worn on a subsequent turn rather than at the same
time as the first one.

Fixes #843
This commit is contained in:
PatR
2022-09-15 18:02:07 -07:00
parent 6353bddaf6
commit 2b04cc9f5b
6 changed files with 35 additions and 12 deletions

View File

@@ -178,7 +178,8 @@ bhitm(struct monst *mtmp, struct obj *otmp)
if (disguised_mimic)
seemimic(mtmp);
mon_adjust_speed(mtmp, -1, otmp);
m_dowear(mtmp, FALSE); /* might want speed boots */
check_gear_next_turn(mtmp); /* might want speed boots */
if (engulfing_u(mtmp) && is_whirly(mtmp->data)) {
You("disrupt %s!", mon_nam(mtmp));
pline("A huge hole opens up...");
@@ -191,7 +192,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
if (disguised_mimic)
seemimic(mtmp);
mon_adjust_speed(mtmp, 1, otmp);
m_dowear(mtmp, FALSE); /* might want speed boots */
check_gear_next_turn(mtmp); /* might want speed boots */
}
if (mtmp->mtame)
helpful_gesture = TRUE;