limit how high accuracy, damage, or protection can become via eating rings
when blinded hero detects a trap by touch, make sure it shows up on the map
confused remove curse will cause loss of knowledge of items' curse/bless state
-With astral vision, the ";" command should only display "normal vision"
+with astral vision, the ";" command should only display "normal vision"
for things that could be seen without astral vision
#adjust can be used to split an inventory stack
cockatrice meat has a distinct flavor to some
wish request for "<something> armor" will match item named "<something> mail"
+Fire Brand and Frost Brand have a chance to avoid taking rust damage
Platform- and/or Interface-Specific New Features
E boolean FDECL(exist_artifact, (int,const char *));
E void FDECL(artifact_exists, (struct obj *,const char *,BOOLEAN_P));
E int NDECL(nartifact_exist);
+E boolean FDECL(arti_immune, (struct obj *,int));
E boolean FDECL(spec_ability, (struct obj *,unsigned long));
E boolean FDECL(confers_luck, (struct obj *));
E boolean FDECL(arti_reflects, (struct obj *));
-/* 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. */
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)
pline("%s stops glowing.", bare_artifactname(uwep));
}
}
-/*artifact.c*/
+/*artifact.c*/
-/* SCCS Id: @(#)mhitm.c 3.5 2004/10/20 */
+/* SCCS Id: @(#)mhitm.c 3.5 2005/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
boolean is_acid;
if (!magr || !mdef || !obj) return; /* just in case */
-
if (dmgtype(mdef->data, AD_CORR))
is_acid = TRUE;
else if (dmgtype(mdef->data, AD_RUST))
is_acid = FALSE;
else
return;
-
- if (!mdef->mcan &&
- (is_acid ? is_corrodeable(obj) : is_rustprone(obj)) &&
- (is_acid ? obj->oeroded2 : obj->oeroded) < MAX_ERODE) {
- if (obj->greased || obj->oerodeproof || (obj->blessed && rn2(3))) {
- if (cansee(mdef->mx, mdef->my) && flags.verbose)
- pline("%s weapon is not affected.",
- s_suffix(Monnam(magr)));
- if (obj->greased && !rn2(2)) obj->greased = 0;
- } else {
- if (cansee(mdef->mx, mdef->my)) {
- pline("%s%s!",
- Yobjnam2(obj, (is_acid ? "corrode" : "rust")),
- (is_acid ? obj->oeroded2 : obj->oeroded)
- ? " further" : "");
- }
- if (is_acid) obj->oeroded2++;
- else obj->oeroded++;
- }
- }
+ (void) erode_obj(obj, is_acid, FALSE, FALSE);
}
STATIC_OVL void
-/* SCCS Id: @(#)mhitu.c 3.5 2005/02/09 */
+/* SCCS Id: @(#)mhitu.c 3.5 2005/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
register struct monst *mon;
register struct obj *obj;
{
- boolean vis;
boolean is_acid;
if (!mon || !obj) return; /* just in case */
is_acid = FALSE;
else
return;
-
- vis = cansee(mon->mx, mon->my);
-
- if ((is_acid ? is_corrodeable(obj) : is_rustprone(obj)) &&
- (is_acid ? obj->oeroded2 : obj->oeroded) < MAX_ERODE) {
- if (obj->greased || obj->oerodeproof || (obj->blessed && rn2(3))) {
- if (vis)
- pline("Somehow, %s weapon is not affected.",
- s_suffix(mon_nam(mon)));
- if (obj->greased && !rn2(2)) obj->greased = 0;
- } else {
- if (vis)
- pline("%s%s!",
- Yobjnam2(obj, (is_acid ? "corrode" : "rust")),
- (is_acid ? obj->oeroded2 : obj->oeroded)
- ? " further" : "");
- if (is_acid) obj->oeroded2++;
- else obj->oeroded++;
- }
- }
+ (void) erode_obj(obj, is_acid, FALSE, FALSE);
}
int
-/* SCCS Id: @(#)wield.c 3.5 2005/03/28 */
+/* SCCS Id: @(#)wield.c 3.5 2005/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
{
int erosion;
struct monst *victim;
- boolean vismon;
- boolean visobj;
+ boolean vismon, visobj, chill;
boolean ret = FALSE;
if (!target)
target->spe = 0;
ret = TRUE;
}
+ } else if (target->oartifact &&
+ /* (no artifacts currently meet either of these criteria) */
+ arti_immune(target, acid_dmg ? AD_ACID : AD_RUST)) {
+ if (flags.verbose) {
+ if (victim == &youmonst)
+ pline("%s.", Yobjnam2(target, "sizzle"));
+ }
+ /* no damage to object */
+ } else if (target->oartifact && !acid_dmg &&
+ /* cold and fire provide partial protection against rust */
+ ((chill = arti_immune(target, AD_COLD)) != 0 ||
+ arti_immune(target, AD_FIRE)) &&
+ /* once rusted, the chance for further rusting goes up */
+ rn2(2 * (MAX_ERODE + 1 - erosion))) {
+ if (flags.verbose && target->oclass == WEAPON_CLASS) {
+ if (victim == &youmonst || vismon || visobj)
+ pline("%s some water.",
+ Yobjnam2(target, chill ? "freeze" : "boil"));
+ }
+ /* no damage to object */
} else if (target->oerodeproof ||
(acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) {
if (flags.verbose || !(target->oerodeproof && target->rknown)) {