]> granicus.if.org Git - nethack/commitdiff
B07001 healed, undetected mimic
authornethack.allison <nethack.allison>
Mon, 12 Aug 2002 01:57:02 +0000 (01:57 +0000)
committernethack.allison <nethack.allison>
Mon, 12 Aug 2002 01:57:02 +0000 (01:57 +0000)
> [Cast a healing spell in a shop where no mimic was visible] So,
> "The small mimic looks better.". However, my picture still looks
> the same. Either the mimic should be shown, *or* I shouldn't get
> any message about the mimic healing. Both solutions seem equally
> valid to me.

If the mimic was mimicing the "strange object", then the healing causes
them to start mimicing something else with no message (the observant
player could notice however).

If the mimic was already mimicing a real object, a message similar
to this one results:
"The crude dagger seems a more vivid black than before."

include/extern.h
src/mon.c
src/zap.c

index f5f7de5d0be6ca45861f605a1f3cfcc7e2c79477..e34e7edb6d74ea74b6a4183cd71919c7fa3d408b 100644 (file)
@@ -912,6 +912,7 @@ E boolean FDECL(peace_minded, (struct permonst *));
 E void FDECL(set_malign, (struct monst *));
 E void FDECL(set_mimic_sym, (struct monst *));
 E int FDECL(mbirth_limit, (int));
+E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P));
 #ifdef GOLDOBJ
 E void FDECL(mkmonmoney, (struct monst *, long));
 #endif
index 410cd50e741000ba237f00e5d3d5a1438298ed0b..5583aa743019bef4eb17c2cbef0442e867197d36 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -2701,6 +2701,28 @@ pacify_guards()
            mtmp->mpeaceful = 1;
        }
 }
+
+void
+mimic_hit_msg(mtmp, otyp)
+struct monst *mtmp;
+short otyp;
+{
+       short ap = mtmp->mappearance;
+
+       switch(mtmp->m_ap_type) {
+           case M_AP_NOTHING:                  
+           case M_AP_FURNITURE:
+           case M_AP_MONSTER:
+               break;
+           case M_AP_OBJECT:
+               if (otyp == SPE_HEALING || otyp == SPE_EXTRA_HEALING) {
+                   pline("%s seems a more vivid %s than before.",
+                               The(simple_typename(ap)),
+                               c_obj_colors[objects[ap].oc_color]);
+               }
+               break;
+       }
+}
 #endif /* OVLB */
 
 /*mon.c*/
index f1f64ebcfd9eb4f3963a6198a36c6a551292c61c..56cc896cdf4118289f2afb2b1682c4144fff35e0 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -112,6 +112,8 @@ struct obj *otmp;
 #ifdef STEED
        struct obj *obj;
 #endif
+       boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC &&
+                                  mtmp->m_ap_type != M_AP_NOTHING);
 
        if (u.uswallow && mtmp == u.ustuck)
            reveal_invis = FALSE;
@@ -263,9 +265,17 @@ struct obj *otmp;
                    mtmp->mblinded = 0;
                    mtmp->mcansee = 1;
                }
-               if (canseemon(mtmp))
-                   pline("%s looks%s better.", Monnam(mtmp),
-                         otyp == SPE_EXTRA_HEALING ? " much" : "" );
+               if (canseemon(mtmp)) {
+                   if (disguised_mimic) {
+                       if (mtmp->m_ap_type == M_AP_OBJECT &&
+                               mtmp->mappearance == STRANGE_OBJECT)
+                               /* it can do better now */
+                               set_mimic_sym(mtmp);
+                       else
+                               mimic_hit_msg(mtmp, otyp);
+                   } else pline("%s looks%s better.", Monnam(mtmp),
+                                       otyp == SPE_EXTRA_HEALING ? " much" : "" );
+               }
                if (mtmp->mtame || mtmp->mpeaceful) {
                    adjalign(Role_if(PM_HEALER) ? 1 : sgn(u.ualign.type));
                }