]> granicus.if.org Git - nethack/commitdiff
fix 'blind sink behavior'
authorPatR <rankin@nethack.org>
Tue, 29 Dec 2015 01:32:31 +0000 (17:32 -0800)
committerPatR <rankin@nethack.org>
Tue, 29 Dec 2015 01:32:31 +0000 (17:32 -0800)
Reported directly to devteam:  teleporting or polymorphing a sink when
dropping the relevant ring into it was suppressed if the hero couldn't
see it happen.

Being unable to see the sink transform or vanish shouldn't stop that
from happening.  Since the hero is known to not be levitating (because
of the sink), it can be assumed that he can feel the transformation or
vanishment (is that a real word?), so use the same messages regardless
of blindness.

doc/fixes36.1
src/do.c

index 5f2f61fcd6b21bd41c562eef254a4c821592d57a..9b33f06c8a2b9befc4b9fa66b02dd310af8b5a43 100644 (file)
@@ -70,6 +70,8 @@ use alternate rejection message if attempting to name an unnameable monster
 cockatrice corpse no longer leaves multiple statues for shape-shifted vampire
 alter name of monster causing hero's death if name contains characters that
        could cause confusion when using record, logfile, or xlogfile later
+teleporting or polymorphing a sink via ring drop shouldn't depend upon being
+       able to see it happen
 
 
 Platform- and/or Interface-Specific Fixes
index 2081016a4ab935e141e810e80bd437c2e4eb83ae..c5030f73a94a6f4eeff659dc475ce48b66d1fb50 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -270,6 +270,8 @@ register struct obj *obj;
 STATIC_DCL void
 polymorph_sink()
 {
+    uchar sym = S_sink;
+
     if (levl[u.ux][u.uy].typ != SINK)
         return;
 
@@ -278,24 +280,33 @@ polymorph_sink()
     switch (rn2(4)) {
     default:
     case 0:
+        sym = S_fountain;
         levl[u.ux][u.uy].typ = FOUNTAIN;
         level.flags.nfountains++;
         break;
     case 1:
+        sym = S_throne;
         levl[u.ux][u.uy].typ = THRONE;
         break;
     case 2:
+        sym = S_altar;
         levl[u.ux][u.uy].typ = ALTAR;
         levl[u.ux][u.uy].altarmask = Align2amask(rn2((int) A_LAWFUL + 2) - 1);
         break;
     case 3:
+        sym = S_room;
         levl[u.ux][u.uy].typ = ROOM;
         make_grave(u.ux, u.uy, (char *) 0);
+        if (levl[u.ux][u.uy].typ == GRAVE)
+            sym = S_grave;
         break;
     }
-    pline_The("sink transforms into %s!", (levl[u.ux][u.uy].typ == THRONE)
-                                              ? "a throne"
-                                              : an(surface(u.ux, u.uy)));
+    /* give message even if blind; we know we're not levitating,
+       so can feel the outcome even if we can't directly see it */
+    if (levl[u.ux][u.uy].typ != ROOM)
+        pline_The("sink transforms into %s!", an(defsyms[sym].explanation));
+    else
+        pline_The("sink vanishes.");
     newsym(u.ux, u.uy);
 }
 
@@ -407,11 +418,24 @@ register struct obj *obj;
         /* Not the same as aggravate monster; besides, it's obvious. */
         pline("Several flies buzz around the sink.");
         break;
+    case RIN_TELEPORTATION:
+        nosink = teleport_sink();
+        /* give message even if blind; we know we're not levitating,
+           so can feel the outcome even if we can't directly see it */
+        pline_The("sink %svanishes.", nosink ? "" : "momentarily ");
+        ideed = FALSE;
+        break;
+    case RIN_POLYMORPH:
+        polymorph_sink();
+        nosink = TRUE;
+        /* for S_room case, same message as for teleportation is given */
+        ideed = (levl[u.ux][u.uy].typ != ROOM);
+        break;
     default:
         ideed = FALSE;
         break;
     }
-    if (!Blind && !ideed && obj->otyp != RIN_HUNGER) {
+    if (!Blind && !ideed) {
         ideed = TRUE;
         switch (obj->otyp) { /* effects that need eyes */
         case RIN_ADORNMENT:
@@ -449,20 +473,14 @@ register struct obj *obj;
         case RIN_WARNING:
             pline_The("sink glows %s for a moment.", hcolor(NH_WHITE));
             break;
-        case RIN_TELEPORTATION:
-            nosink = teleport_sink();
-            pline_The("sink %svanishes.", nosink ? "" : "momentarily ");
-            break;
         case RIN_TELEPORT_CONTROL:
             pline_The("sink looks like it is being beamed aboard somewhere.");
             break;
-        case RIN_POLYMORPH:
-            polymorph_sink();
-            nosink = TRUE;
-            break;
         case RIN_POLYMORPH_CONTROL:
             pline_The(
-                "sink momentarily looks like a regularly erupting geyser.");
+                  "sink momentarily looks like a regularly erupting geyser.");
+            break;
+        default:
             break;
         }
     }