]> granicus.if.org Git - nethack/commitdiff
long worm tail hit by potion thrown by monster (trunk only)
authornethack.rankin <nethack.rankin>
Mon, 17 Dec 2007 23:43:31 +0000 (23:43 +0000)
committernethack.rankin <nethack.rankin>
Mon, 17 Dec 2007 23:43:31 +0000 (23:43 +0000)
     From the newsgroup:  when a monster throws a potion at the hero and
it hits a long worm's tail, you'd get "The bottle|flask|&c crashes on the
long worm's _head_ and breaks into shards."  The relevant code changes
"head" to "body" when appropriate, but monster throwing wasn't setting up
`notonhead' so that alteration only kicked in for player throwing.

doc/fixes35.0
src/dothrow.c
src/mthrowu.c

index a4f27b07210139ddb43493fdc78cd7f5998c7e35..c385d5aa72f908a3d71976a614cf224f6c0dcba0 100644 (file)
@@ -273,6 +273,8 @@ always update map display and use up turn if open or close command attempted
        while blind reveals change in door state or discloses non-door spot
 secret door detection's trap finding is no longer blocked by water or clouds
        on the Planes of Water and Air
+potion thrown by monster which hit a long worm's tail gave feedback about
+       hitting its head
 
 
 Platform- and/or Interface-Specific Fixes
index ef6fc79822bca2e37ec8de1db8c823291dc2253d..22936809ef049f2063c41a691ab6243e5b8a6919 100644 (file)
@@ -929,6 +929,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
                impaired = (Confusion || Stunned || Blind ||
                           Hallucination || Fumbling);
 
+       notonhead = FALSE;      /* reset potentially stale value */
        if ((obj->cursed || obj->greased) && (u.dx || u.dy) && !rn2(7)) {
            boolean slipok = TRUE;
            if (ammo_and_launcher(obj, uwep))
index 943501d04429f4910a0b0baf1e13bc76f83389ab..00e9b2d069ae6a00a3daffdae2d9434d816691d9 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mthrowu.c  3.5     2007/06/07      */
+/*     SCCS Id: @(#)mthrowu.c  3.5     2007/12/17      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -26,6 +26,8 @@ STATIC_OVL NEARDATA const char *breathwep[] = {
                                "strange breath #9"
 };
 
+extern boolean notonhead;      /* for long worms */
+
 /* hero is hit by something other than a monster */
 int
 thitu(tlev, dam, obj, name)
@@ -129,7 +131,7 @@ int x,y;
    return 1 if the object has stopped moving (hit or its range used up) */
 int
 ohitmon(mtmp, otmp, range, verbose)
-struct monst *mtmp;    /* accidental target */
+struct monst *mtmp;    /* accidental target, located at <bhitpos.x,.y> */
 struct obj *otmp;      /* missile; might be destroyed by drop_throw */
 int range;             /* how much farther will object travel if it misses */
                        /* Use -1 to signify to keep going even after hit, */
@@ -140,6 +142,7 @@ boolean verbose;  /* give message(s) even when you can't see what happened */
        boolean vis, ismimic;
        int objgone = 1;
 
+       notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
        ismimic = mtmp->m_ap_type && mtmp->m_ap_type != M_AP_MONSTER;
        vis = cansee(bhitpos.x, bhitpos.y);
 
@@ -245,6 +248,7 @@ struct obj *obj;            /* missile (or stack providing it) */
 
        bhitpos.x = x;
        bhitpos.y = y;
+       notonhead = FALSE;      /* reset potentially stale value */
 
        if (obj->quan == 1L) {
            /*