-/* NetHack 3.6 uhitm.c $NHDT-Date: 1456992470 2016/03/03 08:07:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.155 $ */
+/* NetHack 3.6 uhitm.c $NHDT-Date: 1460103141 2016/04/08 08:12:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.156 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
&& P_SKILL(wtype) >= P_SKILLED)
&& ((monwep = MON_WEP(mon)) != 0
&& !is_flimsy(monwep)
- && !obj_resists(
- monwep, 50 + 15 * greatest_erosion(obj),
- 100))) {
+ && !obj_resists(monwep,
+ 50 + 15 * (greatest_erosion(obj)
+ - greatest_erosion(monwep)),
+ 100))) {
/*
* 2.5% chance of shattering defender's weapon when
* using a two-handed weapon; less if uwep is rusted.
* [dieroll == 2 is most successful non-beheading or
* -bisecting hit, in case of special artifact damage;
* the percentage chance is (1/20)*(50/100).]
+ * If attacker's weapon is rustier than defender's,
+ * the obj_resists chance is increased so the shatter
+ * chance is decreased; if less rusty, then vice versa.
*/
setmnotwielded(mon, monwep);
mon->weapon_check = NEED_WEAPON;