]> granicus.if.org Git - nethack/commitdiff
dipping non-weapon iron in fountain
authornethack.allison <nethack.allison>
Wed, 15 Oct 2003 12:32:35 +0000 (12:32 +0000)
committernethack.allison <nethack.allison>
Wed, 15 Oct 2003 12:32:35 +0000 (12:32 +0000)
<email deleted> wrote:
> Non-weapon iron items don't appear to rust if #dipped in a fountain.

Fixed. If something does get rusted, its a 50/50 chance whether other
fountain effects take place on the item afterwards.

doc/fixes34.3
src/fountain.c
src/potion.c

index a9b4c0ab01ce6e710863cfb28c91d97fd4f2bf85..c4701d5b3c527572eef29ffc3bfd4423a16e5377 100644 (file)
@@ -48,6 +48,8 @@ bill for all discarded, opened tins
 monsters that cannot pick things up cannot throw things either
 eating an amulet of unchanging removes intrinsic polymorph
 Vlad won't waste time trying to use wand of digging in his own tower
+non-weapon iron objects should rust when dipped in fountains since
+       iron weapons rust
 
 
 Platform- and/or Interface-Specific Fixes
index acbaac2d129d2277b246ff8ad547f4687430cfbf..7e1587da8b73033d56ce928971b2dcacd607ddb0 100644 (file)
@@ -391,7 +391,8 @@ register struct obj *obj;
                if(in_town(u.ux, u.uy))
                    (void) angry_guards(FALSE);
                return;
-       } else (void) get_wet(obj);
+       } else if (get_wet(obj) && !rn2(2))
+               return;
 
        /* Acid and water don't mix */
        if (obj->otyp == POT_ACID) {
index 0207211173fd7c6763abda1bf687e6fa551a8111..fed833a8c65be561602d9eee5fee046276811323 100644 (file)
@@ -1438,16 +1438,6 @@ register struct obj *obj;
 
        /* (Rusting shop goods ought to be charged for.) */
        switch (obj->oclass) {
-           case WEAPON_CLASS:
-               if (!obj->oerodeproof && is_rustprone(obj) &&
-                   (obj->oeroded < MAX_ERODE) && !rn2(2)) {
-                       pline("%s some%s.",
-                             Yobjnam2(obj, "rust"),
-                             obj->oeroded ? " more" : "what");
-                       obj->oeroded++;
-                       update_inventory();
-                       return TRUE;
-               } else break;
            case POTION_CLASS:
                if (obj->otyp == POT_WATER) return FALSE;
                /* KMH -- Water into acid causes an explosion */
@@ -1518,6 +1508,20 @@ register struct obj *obj;
                        }
                        return TRUE;
                }
+               break;
+           case WEAPON_CLASS:
+           /* Just "fall through" to generic rustprone check for now. */
+           /* fall through */
+           default:
+               if (!obj->oerodeproof && is_rustprone(obj) &&
+                   (obj->oeroded < MAX_ERODE) && !rn2(2)) {
+                       pline("%s %s some%s.",
+                             Your_buf, aobjnam(obj, "rust"),
+                             obj->oeroded ? " more" : "what");
+                       obj->oeroded++;
+                       update_inventory();
+                       return TRUE;
+               } else break;
        }
        pline("%s wet.", Yobjnam2(obj, "get"));
        return FALSE;
@@ -1562,6 +1566,20 @@ dodip()
                    }
                    return 1;
                }
+               break;
+           case WEAPON_CLASS:
+           /* Just "fall through" to generic rustprone check for now. */
+           /* fall through */
+           default:
+               if (!obj->oerodeproof && is_rustprone(obj) &&
+                   (obj->oeroded < MAX_ERODE) && !rn2(2)) {
+                       pline("%s %s some%s.",
+                             Your_buf, aobjnam(obj, "rust"),
+                             obj->oeroded ? " more" : "what");
+                       obj->oeroded++;
+                       update_inventory();
+                       return TRUE;
+               } else break;
        }
 
        if(!(potion = getobj(beverages, "dip into")))