git issue #994 - killed by a touch of death

Issue reported by vultur-cadens:  cause of death reason for touch
of death and death due to loss of strength only showed the cause,
not the monster spellcaster who was responsible.

This changes
|Killed by a touch of death.
to
|Killed by the touch of death inflicted by the Wizard of Yendor.
and
|Killed by terminal fraility.
to
|Killed by strength loss inflicted by a chameleon imitating an arch-lich.
(The 'imitating' part doesn't fit on the tombstone but will be present
in logfile/xlogfile.)

Noticed while implemented this:  touch of death was modifying u.uhpmax
and basing death vs damage on that even when hero was polymorphed.
It now rehumanizes the hero in that situation.

Closes #994
This commit is contained in:
PatR
2023-03-05 15:11:25 -08:00
parent f6562f39b7
commit b3d5158e64
6 changed files with 72 additions and 22 deletions

View File

@@ -409,9 +409,8 @@ done_in_by(struct monst *mtmp, int how)
{
char buf[BUFSZ];
struct permonst *mptr = mtmp->data,
*champtr = ((mtmp->cham >= LOW_PM)
? &mons[mtmp->cham]
: mptr);
*champtr = (mtmp->cham >= LOW_PM) ? &mons[mtmp->cham]
: mptr;
boolean distorted = (boolean) (Hallucination && canspotmon(mtmp)),
mimicker = (M_AP_TYPE(mtmp) == M_AP_MONSTER),
imitator = (mptr != champtr || mimicker);
@@ -442,7 +441,7 @@ done_in_by(struct monst *mtmp, int how)
if (imitator) {
char shape[BUFSZ];
const char *realnm = pmname(champtr, Mgender(mtmp)),
*fakenm = pmname(mptr, Mgender(mtmp));
*fakenm = pmname(mptr, Mgender(mtmp));
boolean alt = is_vampshifter(mtmp);
if (mimicker) {
@@ -498,7 +497,8 @@ done_in_by(struct monst *mtmp, int how)
/* might need to fix up multi_reason if 'mtmp' caused the reason */
if (gm.multi_reason
&& gm.multi_reason > gm.multireasonbuf
&& gm.multi_reason < gm.multireasonbuf + sizeof gm.multireasonbuf - 1) {
&& gm.multi_reason
< gm.multireasonbuf + sizeof gm.multireasonbuf - 1) {
char reasondummy, *p;
unsigned reasonmid = 0;