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.
This commit is contained in:
@@ -68,6 +68,7 @@ General New Features
|
|||||||
naming Sting or Orcrist now breaks illiterate conduct
|
naming Sting or Orcrist now breaks illiterate conduct
|
||||||
different feedback for reading a scroll of mail created by writing with marker
|
different feedback for reading a scroll of mail created by writing with marker
|
||||||
wizard mode #wizintrinsic
|
wizard mode #wizintrinsic
|
||||||
|
reading non-cursed scroll of enchant weapon uncurses welded tin opener
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific New Features
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
@@ -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. */
|
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ int trouble;
|
|||||||
what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
|
what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
|
||||||
hcolor(NH_AMBER));
|
hcolor(NH_AMBER));
|
||||||
iflags.last_msg = PLNMSG_OBJ_GLOWS;
|
iflags.last_msg = PLNMSG_OBJ_GLOWS;
|
||||||
otmp->bknown = TRUE;
|
otmp->bknown = !Hallucination;
|
||||||
}
|
}
|
||||||
uncurse(otmp);
|
uncurse(otmp);
|
||||||
update_inventory();
|
update_inventory();
|
||||||
|
|||||||
21
src/read.c
21
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. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* 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 {
|
} else {
|
||||||
for (obj = invent; obj; obj = obj->nobj) {
|
for (obj = invent; obj; obj = obj->nobj) {
|
||||||
long wornmask;
|
long wornmask;
|
||||||
|
|
||||||
/* gold isn't subject to cursing and blessing */
|
/* gold isn't subject to cursing and blessing */
|
||||||
if (obj->oclass == COIN_CLASS)
|
if (obj->oclass == COIN_CLASS)
|
||||||
continue;
|
continue;
|
||||||
@@ -1269,8 +1270,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
|||||||
if (sblessed || wornmask || obj->otyp == LOADSTONE
|
if (sblessed || wornmask || obj->otyp == LOADSTONE
|
||||||
|| (obj->otyp == LEASH && obj->leashmon)) {
|
|| (obj->otyp == LEASH && obj->leashmon)) {
|
||||||
/* water price varies by curse/bless status */
|
/* water price varies by curse/bless status */
|
||||||
boolean shop_h2o =
|
boolean shop_h2o = (obj->unpaid && obj->otyp == POT_WATER);
|
||||||
(obj->unpaid && obj->otyp == POT_WATER);
|
|
||||||
|
|
||||||
if (confused) {
|
if (confused) {
|
||||||
blessorcurse(obj, 2);
|
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;
|
uwep->oerodeproof = new_erodeproof ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!chwepon(sobj,
|
if (!chwepon(sobj, scursed ? -1
|
||||||
scursed
|
: !uwep ? 1
|
||||||
? -1
|
: (uwep->spe >= 9) ? !rn2(uwep->spe)
|
||||||
: !uwep ? 1 : (uwep->spe >= 9)
|
: sblessed ? rnd(3 - uwep->spe / 3)
|
||||||
? !rn2(uwep->spe)
|
: 1))
|
||||||
: sblessed ? rnd(3 - uwep->spe / 3)
|
|
||||||
: 1))
|
|
||||||
sobj = 0; /* nothing enchanted: strange_feeling -> useup */
|
sobj = 0; /* nothing enchanted: strange_feeling -> useup */
|
||||||
break;
|
break;
|
||||||
case SCR_TAMING:
|
case SCR_TAMING:
|
||||||
@@ -1387,7 +1385,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
|||||||
if (vis_results > 0)
|
if (vis_results > 0)
|
||||||
known = TRUE;
|
known = TRUE;
|
||||||
}
|
}
|
||||||
} break;
|
break;
|
||||||
|
}
|
||||||
case SCR_GENOCIDE:
|
case SCR_GENOCIDE:
|
||||||
if (!already_known)
|
if (!already_known)
|
||||||
You("have found a scroll of genocide!");
|
You("have found a scroll of genocide!");
|
||||||
|
|||||||
21
src/wield.c
21
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. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* 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))) {
|
if (!uwep || (uwep->oclass != WEAPON_CLASS && !is_weptool(uwep))) {
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
|
|
||||||
Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
|
if (amount >= 0 && uwep && will_weld(uwep)) { /* cursed tin opener */
|
||||||
(amount >= 0) ? "twitch" : "itch");
|
if (!Blind) {
|
||||||
strange_feeling(otmp, buf);
|
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));
|
exercise(A_DEX, (boolean) (amount >= 0));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user