From 43d968bae0fc9511f8575713629815d499cdfd1f Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 9 Apr 2005 03:23:17 +0000 Subject: [PATCH] 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. --- doc/fixes34.4 | 1 + src/worn.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 1b3b86448..aac5b350f 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/worn.c b/src/worn.c index dd23c0e6b..aabb79049 100644 --- a/src/worn.c +++ b/src/worn.c @@ -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))) {