]> granicus.if.org Git - nethack/commitdiff
Fold `get_wet()` into `water_damage()`.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Tue, 24 Feb 2015 20:26:09 +0000 (15:26 -0500)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Mon, 2 Mar 2015 17:50:01 +0000 (12:50 -0500)
This now ensures that dipping into water works like other sources of
water damage. There is a potentially significant gameplay change here:
dipping a container into uncursed water will wet all its contents. If
this is a problem, then we should add another parameter to water_damage
which will suppress this behaviour for dipping.

doc/fixes35.0
include/extern.h
src/fountain.c
src/potion.c
src/trap.c

index 9dc59fa6604440a49b6a4c7e0ce06b4d6ba9f1e7..d3f6b1a9093c058890316100a51b7973d40d65cc 100644 (file)
@@ -864,7 +864,7 @@ grease protects from all types of erosion
 all sources of erosion now affect objects the same way
 passive attacks no longer erode armor covered by other armor
 dipping a fooproof item into acid no longer forgets that it's fooproof
-
+dipping a container into uncursed water now gets its contents wet
 
 Platform- and/or Interface-Specific Fixes
 -----------------------------------------
index f9fc3be0cf987268c5d987e45e018f4b516ee44c..4da79874de786aab07cad20292802f948c93de65 100644 (file)
@@ -1726,7 +1726,6 @@ E void FDECL(healup, (int,int,BOOLEAN_P,BOOLEAN_P));
 E void FDECL(strange_feeling, (struct obj *,const char *));
 E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P));
 E void FDECL(potionbreathe, (struct obj *));
-E boolean FDECL(get_wet, (struct obj *));
 E int NDECL(dodip);
 E void FDECL(mongrantswish, (struct monst **));
 E void FDECL(djinni_from_bottle, (struct obj *));
index cc8aeb7bf9682f0681f23819347f1408d7b237a3..7de917ad936e2e4dd4adf7b3644e16a56e19499f 100644 (file)
@@ -402,7 +402,7 @@ register struct obj *obj;
                if(in_town(u.ux, u.uy))
                    (void) angry_guards(FALSE);
                return;
-       } else if (get_wet(obj)) {
+       } else if (water_damage(obj, NULL, TRUE)) {
            if (obj->otyp == POT_ACID) { /* Acid and water don't mix */
                useup(obj);
                return;
index 782fa7ace5192b71ac60d14dee7d74659cb159ed..4c57eaecb77297fa5c9fe5a5f048e52058a9c7f8 100644 (file)
@@ -1088,7 +1088,7 @@ const char *objphrase;    /* "Your widget glows" or "Steed's saddle glows" */
     } else {
        /* dipping into uncursed water; carried() check skips steed saddle */
        if (carried(targobj)) {
-           if (get_wet(targobj))
+           if (water_damage(targobj, 0, TRUE))
                res = TRUE;
        }
     }
@@ -1626,98 +1626,6 @@ register struct obj *o1, *o2;
        return 0;
 }
 
-
-boolean
-get_wet(obj)
-register struct obj *obj;
-/* returns TRUE if something happened (potion should be used up) */
-{
-       if (snuff_lit(obj)) return(TRUE);
-
-       if (obj->greased) {
-               grease_protect(obj,(char *)0,&youmonst);
-               return(FALSE);
-       }
-
-       /* (Rusting shop goods ought to be charged for.) */
-       switch (obj->oclass) {
-           case POTION_CLASS:
-               if (obj->otyp == POT_WATER) return FALSE;
-               /* KMH -- Water into acid causes an explosion */
-               if (obj->otyp == POT_ACID) {
-                       pline("It boils vigorously!");
-                       You("are caught in the explosion!");
-                       losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry",
-                               KILLED_BY);
-                       makeknown(obj->otyp);
-                       update_inventory();
-                       return (TRUE);
-               }
-               pline("%s%s.", Yobjnam2(obj,"dilute"),
-                     obj->odiluted ? " further" : "");
-               costly_alteration(obj, COST_DILUTE);
-               if (obj->odiluted) {
-                       obj->odiluted = 0;
-                       obj->blessed = FALSE;
-                       obj->cursed = FALSE;
-                       obj->otyp = POT_WATER;
-               } else
-                       obj->odiluted++;
-               update_inventory();
-               return TRUE;
-           case SCROLL_CLASS:
-               if (obj->otyp != SCR_BLANK_PAPER
-#ifdef MAIL
-                   && obj->otyp != SCR_MAIL
-#endif
-                   ) {
-                       if (!Blind)
-                           pline_The("scroll%s %s.",
-                                     plur(obj->quan), otense(obj, "fade"));
-                       costly_alteration(obj, COST_ERASE);
-                       obj->otyp = SCR_BLANK_PAPER;
-                       obj->spe = 0;
-                       update_inventory();
-                       return TRUE;
-               } else break;
-           case SPBOOK_CLASS:
-               if (obj->otyp != SPE_BLANK_PAPER) {
-
-                       if (obj->otyp == SPE_BOOK_OF_THE_DEAD) {
-                           pline(
-                      "%s suddenly heats up; steam rises and it remains dry.",
-                                 The(xname(obj)));
-                       } else {
-                           if (!Blind)
-                               pline_The("spellbook%s %s.",
-                                         plur(obj->quan),
-                                         otense(obj, "fade"));
-                           costly_alteration(obj, COST_ERASE);
-                           obj->otyp = SPE_BLANK_PAPER;
-                           update_inventory();
-                       }
-                       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 some%s.",
-                             Yobjnam2(obj, "rust"),
-                             obj->oeroded ? " more" : "what");
-                       obj->oeroded++;
-                       update_inventory();
-                       return TRUE;
-               }
-               break;
-       }
-       pline("%s wet.", Yobjnam2(obj, "get"));
-       return FALSE;
-}
-
 int
 dodip()
 {
@@ -1756,7 +1664,7 @@ dodip()
                        rider_cant_reach(); /* not skilled enough to reach */
                    } else {
                        if (obj->otyp == POT_ACID) obj->in_use = 1;
-                       (void) get_wet(obj);
+                       (void) water_damage(obj, 0, TRUE);
                        if (obj->in_use) useup(obj);
                    }
                    return 1;
index d535fc230020f1c14627be683f08a87445cd314f..6a5cb375503e3a543f8b82a5dac5fdc6d081053b 100644 (file)
@@ -3118,7 +3118,8 @@ boolean force;
 {
        boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE;
 
-        (void) snuff_lit(obj);
+        if (snuff_lit(obj))
+            return 2;
 
         if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) {
                 return 0;