]> granicus.if.org Git - nethack/commitdiff
fix #H9420 - dipping while blind
authorPatR <rankin@nethack.org>
Fri, 15 Nov 2019 20:09:45 +0000 (12:09 -0800)
committerPatR <rankin@nethack.org>
Fri, 15 Nov 2019 20:09:45 +0000 (12:09 -0800)
Fix several feedback anomalies for dipping into potions.

doc/fixes36.3
src/potion.c

index 1291c29d71d362cf081fca318a20b7e43402c2b2..287b74044ee6d3e985f00491429b685edcd596aa 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.177 $ $NHDT-Date: 1573778559 2019/11/15 00:42:39 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.178 $ $NHDT-Date: 1573848574 2019/11/15 20:09:34 $
 
 This fixes36.3 file is here to capture information about updates in the 3.6.x
 lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -225,6 +225,13 @@ putting on gloves while having slippery fingers transfered slipperiness to
 when a monster reads a scroll of fire to cure sliming, don't access that
        scroll's memory after it has been used up (bcsign)
 monster vs monster attacks didn't handle shades or silver weapon feedback
+successful alchemy would show new potion's description (color) even when blind
+dipping some types of objects into oil would yield "<object> gleams with an
+       oily sheen" even when blind
+dipping into an undiscovered potion would offer chance to give a name to the
+       potion even when its description wasn't known (picked up while blind)
+dipping lichen corpse into acid when not blind and acid was undicovered would
+       not offer a chance to give a name to the potion after lichen feedback
 
 
 Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
index 4f9a42d51ea8839b220b46ed6ce68e3ec7187ebc..16b2c5ddafedf899a7425731363f409bf45c8e72 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 potion.c        $NHDT-Date: 1573346191 2019/11/10 00:36:31 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */
+/* NetHack 3.6 potion.c        $NHDT-Date: 1573848199 2019/11/15 20:03:19 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -2030,7 +2030,7 @@ dodip()
                around for potionbreathe() [and we can't set obj->in_use
                to 'amt' because that's not implemented] */
             obj->in_use = 1;
-            pline("BOOM!  They explode!");
+            pline("%sThey explode!", !Deaf ? "BOOM!  " : "");
             wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
             exercise(A_STR, FALSE);
             if (!breathless(youmonst.data) || haseyes(youmonst.data))
@@ -2048,6 +2048,8 @@ dodip()
         if (mixture != STRANGE_OBJECT) {
             obj->otyp = mixture;
         } else {
+            struct obj *otmp;
+
             switch (obj->odiluted ? 1 : rnd(8)) {
             case 1:
                 obj->otyp = POT_WATER;
@@ -2056,17 +2058,15 @@ dodip()
             case 3:
                 obj->otyp = POT_SICKNESS;
                 break;
-            case 4: {
-                struct obj *otmp = mkobj(POTION_CLASS, FALSE);
-
+            case 4:
+                otmp = mkobj(POTION_CLASS, FALSE);
                 obj->otyp = otmp->otyp;
                 obfree(otmp, (struct obj *) 0);
                 break;
-            }
             default:
                 useupall(obj);
-                if (!Blind)
-                    pline_The("mixture glows brightly and evaporates.");
+                pline_The("mixture %sevaporates.",
+                          !Blind ? "glows brightly and " : "");
                 return 1;
             }
         }
@@ -2092,11 +2092,16 @@ dodip()
     }
 
     if (potion->otyp == POT_ACID && obj->otyp == CORPSE
-        && obj->corpsenm == PM_LICHEN && !Blind) {
+        && obj->corpsenm == PM_LICHEN) {
         pline("%s %s %s around the edges.", The(cxname(obj)),
-              otense(obj, "turn"),
-              potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED));
+              otense(obj, "turn"), Blind ? "wrinkled"
+                                   : potion->odiluted ? hcolor(NH_ORANGE)
+                                     : hcolor(NH_RED));
         potion->in_use = FALSE; /* didn't go poof */
+        if (potion->dknown
+            && !objects[potion->otyp].oc_name_known
+            && !objects[potion->otyp].oc_uname)
+            docall(potion);
         return 1;
     }
 
@@ -2150,10 +2155,14 @@ dodip()
         } else if ((!is_rustprone(obj) && !is_corrodeable(obj))
                    || is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
             /* uses up potion, doesn't set obj->greased */
-            pline("%s %s with an oily sheen.", Yname2(obj),
-                  otense(obj, "gleam"));
+            if (!Blind)
+                pline("%s %s with an oily sheen.", Yname2(obj),
+                      otense(obj, "gleam"));
+            else /*if (!uarmg)*/
+                pline("%s %s oily.", Yname2(obj), otense(obj, "feel"));
         } else {
-            pline("%s %s less %s.", Yname2(obj), otense(obj, "are"),
+            pline("%s %s less %s.", Yname2(obj),
+                  otense(obj, !Blind ? "are" : "feel"),
                   (obj->oeroded && obj->oeroded2)
                       ? "corroded and rusty"
                       : obj->oeroded ? "rusty" : "corroded");
@@ -2164,7 +2173,8 @@ dodip()
             wisx = TRUE;
         }
         exercise(A_WIS, wisx);
-        makeknown(potion->otyp);
+        if (potion->dknown)
+            makeknown(potion->otyp);
         useup(potion);
         return 1;
     }
@@ -2200,7 +2210,8 @@ dodip()
             useup(potion);
             exercise(A_WIS, TRUE);
         }
-        makeknown(POT_OIL);
+        if (potion->dknown)
+            makeknown(POT_OIL);
         obj->spe = 1;
         update_inventory();
         return 1;
@@ -2238,16 +2249,24 @@ dodip()
             singlepotion->dknown = FALSE;
         } else {
             singlepotion->dknown = !Hallucination;
+            *newbuf = '\0';
             if (mixture == POT_WATER && singlepotion->dknown)
                 Sprintf(newbuf, "clears");
-            else
+            else if (!Blind)
                 Sprintf(newbuf, "turns %s",
                         hcolor(OBJ_DESCR(objects[mixture])));
-            pline_The("%spotion%s %s.", oldbuf,
-                      more_than_one ? " that you dipped into" : "", newbuf);
-            if (!objects[old_otyp].oc_uname
-                && !objects[old_otyp].oc_name_known && old_dknown) {
+            if (*newbuf)
+                pline_The("%spotion%s %s.", oldbuf,
+                          more_than_one ? " that you dipped into" : "",
+                          newbuf);
+            else
+                pline("Somehing happens.");
+
+            if (old_dknown
+                && !objects[old_otyp].oc_name_known
+                && !objects[old_otyp].oc_uname) {
                 struct obj fakeobj;
+
                 fakeobj = zeroobj;
                 fakeobj.dknown = 1;
                 fakeobj.otyp = old_otyp;
@@ -2269,7 +2288,8 @@ dodip()
     return 1;
 
  poof:
-    if (!objects[potion->otyp].oc_name_known
+    if (potion->dknown
+        && !objects[potion->otyp].oc_name_known
         && !objects[potion->otyp].oc_uname)
         docall(potion);
     useup(potion);