silver vs lycanthropy (trunk only)

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.
This commit is contained in:
nethack.rankin
2007-03-18 03:26:43 +00:00
parent 7a70ec2a02
commit 25527a6315
6 changed files with 18 additions and 9 deletions

View 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

View 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. */
@@ -359,8 +359,14 @@
#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 */

View 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));

View File

@@ -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",

View 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

View 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);