]> granicus.if.org Git - nethack/commitdiff
autocursing armor worn by monsters
authornethack.rankin <nethack.rankin>
Sat, 9 Apr 2005 03:23:17 +0000 (03:23 +0000)
committernethack.rankin <nethack.rankin>
Sat, 9 Apr 2005 03:23:17 +0000 (03:23 +0000)
     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
src/worn.c

index 1b3b864481e60000a0c390faf6ea33a4dcaab61e..aac5b350fc074a40cd2cfa2da158305238380a3b 100644 (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
index dd23c0e6bec8bf14dc96e55ced7b6de59c9cdf47..aabb79049076dfeb5ef49baf4e520ee3dcef6a14 100644 (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))) {