fix #M178 - mirror feedback for unID'd looking glass
From a bug report, applying a
mirror at sleeping Medusa yielded "too tired to look at your mirror" even
even though the item being used was listed in inventory as "looking glass".
Several other messages and any target monster would produce similar things.
Perhaps they should auto-ID when applied, but I changed messages to use
the description if real name isn't known.
This also treats incubi identically to succubi regarding mirrors:
they like to see their own image and will take the mirror away when one is
applied at them.
This commit is contained in:
@@ -147,6 +147,8 @@ when there were multiple boulders at a location, moving one of them sometimes
|
|||||||
resulted in line-of-sight anomalies
|
resulted in line-of-sight anomalies
|
||||||
unicorn can't catch gems if it is asleep or paralyzed
|
unicorn can't catch gems if it is asleep or paralyzed
|
||||||
fix grammar when choking on gold
|
fix grammar when choking on gold
|
||||||
|
some messages which referred to "mirror" ought to have used "looking glass"
|
||||||
|
incubi react to mirrors
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+35
-23
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)apply.c 3.5 2005/06/22 */
|
/* SCCS Id: @(#)apply.c 3.5 2005/09/20 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -684,26 +684,31 @@ STATIC_OVL int
|
|||||||
use_mirror(obj)
|
use_mirror(obj)
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
register struct monst *mtmp;
|
const char *mirror;
|
||||||
register char mlet;
|
struct monst *mtmp;
|
||||||
|
char mlet;
|
||||||
boolean vis;
|
boolean vis;
|
||||||
|
|
||||||
if(!getdir((char *)0)) return 0;
|
if(!getdir((char *)0)) return 0;
|
||||||
|
mirror = simple_typename(obj->otyp); /* "mirror" or "looking glass" */
|
||||||
if(obj->cursed && !rn2(2)) {
|
if(obj->cursed && !rn2(2)) {
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
pline_The("mirror fogs up and doesn't reflect!");
|
pline_The("%s fogs up and doesn't reflect!", mirror);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(!u.dx && !u.dy && !u.dz) {
|
if(!u.dx && !u.dy && !u.dz) {
|
||||||
if(!Blind && !Invisible) {
|
if(!Blind && !Invisible) {
|
||||||
if (u.umonnum == PM_FLOATING_EYE) {
|
if (u.umonnum == PM_FLOATING_EYE) {
|
||||||
if (!Free_action) {
|
if (Free_action) {
|
||||||
pline(Hallucination ?
|
You("stiffen momentarily under your gaze.");
|
||||||
"Yow! The mirror stares back!" :
|
} else {
|
||||||
"Yikes! You've frozen yourself!");
|
if (Hallucination)
|
||||||
nomul(-rnd((MAXULEV+6) - u.ulevel));
|
pline("Yow! The %s stares back!", mirror);
|
||||||
nomovemsg = 0;
|
else
|
||||||
} else You("stiffen momentarily under your gaze.");
|
pline("Yikes! You've frozen yourself!");
|
||||||
|
nomul(-rnd((MAXULEV+6) - u.ulevel));
|
||||||
|
nomovemsg = 0; /* default, "you can move again" */
|
||||||
|
}
|
||||||
} else if (youmonst.data->mlet == S_VAMPIRE)
|
} else if (youmonst.data->mlet == S_VAMPIRE)
|
||||||
You("don't have a reflection.");
|
You("don't have a reflection.");
|
||||||
else if (u.umonnum == PM_UMBER_HULK) {
|
else if (u.umonnum == PM_UMBER_HULK) {
|
||||||
@@ -755,16 +760,16 @@ struct obj *obj;
|
|||||||
vis = canseemon(mtmp);
|
vis = canseemon(mtmp);
|
||||||
mlet = mtmp->data->mlet;
|
mlet = mtmp->data->mlet;
|
||||||
if (mtmp->msleeping) {
|
if (mtmp->msleeping) {
|
||||||
if (vis)
|
if (vis)
|
||||||
pline ("%s is too tired to look at your mirror.",
|
pline("%s is too tired to look at your %s.",
|
||||||
Monnam(mtmp));
|
Monnam(mtmp), mirror);
|
||||||
} else if (!mtmp->mcansee) {
|
} else if (!mtmp->mcansee) {
|
||||||
if (vis)
|
if (vis)
|
||||||
pline("%s can't see anything right now.", Monnam(mtmp));
|
pline("%s can't see anything right now.", Monnam(mtmp));
|
||||||
/* some monsters do special things */
|
/* some monsters do special things */
|
||||||
} else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
|
} else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
|
||||||
if (vis)
|
if (vis)
|
||||||
pline ("%s doesn't have a reflection.", Monnam(mtmp));
|
pline("%s doesn't have a reflection.", Monnam(mtmp));
|
||||||
} else if(!mtmp->mcan && !mtmp->minvis &&
|
} else if(!mtmp->mcan && !mtmp->minvis &&
|
||||||
mtmp->data == &mons[PM_MEDUSA]) {
|
mtmp->data == &mons[PM_MEDUSA]) {
|
||||||
if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
|
if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
|
||||||
@@ -778,8 +783,9 @@ struct obj *obj;
|
|||||||
int tmp = d((int)mtmp->m_lev, (int)mtmp->data->mattk[0].damd);
|
int tmp = d((int)mtmp->m_lev, (int)mtmp->data->mattk[0].damd);
|
||||||
if (!rn2(4)) tmp = 120;
|
if (!rn2(4)) tmp = 120;
|
||||||
if (vis)
|
if (vis)
|
||||||
pline("%s is frozen by its reflection.", Monnam(mtmp));
|
pline("%s is frozen by its reflection.", Monnam(mtmp));
|
||||||
else You_hear("%s stop moving.",something);
|
else
|
||||||
|
You_hear("%s stop moving.", something);
|
||||||
mtmp->mcanmove = 0;
|
mtmp->mcanmove = 0;
|
||||||
if ( (int) mtmp->mfrozen + tmp > 127)
|
if ( (int) mtmp->mfrozen + tmp > 127)
|
||||||
mtmp->mfrozen = 127;
|
mtmp->mfrozen = 127;
|
||||||
@@ -787,14 +793,20 @@ struct obj *obj;
|
|||||||
} else if(!mtmp->mcan && !mtmp->minvis &&
|
} else if(!mtmp->mcan && !mtmp->minvis &&
|
||||||
mtmp->data == &mons[PM_UMBER_HULK]) {
|
mtmp->data == &mons[PM_UMBER_HULK]) {
|
||||||
if (vis)
|
if (vis)
|
||||||
pline ("%s confuses itself!", Monnam(mtmp));
|
pline("%s confuses itself!", Monnam(mtmp));
|
||||||
mtmp->mconf = 1;
|
mtmp->mconf = 1;
|
||||||
} else if(!mtmp->mcan && !mtmp->minvis && (mlet == S_NYMPH
|
} else if (!mtmp->mcan && !mtmp->minvis &&
|
||||||
|| mtmp->data==&mons[PM_SUCCUBUS])) {
|
(mlet == S_NYMPH ||
|
||||||
|
mtmp->data == &mons[PM_SUCCUBUS] ||
|
||||||
|
mtmp->data == &mons[PM_INCUBUS])) {
|
||||||
if (vis) {
|
if (vis) {
|
||||||
pline ("%s admires herself in your mirror.", Monnam(mtmp));
|
char buf[BUFSZ]; /* "She" or "He" */
|
||||||
pline ("She takes it!");
|
|
||||||
} else pline ("It steals your mirror!");
|
pline("%s admires %sself in your %s.", Monnam(mtmp),
|
||||||
|
mhim(mtmp), mirror);
|
||||||
|
pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
|
||||||
|
} else
|
||||||
|
pline("It steals your %s!", mirror);
|
||||||
setnotworn(obj); /* in case mirror was wielded */
|
setnotworn(obj); /* in case mirror was wielded */
|
||||||
freeinv(obj);
|
freeinv(obj);
|
||||||
(void) mpickobj(mtmp,obj);
|
(void) mpickobj(mtmp,obj);
|
||||||
|
|||||||
Reference in New Issue
Block a user