Fire/Frost Brand vs rusting

Implement the suggestion that Fire Brand avoids damage from rust traps
by boiling away the water.  Rather than making this be trap-specific, it
applies to all types of erosion which go through erode_obj().  That includes
hitting rust monsters but not dipping into potions or fountains, nor falling
into moats.  And it doesn't provide 100% protection, just a high chance of
avoiding rust damage.  Also, Frost Brand gets similar protection by freezing.

     The message handling needed some rewriting for the branch version.
That compiles ok but hasn't been tested.  It would have been simpler just to
move Yobjnam2() over even if nothing else was changed to use it yet....
This commit is contained in:
nethack.rankin
2005-04-19 04:15:51 +00:00
parent a85d3bf01c
commit f4a3b20afe
6 changed files with 47 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)artifact.c 3.5 2003/08/11 */
/* SCCS Id: @(#)artifact.c 3.5 2005/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -545,6 +545,22 @@ touch_artifact(obj,mon)
return 1;
}
/* decide whether an artifact itself is vulnerable to a particular type
of erosion damage, independent of the properties of its bearer */
boolean
arti_immune(obj, dtyp)
struct obj *obj;
int dtyp;
{
register const struct artifact *weap = get_artifact(obj);
if (!weap) return FALSE;
if (dtyp == AD_PHYS) return FALSE; /* nothing is immune to phys dmg */
return (weap->attk.adtyp == dtyp ||
weap->defn.adtyp == dtyp ||
weap->cary.adtyp == dtyp);
}
/* decide whether an artifact's special attacks apply against mtmp */
STATIC_OVL int
spec_applies(weap, mtmp)
@@ -1551,5 +1567,5 @@ int orc_count;
pline("%s stops glowing.", bare_artifactname(uwep));
}
}
/*artifact.c*/
/*artifact.c*/