Invisible monsters looking much better
<Someone> reported back in December of an invisible monster using an amulet of lifesaving and looking much better. While the comment in the code says the amulet is visible, this does not mean the monster is. Add a secondary check.
This commit is contained in:
@@ -15,6 +15,7 @@ some actions such as eating corpses off the floor didn't check whether hero
|
|||||||
could reach the bottom of a pit
|
could reach the bottom of a pit
|
||||||
usmellmon() instead of "It turns into it" during monster polymorph
|
usmellmon() instead of "It turns into it" during monster polymorph
|
||||||
grammar of messages regarding eating artifacts
|
grammar of messages regarding eating artifacts
|
||||||
|
avoid a message about an invisible monster looking much better
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -1385,21 +1385,24 @@ struct monst *mtmp;
|
|||||||
struct obj *lifesave = mlifesaver(mtmp);
|
struct obj *lifesave = mlifesaver(mtmp);
|
||||||
|
|
||||||
if (lifesave) {
|
if (lifesave) {
|
||||||
/* not canseemon; amulets are on the head, so you don't want */
|
/* not canseemon; amulets are on the head, so you don't want
|
||||||
/* to show this for a long worm with only a tail visible. */
|
* to show this for a long worm with only a tail visible.
|
||||||
/* Nor do you check invisibility, because glowing and disinte- */
|
* Nor do you check invisibility, because glowing and
|
||||||
/* grating amulets are always visible. */
|
* disintegrating amulets are always visible. */
|
||||||
if (cansee(mtmp->mx, mtmp->my)) {
|
if (cansee(mtmp->mx, mtmp->my)) {
|
||||||
pline("But wait...");
|
pline("But wait...");
|
||||||
pline("%s medallion begins to glow!",
|
pline("%s medallion begins to glow!",
|
||||||
s_suffix(Monnam(mtmp)));
|
s_suffix(Monnam(mtmp)));
|
||||||
makeknown(AMULET_OF_LIFE_SAVING);
|
makeknown(AMULET_OF_LIFE_SAVING);
|
||||||
|
/* amulet is visible, but monster might not be */
|
||||||
|
if (canseemon(mtmp)) {
|
||||||
if (attacktype(mtmp->data, AT_EXPL)
|
if (attacktype(mtmp->data, AT_EXPL)
|
||||||
|| attacktype(mtmp->data, AT_BOOM))
|
|| attacktype(mtmp->data, AT_BOOM))
|
||||||
pline("%s reconstitutes!", Monnam(mtmp));
|
pline("%s reconstitutes!", Monnam(mtmp));
|
||||||
else
|
else
|
||||||
pline("%s looks much better!", Monnam(mtmp));
|
pline("%s looks much better!", Monnam(mtmp));
|
||||||
pline_The("medallion crumbles to dust!");
|
}
|
||||||
|
pline_The("medallion crumbles to dust!");
|
||||||
}
|
}
|
||||||
m_useup(mtmp, lifesave);
|
m_useup(mtmp, lifesave);
|
||||||
mtmp->mcanmove = 1;
|
mtmp->mcanmove = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user