Rolling boulder traps and pacifism

If you stepped on an unknown rolling boulder trap, and that rolling boulder
hit a monster and killed it, you would be called a killer.  This makes
playing a pacifism conduct game rather difficult.
- track boulders from unknown rolling boulder traps, and don't charge/credit
hero if they kill monsters. This is done by temporarily setting otrapped on
such boulders.
- boulders from known traps are still charged/credited to the hero
- fix a couple places in ohitmon where is_poisonable wasn't checked along
with opoisoned.
This commit is contained in:
cohrs
2002-03-29 17:56:13 +00:00
parent 72048905ad
commit a1d3c539a9
6 changed files with 32 additions and 9 deletions

View File

@@ -188,7 +188,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
if (vis) hit(distant_name(otmp,mshot_xname), mtmp, exclam(damage));
else if (verbose) pline("It is hit%s", exclam(damage));
if (otmp->opoisoned) {
if (otmp->opoisoned && is_poisonable(otmp)) {
if (resists_poison(mtmp)) {
if (vis) pline_The("poison doesn't seem to affect %s.",
mon_nam(mtmp));
@@ -223,7 +223,10 @@ boolean verbose; /* give message(s) even when you can't see what happened */
pline("%s is %s!", Monnam(mtmp),
(nonliving(mtmp->data) || !vis)
? "destroyed" : "killed");
if (!flags.mon_moving) xkilled(mtmp,0);
/* don't blame hero for unknown rolling boulder trap */
if (!flags.mon_moving &&
(otmp->otyp != BOULDER || range >= 0 || !otmp->otrapped))
xkilled(mtmp,0);
else mondied(mtmp);
}
@@ -377,7 +380,8 @@ m_throw(mon, x, y, dx, dy, range, obj)
if (dam < 1) dam = 1;
hitu = thitu(hitv, dam, singleobj, (char *)0);
}
if (hitu && singleobj->opoisoned) {
if (hitu && singleobj->opoisoned &&
is_poisonable(singleobj)) {
char onmbuf[BUFSZ], knmbuf[BUFSZ];
struct obj otmp;
unsigned save_ocknown;