From: nethack.rankin Date: Tue, 24 Sep 2002 03:20:22 +0000 (+0000) Subject: fix B10003 - GOLDOBJ: BUC gold; identification X-Git-Tag: MOVE2GIT~2410 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d251c6688f5bc49edd4dcf385038ac39df7625a;p=nethack fix B10003 - GOLDOBJ: BUC gold; identification Curse and bless status has no meaning for gold. Likewise for erosion and other object flags controlling whether an item is considered to be fully identified. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index c7a87b5bd..ccfe90b67 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -255,6 +255,7 @@ for wizard and explore modes, skip second screen of ^X output when first screen is cancelled by ESC polyself into minotaur causes hard headgear to fall off with multiple leashes in use, 2nd had 50/50 chance of having unbounded length +GOLDOBJ: coins aren't subject to curses/blesses and don't need identification Platform- and/or Interface-Specific Fixes diff --git a/src/invent.c b/src/invent.c index 4350e5758..ed9d12084 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2228,16 +2228,12 @@ STATIC_OVL boolean mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ register struct obj *otmp, *obj; { -#ifndef GOLDOBJ - if (obj->otyp != otmp->otyp || obj->unpaid != otmp->unpaid || -#else if (obj->otyp != otmp->otyp) return FALSE; - - /* Coins of the same kind will always merge. */ - if (obj->oclass == COIN_CLASS) return TRUE; - - if (obj->unpaid != otmp->unpaid || +#ifdef GOLDOBJ + /* coins of the same kind will always merge */ + if (obj->oclass == COIN_CLASS) return TRUE; #endif + if (obj->unpaid != otmp->unpaid || obj->spe != otmp->spe || obj->dknown != otmp->dknown || (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) || obj->cursed != otmp->cursed || obj->blessed != otmp->blessed || diff --git a/src/mkobj.c b/src/mkobj.c index 6ea149f81..cf4da5daf 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mkobj.c 3.4 2002/08/02 */ +/* SCCS Id: @(#)mkobj.c 3.4 2002/09/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -679,6 +679,9 @@ void bless(otmp) register struct obj *otmp; { +#ifdef GOLDOBJ + if (otmp->oclass == COIN_CLASS) return; +#endif otmp->cursed = 0; otmp->blessed = 1; if (otmp->otyp == LUCKSTONE @@ -707,6 +710,9 @@ void curse(otmp) register struct obj *otmp; { +#ifdef GOLDOBJ + if (otmp->oclass == COIN_CLASS) return; +#endif otmp->blessed = 0; otmp->cursed = 1; /* welded two-handed weapon interferes with some armor removal */ diff --git a/src/objnam.c b/src/objnam.c index 52269611b..9c5fe3d57 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)objnam.c 3.4 2002/09/08 */ +/* SCCS Id: @(#)objnam.c 3.4 2002/09/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -797,6 +797,10 @@ boolean not_fully_identified(otmp) register struct obj *otmp; { +#ifdef GOLDOBJ + /* gold doesn't have any interesting attributes [yet?] */ + if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ +#endif /* check fundamental ID hallmarks first */ if (!otmp->known || !otmp->dknown || #ifdef MAIL diff --git a/src/sit.c b/src/sit.c index 7b6550f67..d8b4724e9 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)sit.c 3.4 2002/07/12 */ +/* SCCS Id: @(#)sit.c 3.4 2002/09/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -325,14 +325,27 @@ rndcurse() /* curse a few inventory items at random! */ You(mal_aura, "you"); } - for (otmp = invent; otmp; otmp = otmp->nobj) nobj++; - + for (otmp = invent; otmp; otmp = otmp->nobj) { +#ifdef GOLDOBJ + /* gold isn't subject to being cursed or blessed */ + if (otmp->oclass == COIN_CLASS) continue; +#endif + nobj++; + } if (nobj) { for (cnt = rnd(6/((!!Antimagic) + (!!Half_spell_damage) + 1)); cnt > 0; cnt--) { - onum = rn2(nobj); - for(otmp = invent; onum != 0; onum--) - otmp = otmp->nobj; + onum = rnd(nobj); + for (otmp = invent; otmp; otmp = otmp->nobj) { +#ifdef GOLDOBJ + /* as above */ + if (otmp->oclass == COIN_CLASS) continue; +#endif + if (--onum == 0) break; /* found the target */ + } + /* the !otmp case should never happen; picking an already + cursed item happens--avoid "resists" message in that case */ + if (!otmp || otmp->cursed) continue; /* next target */ if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && rn2(10) < 8) {