]> granicus.if.org Git - nethack/commitdiff
wishing for flint
authorPatR <rankin@nethack.org>
Fri, 1 Apr 2022 17:53:19 +0000 (10:53 -0700)
committerPatR <rankin@nethack.org>
Fri, 1 Apr 2022 17:53:19 +0000 (10:53 -0700)
Allow wishes for quantity up to 20 to be granted when asking for
flint.  Like rocks, flints are mainly useful as sling ammo.

Also, remove the hardcoded assumption that globs weigh 20 when wish
handling computes glob weight based on user-specified count and/or
relative size.

src/objnam.c

index 88411bde407900c168f82da0b94ff53a49d1ae64..2938ca516403308fce621a4954c4a48bad4a94bf 100644 (file)
@@ -4586,7 +4586,8 @@ readobjnam(char *bp, struct obj *no_wish)
            2: medium (6..15) => use weight for 6, yielding 120;
            3: large (16..25) => 320; 4: very large (26+) => 520 */
         if (d.gsize > 1)
-            d.otmp->owt += (unsigned) (100 + (d.gsize - 2) * 200);
+            d.otmp->owt += ((unsigned) (5 + (d.gsize - 2) * 10)
+                            * d.otmp->owt);  /* 20 + {5|15|25} times 20 */
         if (d.cnt > 1) {
             if ((d.cnt > 6 - d.gsize) && !wizard)
                 d.cnt = rn1(5, 2); /* 2..6 */
@@ -4603,8 +4604,8 @@ readobjnam(char *bp, struct obj *no_wish)
                 || d.cnt < rnd(6)
                 || (d.cnt <= 7 && Is_candle(d.otmp))
                 || (d.cnt <= 20
-                    && (d.typ == ROCK || is_missile(d.otmp)
-                        /* WEAPON_CLASS test is to exclude gems */
+                    && (d.typ == ROCK || d.typ == FLINT || is_missile(d.otmp)
+                        /* WEAPON_CLASS test excludes gems, gray stones */
                         || (d.oclass == WEAPON_CLASS && is_ammo(d.otmp))))))
             d.otmp->quan = (long) d.cnt;
     }