petrification fixes

Eliminate the somewhat redundant "You die..." following "You turned
to stone..." when becoming petrified by touching a cockatrice (reported
by <email deleted> for kicking, but occurs for weaponless hitting too).
Also, if a cockatrice killed you with normal damage, your tombstone would
erroneously report petrification and presumeably there'd be a statue
instead of a ghost in the resulting bones file.  This fixes both things.
This commit is contained in:
nethack.rankin
2006-11-10 05:13:57 +00:00
parent f8f5642d3a
commit 2fa9bd0301
6 changed files with 13 additions and 15 deletions

View File

@@ -270,6 +270,7 @@ hero can't carry an unlimited number of boulders when poly'd into a giant
prevent very large number of objects in # inventory slot from causing
buffer overflow
!fixinv config was using arbitrary characters instead of # for invent overflow
don't report death by petrification if cockatrice kills hero via HP loss
Platform- and/or Interface-Specific Fixes

View File

@@ -609,7 +609,7 @@ E int NDECL(done2);
#ifdef USE_TRAMPOLI
E void FDECL(done_intr, (int));
#endif
E void FDECL(done_in_by, (struct monst *));
E void FDECL(done_in_by, (struct monst *,int));
#endif /* !MAKEDEFS_C && !LEV_LEX_C */
E void VDECL(panic, (const char *,...)) PRINTF_F(1,2);
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)

View File

@@ -186,13 +186,14 @@ int sig;
#endif /* NO_SIGNAL */
void
done_in_by(mtmp)
register struct monst *mtmp;
done_in_by(mtmp, how)
struct monst *mtmp;
int how;
{
char buf[BUFSZ];
boolean distorted = (boolean)(Hallucination && canspotmon(mtmp));
You("die...");
You((how == STONING) ? "turn to stone..." : "die...");
mark_synch(); /* flush buffered screen output */
buf[0] = '\0';
killer.format = KILLED_BY_AN;
@@ -246,10 +247,8 @@ register struct monst *mtmp;
if (u.ugrave_arise >= LOW_PM &&
(mvitals[u.ugrave_arise].mvflags & G_GENOD))
u.ugrave_arise = NON_PM;
if (touch_petrifies(mtmp->data))
done(STONING);
else
done(DIED);
done(how);
return;
}

View File

@@ -403,7 +403,7 @@ int spellnum;
if (Half_spell_damage) dmg = (dmg + 1) / 2;
losestr(rnd(dmg));
if (u.uhp < 1)
done_in_by(mtmp);
done_in_by(mtmp, DIED);
}
dmg = 0;
break;

View File

@@ -1169,8 +1169,7 @@ dopois:
}
make_stoned(5L, (char *)0, kformat, kname);
return(1);
/* You("turn to stone..."); */
/* done_in_by(mtmp); */
/* done_in_by(mtmp, STONING); */
}
}
}
@@ -1518,7 +1517,7 @@ dopois:
default: dmg = 0;
break;
}
if(u.uhp < 1) done_in_by(mtmp);
if (u.uhp < 1) done_in_by(mtmp, DIED);
/* Negative armor class reduces damage done instead of fully protecting
* against hits.
@@ -2059,7 +2058,7 @@ register int n;
if (u.mh < 1) rehumanize();
} else {
u.uhp -= n;
if(u.uhp < 1) done_in_by(mtmp);
if (u.uhp < 1) done_in_by(mtmp, DIED);
}
}

View File

@@ -2239,8 +2239,7 @@ boolean wep_was_destroyed;
if (!Stone_resistance &&
!(poly_when_stoned(youmonst.data) &&
polymon(PM_STONE_GOLEM))) {
You("turn to stone...");
done_in_by(mon);
done_in_by(mon, STONING); /* "You turn to stone..." */
return 2;
}
}