-/* SCCS Id: @(#)trap.c 3.5 2006/05/08 */
+/* SCCS Id: @(#)trap.c 3.5 2006/06/16 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
goto glovecheck;
default:
pline("%s you!", A_gush_of_water_hits);
- for (otmp=invent; otmp; otmp = otmp->nobj)
- (void) snuff_lit(otmp);
+ for (otmp = invent; otmp; otmp = otmp->nobj)
+ if (otmp->lamplit && otmp != uwep &&
+ (otmp != uswapwep || !u.twoweap))
+ (void) snuff_lit(otmp);
if (uarmc)
(void) rust_dmg(uarmc, cloak_simple_name(uarmc),
1, TRUE, &youmonst);
if (in_sight)
pline("%s %s!", A_gush_of_water_hits,
mon_nam(mtmp));
- for (otmp=mtmp->minvent; otmp; otmp = otmp->nobj)
- (void) snuff_lit(otmp);
- target = which_armor(mtmp, W_ARMC);
- if (target)
- (void) rust_dmg(target, cloak_simple_name(target),
- 1, TRUE, mtmp);
- else {
- target = which_armor(mtmp, W_ARM);
- if (target)
- (void) rust_dmg(target, "armor", 1, TRUE, mtmp);
+ for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
+ if (otmp->lamplit &&
+ (otmp->owornmask & (W_WEP|W_SWAPWEP)) == 0)
+ (void) snuff_lit(otmp);
+ if ((target = which_armor(mtmp, W_ARMC)) != 0)
+ (void) rust_dmg(target,
+ cloak_simple_name(target),
+ 1, TRUE, mtmp);
+ else if ((target = which_armor(mtmp, W_ARM)) != 0)
+ (void) rust_dmg(target, "armor", 1, TRUE, mtmp);
#ifdef TOURIST
- else {
- target = which_armor(mtmp, W_ARMU);
- (void) rust_dmg(target, "shirt", 1, TRUE, mtmp);
- }
+ else if ((target = which_armor(mtmp, W_ARMU)) != 0)
+ (void) rust_dmg(target, "shirt", 1, TRUE, mtmp);
#endif
- }
}
+
if (mptr == &mons[PM_IRON_GOLEM]) {
if (in_sight)
pline("%s falls to pieces!", Monnam(mtmp));
-/* SCCS Id: @(#)wield.c 3.5 2006/04/14 */
+/* SCCS Id: @(#)wield.c 3.5 2006/06/16 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
struct monst *victim;
boolean vismon, visobj, chill;
boolean ret = FALSE;
+ boolean already_affected = FALSE;
if (!target)
return FALSE;
vismon = victim && (victim != &youmonst) && canseemon(victim);
visobj = !victim && cansee(bhitpos.x, bhitpos.y); /* assume thrown */
+ if (!acid_dmg && target->lamplit) {
+ already_affected = snuff_lit(target);
+ if (already_affected) ret = TRUE;
+ }
erosion = acid_dmg ? target->oeroded2 : target->oeroded;
if (target->greased) {
(acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) {
if (flags.verbose || !(target->oerodeproof && target->rknown)) {
if (((victim == &youmonst) || vismon) && !for_dip)
- pline("%s not affected.", Yobjnam2(target, "are"));
+ pline("%s not %s.", Yobjnam2(target, "are"),
+ already_affected ? "harmed" : "affected");
/* no message if not carried or dipping */
}
if (target->oerodeproof) target->rknown = !for_dip;