autocursing armor worn by monsters

From the newsgroup:  non-cursed dunce cap or helm of opposite alignment
which would glow black and become cursed if worn by the hero wasn't doing
the same when worn by a monster.  Fixing this gives players a new way to
recognize bad hats--drop on altar, then drop in front of approaching goblin
or other wimpy monster capable of wearing armor--but I think that's fair.
Since helms of opposite alignment are usually already cursed it won't make
much difference for them; most players seem to avoid all conical hats so it
won't make much difference for dunce caps either.
This commit is contained in:
nethack.rankin
2005-04-09 03:23:17 +00:00
parent 3be6c22cd5
commit 43d968bae0
2 changed files with 11 additions and 1 deletions

View File

@@ -109,6 +109,7 @@ after destroying drawbridge, hero could appear to be in the wall
sometimes shop items which hero is forced to buy could be sold back twice
vision was not updated when polymorphing a statue into a boulder
`I u' when carrying single unpaid item listed its cost twice
armor which auto-curses when worn by hero should do same if worn by monster
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)worn.c 3.5 2003/01/08 */
/* SCCS Id: @(#)worn.c 3.5 2005/04/06 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -405,6 +405,7 @@ boolean racialexception;
struct obj *old, *best, *obj;
int m_delay = 0;
int unseen = !canseemon(mon);
boolean autocurse;
char nambuf[BUFSZ];
if (mon->mfrozen) return; /* probably putting previous item on */
@@ -467,6 +468,9 @@ boolean racialexception;
outer_break:
if (!best || best == old) return;
/* same auto-cursing behavior as for hero */
autocurse = ((best->otyp == HELM_OF_OPPOSITE_ALIGNMENT ||
best->otyp == DUNCE_CAP) && !best->cursed);
/* if wearing a cloak, account for the time spent removing
and re-wearing it when putting on a suit or shirt */
if ((flag == W_ARM
@@ -492,6 +496,10 @@ outer_break:
buf[0] = '\0';
pline("%s%s puts on %s.", Monnam(mon),
buf, distant_name(best,doname));
if (autocurse)
pline("%s %s %s %s for a moment.",
s_suffix(Monnam(mon)), simple_typename(best->otyp),
otense(best, "glow"), hcolor(NH_BLACK));
} /* can see it */
m_delay += objects[best->otyp].oc_delay;
mon->mfrozen = m_delay;
@@ -501,6 +509,7 @@ outer_break:
update_mon_intrinsics(mon, old, FALSE, creation);
mon->misc_worn_check |= flag;
best->owornmask |= flag;
if (autocurse) curse(best);
update_mon_intrinsics(mon, best, TRUE, creation);
/* if couldn't see it but now can, or vice versa, */
if (!creation && (unseen ^ !canseemon(mon))) {