]> granicus.if.org Git - nethack/commitdiff
small mimic grabbing bug (trunk only)
authornethack.rankin <nethack.rankin>
Wed, 18 Feb 2009 01:13:24 +0000 (01:13 +0000)
committernethack.rankin <nethack.rankin>
Wed, 18 Feb 2009 01:13:24 +0000 (01:13 +0000)
     Noticed while testing the patch for monster ranged attacks when hero
is hidden.  Using #monster while in small mimic form would hide you, as
intended, but the first monster (or last monster?) who hit you hand-to-hand
would be grabbed ("It gets stuck on you.").  Unlike large and giant mimics,
small ones lack such a grab attack so when you eventually returned to
normal form, u.ustuck would remain set and you would end up being stuck
to an arbitrary monster instead of releasing it from your grasp.

doc/fixes35.0
src/mhitu.c

index 2a91f7bcbfe1a6a757d7edb9971aae28a1d95512..4021ae6beeaf1ece84d04ade3744717121df3867 100644 (file)
@@ -308,6 +308,8 @@ mimic posing as statue or corpse now picks and maintains particular monst type
 when levitating, don't show '>' as a likely direction for digging
 poly'd or mimicking hero who was hidden from monsters would still be treated
        as a normal target for their ranged attacks
+hero would remain stuck to an adjacent monster after rehumanizing if he had
+       been attacked while hiding via #monster when poly'd into a small mimic
 
 
 Platform- and/or Interface-Specific Fixes
index 9b38755de6852a68be7c4ca9b0c2613051b4b84b..288ed669e045ee3e89da6551937e35e6dc62d639 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mhitu.c    3.5     2007/12/19      */
+/*     SCCS Id: @(#)mhitu.c    3.5     2009/02/17      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -424,20 +424,23 @@ mattacku(mtmp)
                return(0);
        }
 
+       /* hero might be a mimic, concealed via #monster */
        if (youmonst.data->mlet == S_MIMIC && youmonst.m_ap_type &&
                    !range2 && foundyou && !u.uswallow) {
+               boolean sticky = sticks(youmonst.data);
+
                if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my);
-               if (!youseeit) pline("It gets stuck on you.");
+               if (sticky && !youseeit) pline("It gets stuck on you.");
                else pline("Wait, %s!  That's a %s named %s!",
                           m_monnam(mtmp), youmonst.data->mname, plname);
-               u.ustuck = mtmp;
+               if (sticky) u.ustuck = mtmp;
                youmonst.m_ap_type = M_AP_NOTHING;
                youmonst.mappearance = 0;
                newsym(u.ux,u.uy);
                return(0);
        }
 
-       /* player might be mimicking an object */
+       /* non-mimic hero might be mimicking an object after eating m corpse */
        if (youmonst.m_ap_type == M_AP_OBJECT && !range2 && foundyou && !u.uswallow) {
            if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my);
            if (!youseeit)