]> granicus.if.org Git - nethack/commitdiff
more tin opener
authorPatR <rankin@nethack.org>
Sun, 20 Dec 2015 02:14:39 +0000 (18:14 -0800)
committerPatR <rankin@nethack.org>
Sun, 20 Dec 2015 02:14:39 +0000 (18:14 -0800)
Reading a non-cursed scroll of enchant weapon has a side-effect of
uncursing a weapon welded to hand(s).  Make it do the same thing for
cursed tin opener, the only non-weapon/non-weptool that welds to hand.

doc/fixes36.1
src/pray.c
src/read.c
src/wield.c

index 465be7241557dcfcd0f5ba4052b38c8c4b35a8e3..4d92f1a6d0def148e54a39969647e25c4d0c0be2 100644 (file)
@@ -68,6 +68,7 @@ General New Features
 naming Sting or Orcrist now breaks illiterate conduct
 different feedback for reading a scroll of mail created by writing with marker
 wizard mode #wizintrinsic
+reading non-cursed scroll of enchant weapon uncurses welded tin opener
 
 
 Platform- and/or Interface-Specific New Features
index e3da3e37d0a7f7913eaf36b23ea44d743d87e47f..4c2df62a63aea2b2b7074c365eb596b76aa168cd 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 pray.c  $NHDT-Date: 1446854232 2015/11/06 23:57:12 $  $NHDT-Branch: master $:$NHDT-Revision: 1.87 $ */
+/* NetHack 3.6 pray.c  $NHDT-Date: 1450577672 2015/12/20 02:14:32 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.89 $ */
 /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -467,7 +467,7 @@ int trouble;
                   what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
                   hcolor(NH_AMBER));
             iflags.last_msg = PLNMSG_OBJ_GLOWS;
-            otmp->bknown = TRUE;
+            otmp->bknown = !Hallucination;
         }
         uncurse(otmp);
         update_inventory();
index 1e177eaf5680180378f61c1a3ff7438ae2dbf805..94619ba1124f7d668a2e8e11da703d4e6794eb10 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 read.c  $NHDT-Date: 1450490118 2015/12/19 01:55:18 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.130 $ */
+/* NetHack 3.6 read.c  $NHDT-Date: 1450577673 2015/12/20 02:14:33 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.131 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1237,6 +1237,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
         } else {
             for (obj = invent; obj; obj = obj->nobj) {
                 long wornmask;
+
                 /* gold isn't subject to cursing and blessing */
                 if (obj->oclass == COIN_CLASS)
                     continue;
@@ -1269,8 +1270,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                 if (sblessed || wornmask || obj->otyp == LOADSTONE
                     || (obj->otyp == LEASH && obj->leashmon)) {
                     /* water price varies by curse/bless status */
-                    boolean shop_h2o =
-                        (obj->unpaid && obj->otyp == POT_WATER);
+                    boolean shop_h2o = (obj->unpaid && obj->otyp == POT_WATER);
 
                     if (confused) {
                         blessorcurse(obj, 2);
@@ -1340,13 +1340,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
             uwep->oerodeproof = new_erodeproof ? 1 : 0;
             break;
         }
-        if (!chwepon(sobj,
-                     scursed
-                         ? -1
-                         : !uwep ? 1 : (uwep->spe >= 9)
-                                           ? !rn2(uwep->spe)
-                                           : sblessed ? rnd(3 - uwep->spe / 3)
-                                                      : 1))
+        if (!chwepon(sobj, scursed ? -1
+                             : !uwep ? 1
+                               : (uwep->spe >= 9) ? !rn2(uwep->spe)
+                                 : sblessed ? rnd(3 - uwep->spe / 3)
+                                   : 1))
             sobj = 0; /* nothing enchanted: strange_feeling -> useup */
         break;
     case SCR_TAMING:
@@ -1387,7 +1385,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
             if (vis_results > 0)
                 known = TRUE;
         }
-    } break;
+        break;
+    }
     case SCR_GENOCIDE:
         if (!already_known)
             You("have found a scroll of genocide!");
index 3a0625c5f4eb69c23af9b10ec0fb09f08fc78e22..0b17031ea8bc45f8b58fb6677b3c905cc5ea3a20 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 wield.c $NHDT-Date: 1446887539 2015/11/07 09:12:19 $  $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */
+/* NetHack 3.6 wield.c $NHDT-Date: 1450577672 2015/12/20 02:14:32 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -608,9 +608,22 @@ register int amount;
     if (!uwep || (uwep->oclass != WEAPON_CLASS && !is_weptool(uwep))) {
         char buf[BUFSZ];
 
-        Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
-                (amount >= 0) ? "twitch" : "itch");
-        strange_feeling(otmp, buf);
+        if (amount >= 0 && uwep && will_weld(uwep)) { /* cursed tin opener */
+            if (!Blind) {
+                Sprintf(buf, "%s with %s aura.",
+                        Yobjnam2(uwep, "glow"), an(hcolor(NH_AMBER)));
+                uwep->bknown = !Hallucination;
+            } else {
+                /* cursed tin opener is wielded in right hand */
+                Sprintf(buf, "Your right %s tingles.", body_part(HAND));
+            }
+            uncurse(uwep);
+            update_inventory();
+        } else {
+            Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
+                    (amount >= 0) ? "twitch" : "itch");
+        }
+        strange_feeling(otmp, buf); /* pline()+docall()+useup() */
         exercise(A_DEX, (boolean) (amount >= 0));
         return 0;
     }