From: PatR Date: Sun, 20 Dec 2015 02:14:39 +0000 (-0800) Subject: more tin opener X-Git-Tag: NetHack-3.6.1_RC01~1139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d6d508eefaa8f9f6f1f9607057c16b59a44a7d8;p=nethack more tin opener 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. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 465be7241..4d92f1a6d 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/pray.c b/src/pray.c index e3da3e37d..4c2df62a6 100644 --- a/src/pray.c +++ b/src/pray.c @@ -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(); diff --git a/src/read.c b/src/read.c index 1e177eaf5..94619ba11 100644 --- a/src/read.c +++ b/src/read.c @@ -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!"); diff --git a/src/wield.c b/src/wield.c index 3a0625c5f..0b17031ea 100644 --- a/src/wield.c +++ b/src/wield.c @@ -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; }