fix github issue #401 - roast/rust/rot in peace

This tries to fix the problem of the extra message when a tame
golem is completely destroyed (paper or straw golem burned, iron
golem rusted, wood or leather golem rotted) being issued at odd
times.  I basically punted on the visibility aspect since the
original logic was strange:  you had to be able to see both the
attacker's and defender's spots and at least one of those two
monsters.  Now mon-attacks-mon visibility requires that you be
able to see one of the two and if you don't see both, the unseen
one will be referred to as "it".  The "may the iron golem rust
in peace" message is independent of that and may be displayed
after "you have a sad feeling", but now that's intentional and
will refer to an unseen pet by name or monster type, not "it".

This needs a lot of testing and hasn't attempted to address
issue #402:  only some attacks that should compeletely destroy
a golem actually do so.  (So a hit by fire elemental against a
paper golem does, but passive fire counterattack when a paper
golem hits a fire elemental doesn't, nor does a wand of fire
or being hit by Firebrand.)

Fixes #401
This commit is contained in:
PatR
2020-11-27 02:38:17 -08:00
parent 8d91a9f764
commit bb9df368af
7 changed files with 65 additions and 44 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mondata.h $NHDT-Date: 1596498548 2020/08/03 23:49:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.44 $ */
/* NetHack 3.7 mondata.h $NHDT-Date: 1606473485 2020/11/27 10:38:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.45 $ */
/* Copyright (c) 1989 Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
@@ -224,9 +224,12 @@
#define nonliving(ptr) \
(is_undead(ptr) || (ptr) == &mons[PM_MANES] || weirdnonliving(ptr))
/* no corpse (ie, blank scrolls) if killed by fire */
/* no corpse (ie, blank scrolls) if killed by fire; special case instakill */
#define completelyburns(ptr) \
((ptr) == &mons[PM_PAPER_GOLEM] || (ptr) == &mons[PM_STRAW_GOLEM])
#define completelyrots(ptr) \
((ptr) == &mons[PM_WOOD_GOLEM] || (ptr) == &mons[PM_LEATHER_GOLEM])
#define completelyrusts(ptr) ((ptr) == &mons[PM_IRON_GOLEM])
/* Used for conduct with corpses, tins, and digestion attacks */
/* G_NOCORPSE monsters might still be swallowed as a purple worm */