]> granicus.if.org Git - nethack/commitdiff
disallow assigning type name to Amulet of Yendor
authorPatR <rankin@nethack.org>
Tue, 19 Apr 2022 21:19:48 +0000 (14:19 -0700)
committerPatR <rankin@nethack.org>
Tue, 19 Apr 2022 21:19:48 +0000 (14:19 -0700)
Something I noticed when testing the item-action handling for name and
call; applies to the C/#name command too.  You were allowed to call the
real Amulet something and allowed to call fake ones something [else].
If you did that, xname/doname didn't show it but the discoveries list
did, giving away information when the player had access to more than
one unID'd Amulet of Yendor.  Rather than messing about with discovery
handling, make real and fake Amulet be ineligible from being given a
type name.  (They can still be given individual names.)

doc/fixes3-7-0.txt
src/do_name.c
src/invent.c

index 82f04195b83a906eea1eb0fd658544d6f109df51..3ff27b35af09646ea532eb4f38a13fee5459e857 100644 (file)
@@ -882,6 +882,7 @@ putting objects into a container with menustyle=traditional and then taking
        bit being set if sanity_check was On
 when drinking or dipping, allow the 'm' prefix to be used to skip asking
        about fountains and pools
+calling real or fake Amulet something could give away information about them
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 66f124ae30dc5a9b10f85c4dd0231de4cec147d4..d44d5051285bea18e8c7dd9efd89a3438b64af8f 100644 (file)
@@ -1365,11 +1365,21 @@ objtyp_is_callable(int i)
         return TRUE;
 
     switch(objects[i].oc_class) {
+    case AMULET_CLASS:
+        /* 3.7: calling these used to be allowed but that enabled the
+           player to tell whether two unID'd amulets of yendor were both
+           fake or one was real by calling them distinct names and then
+           checking discoveries to see whether first name was replaced
+           by second or both names stuck; with more than two available
+           to work with, if they weren't all fake it was possible to
+           determine which one was the real one */
+        if (i == AMULET_OF_YENDOR || i == FAKE_AMULET_OF_YENDOR)
+            break; /* return FALSE */
+        /*FALLTHRU*/
     case SCROLL_CLASS:
     case POTION_CLASS:
     case WAND_CLASS:
     case RING_CLASS:
-    case AMULET_CLASS:
     case GEM_CLASS:
     case SPBOOK_CLASS:
     case ARMOR_CLASS:
index 48f8e049030982744ec19a04e693fd0c25ddc156..954c0792f9dcd274eddedd5ee52eb62905a6d935 100644 (file)
@@ -1834,6 +1834,13 @@ silly_thing(const char *word,
               !(is_plural(otmp) || pair_of(otmp)) ? "that" : "those", s3);
     else
 #endif
+    /* see comment about Amulet of Yendor in objtyp_is_callable(do_name.c);
+       known fakes yield the silly thing feedback */
+    if (!strcmp(word, "call")
+        && (otmp->otyp == AMULET_OF_YENDOR
+            || (otmp->otyp == FAKE_AMULET_OF_YENDOR && !otmp->known)))
+        pline_The("Amulet doesn't like being called names.");
+    else
         pline(silly_thing_to, word);
 }