discovery of enchant weapon scrolls

Eliminate or at least reduce one of the idiosyncratic differences
between enchant weapon and enchant armor:  make reading enchant weapon
discover that scroll if the effect is adequately discernible, instead
of always asking the player to supply a name for it.  If your weapon
is identified and its +/- enchantment value goes up, or you're wielding
a worm tooth and it transforms into a crysknife, you learn the scroll.
However for the negative effect of a cursed one, that's only applicable
when the scroll is already known to be cursed.
This commit is contained in:
nethack.rankin
2002-04-18 02:26:09 +00:00
parent 97e393aa05
commit f0aabe8460
2 changed files with 13 additions and 6 deletions

View File

@@ -82,6 +82,7 @@ undo xname FAKE_AMULET_OF_YENDOR AD_DRIN check, the_unique_obj checks this case
axes should chop trees; picks shouldn't
chance to aim grappling hook when skilled or better
level limit of monsters like naga hatchlings should be high enough to grow up
scroll of enchant weapon will become discovered when read in some cases
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)wield.c 3.4 2001/12/23 */
/* SCCS Id: @(#)wield.c 3.4 2002/04/16 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -613,8 +613,9 @@ chwepon(otmp, amount)
register struct obj *otmp;
register int amount;
{
register const char *color = hcolor((amount < 0) ? Black : blue);
register const char *xtime;
const char *color = hcolor((amount < 0) ? Black : blue);
const char *xtime;
int otyp = STRANGE_OBJECT;
if(!uwep || (uwep->oclass != WEAPON_CLASS && !is_weptool(uwep))) {
char buf[BUFSZ];
@@ -626,11 +627,14 @@ register int amount;
return(0);
}
if (otmp && otmp->oclass == SCROLL_CLASS) otyp = otmp->otyp;
if(uwep->otyp == WORM_TOOTH && amount >= 0) {
uwep->otyp = CRYSKNIFE;
uwep->oerodeproof = 0;
Your("weapon seems sharper now.");
uwep->cursed = 0;
if (otyp != STRANGE_OBJECT) makeknown(otyp);
return(1);
}
@@ -638,6 +642,7 @@ register int amount;
uwep->otyp = WORM_TOOTH;
uwep->oerodeproof = 0;
Your("weapon seems duller now.");
if (otyp != STRANGE_OBJECT && otmp->bknown) makeknown(otyp);
return(1);
}
@@ -656,9 +661,7 @@ register int amount;
else
Your("%s.", aobjnam(uwep, "evaporate"));
while(uwep) /* let all of them disappear */
/* note: uwep->quan = 1 is nogood if unpaid */
useup(uwep);
useupall(uwep); /* let all of them disappear */
return(1);
}
if (!Blind) {
@@ -666,6 +669,9 @@ register int amount;
Your("%s %s for a %s.",
aobjnam(uwep, amount == 0 ? "violently glow" : "glow"),
color, xtime);
if (otyp != STRANGE_OBJECT && uwep->known &&
(amount > 0 || (amount < 0 && otmp->bknown)))
makeknown(otyp);
}
uwep->spe += amount;
if(amount > 0) uwep->cursed = 0;