]> granicus.if.org Git - nethack/commitdiff
silver vs lycanthropy (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 18 Mar 2007 03:26:43 +0000 (03:26 +0000)
committernethack.rankin <nethack.rankin>
Sun, 18 Mar 2007 03:26:43 +0000 (03:26 +0000)
     Monster werecritters are vulnerable to silver when in human form as
well as when in beast form, but hero inflicted with lycanthropy was only
vulnerable while in beast form.  Add pseudo-property Hate_silver to handle
that correctly.  Also, add silver vulnerability to enlightenment feedback.
Lastly, hero vulnerable to silver had Con abused if hit by silver missile
but not when hit hand-to-hand; add an exercise() call to the latter.

doc/fixes34.4
include/youprop.h
src/artifact.c
src/cmd.c
src/mhitu.c
src/mthrowu.c

index e9d76c0b481383bb57e82db6a2a48568ec5933cc..96e41d28c4dbeb2bb8df3d147be9ec3291cb3ed8 100644 (file)
@@ -341,6 +341,7 @@ lit candle or potion of oil which burned out while equipped would leave stale
        weapon/alternate-weapon/quiver pointer that could cause panic or crash
 wielded/worn figurine which auto-transformed had same stale pointer bug
 format names of not yet id'd artifacts such that obj type shows for non-weapons
+hero with lycanthropy is vulnerable to silver in human form as well as beast
 
 
 Platform- and/or Interface-Specific Fixes
index 6f6f59d807d7c72c1801da9e0455c13a5e8361c0..a0feebc949088f629f3cf12616cf28d91d72d135 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)youprop.h  3.5     2006/09/01      */
+/*     SCCS Id: @(#)youprop.h  3.5     2007/03/16      */
 /* Copyright (c) 1989 Mike Threepoint                            */
 /* NetHack may be freely redistributed.  See license for details. */
 
 
 #define Lifesaved              u.uprops[LIFESAVED].extrinsic
 
+/*
+ * Some pseudo-properties.
+ */
+
 /* unconscious() includes u.usleep but not is_fainted(); the multi test is
    redundant but allows the function calls to be skipped most of the time */
 #define Unaware                (multi < 0 && (unconscious() || is_fainted()))
 
+#define Hate_silver    (u.ulycn >= LOW_PM || hates_silver(youmonst.data))
+
 #endif /* YOUPROP_H */
index c38098f802171e90bd9fc8816856acc52dc4ff15..54d8645c8c228b23d49a4c017c55881e4e1eeb53 100644 (file)
@@ -560,7 +560,7 @@ touch_artifact(obj,mon)
     /* can pick it up unless you're totally non-synch'd with the artifact */
     if (badclass && badalign && self_willed) {
        if (yours) {
-           if (obj->where != OBJ_INVENT)
+           if (!carried(obj))
                pline("%s your grasp!", Tobjnam(obj, "evade"));
            else
                pline("%s beyond your control!", Tobjnam(obj, "are"));
@@ -1613,8 +1613,7 @@ boolean loseit;           /* whether to drop it if hero can longer touch it */
 
     if (touch_artifact(obj, &youmonst)) {
        /* nothing to do if hero can successfully handle this object */
-       if (!(objects[obj->otyp].oc_material == SILVER &&
-               (u.ulycn >= LOW_PM || hates_silver(youmonst.data))))
+       if (!(objects[obj->otyp].oc_material == SILVER && Hate_silver))
            return 1;
        /* we didn't get "<obj> evades your grasp" message; give alt message */
        You_cant("handle %s anymore!", thesimpleoname(obj));
index 0bc1587767fa5a0256afa1630451bb500b251580..a24a15d08011beab8fafe12b28c52d059f8e995a 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1127,6 +1127,7 @@ int final;        /* 0 => still in progress; 1 => over, survived; 2 => dead */
 #endif
        if (Sleeping) enl_msg("You ", "fall", "fell", " asleep", "");
        if (Hunger) enl_msg("You hunger", "", "ed", " rapidly", "");
+       if (Hate_silver) you_are("harmed by silver","");
 
        /*** Vision and senses ***/
        if (See_invisible) enl_msg(You_, "see", "saw", " invisible",
index 96eed6609660550da60fa5ee4695b3675833837f..ee2bdb37f4923be1a273db3e741c1e299056dcb6 100644 (file)
@@ -945,8 +945,10 @@ hitmu(mtmp, mattk)
                             hitmsg(mtmp, mattk);
                        if (!dmg) break;
                        if (objects[otmp->otyp].oc_material == SILVER &&
-                               hates_silver(youmonst.data))
+                               Hate_silver) {
                            pline_The("silver sears your flesh!");
+                           exercise(A_CON, FALSE);
+                       }
                        if (u.mh > 1 && u.mh > ((u.uac>0) ? dmg : dmg+u.uac) &&
                                   objects[otmp->otyp].oc_material == IRON &&
                                        (u.umonnum==PM_BLACK_PUDDING
index 05babac91e785efaf409b6662284500d76d171c4..687a757ffd24dde592a2a7ed1880a0c35a247fab 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mthrowu.c  3.5     2007/01/27      */
+/*     SCCS Id: @(#)mthrowu.c  3.5     2007/03/17      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -60,11 +60,11 @@ const char *name;   /* if null, then format `obj' */
                else You("are almost hit by %s.", onm);
                return(0);
        } else {
-               if(Blind || !flags.verbose) You("are hit!");
+               if (Blind || !flags.verbose) You("are hit%s", exclam(dam));
                else You("are hit by %s%s", onm, exclam(dam));
 
-               if (obj && objects[obj->otyp].oc_material == SILVER
-                               && hates_silver(youmonst.data)) {
+               if (obj && objects[obj->otyp].oc_material == SILVER &&
+                           Hate_silver) {
                        /* extra damage already applied by dmgval() */
                        pline_The("silver sears your flesh!");
                        exercise(A_CON, FALSE);