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.
This commit is contained in:
@@ -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
|
||||
|
||||
12
src/invent.c
12
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 ||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
25
src/sit.c
25
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) {
|
||||
|
||||
Reference in New Issue
Block a user