]> granicus.if.org Git - nethack/commitdiff
monsters throwing greased objects
authornethack.rankin <nethack.rankin>
Tue, 17 Aug 2004 00:40:35 +0000 (00:40 +0000)
committernethack.rankin <nethack.rankin>
Tue, 17 Aug 2004 00:40:35 +0000 (00:40 +0000)
     Make the chance for thrown object to slip or shot object to misfire
be the same for monsters as it is for the hero.

doc/fixes34.4
src/mthrowu.c

index 2b144909b8c7bf39429968aacb96c087f24fb058..f03f1312214bf61ca47f7aa8e4c7a1d58ade0878 100644 (file)
@@ -47,6 +47,7 @@ fix incomplete sentence occuring when unique monster's corpse fell down stairs
 fractured boulders or statues produced inconsistent object settings on the
        resulting rocks
 really fix rolling boulder bug C340-18, the previous "fix" reversed the test
+monster throwing greased weapon has same chance for slip/misfire as player
 
 
 Platform- and/or Interface-Specific Fixes
index b6d25b9888577b9780736e1fd25531278082b65a..3198ce880fd371c6b90f3c4ec9eddafa122cd989 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mthrowu.c  3.4     2004/06/12      */
+/*     SCCS Id: @(#)mthrowu.c  3.4     2004/08/16      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -234,11 +234,11 @@ boolean verbose;  /* give message(s) even when you can't see what happened */
 
 void
 m_throw(mon, x, y, dx, dy, range, obj)
-       register struct monst *mon;
-       register int x,y,dx,dy,range;           /* direction and range */
-       register struct obj *obj;
+struct monst *mon;             /* launching monster */
+int x, y, dx, dy, range;       /* launch point, direction, and range */
+struct obj *obj;               /* missile (or stack providing it) */
 {
-       register struct monst *mtmp;
+       struct monst *mtmp;
        struct obj *singleobj;
        char sym = obj->oclass;
        int hitu, blindinc = 0;
@@ -273,7 +273,8 @@ m_throw(mon, x, y, dx, dy, range, obj)
 
        singleobj->owornmask = 0; /* threw one of multiple weapons in hand? */
 
-       if (singleobj->cursed && (dx || dy) && !rn2(7)) {
+       if ((singleobj->cursed || singleobj->greased) && (dx || dy) &&
+               !rn2(7)) {
            if(canseemon(mon) && flags.verbose) {
                if(is_ammo(singleobj))
                    pline("%s misfires!", Monnam(mon));