From: PatR Date: Fri, 8 Apr 2016 08:12:53 +0000 (-0700) Subject: 'fix' #H4295 - weapon shattering X-Git-Tag: NetHack-3.6.1_RC01~841 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f150d8ddfee48ffc5af5fb21109fc277fee93064;p=nethack 'fix' #H4295 - weapon shattering When hero with two-handed weapon, or samurai with katana and without shield, hits a monster which is wielding a weapon, there is a chance for defender's weapon to be destroyed via shattering. The chance is reduced--by increasing the chance to resist--if the hero's weapon is rusty or otherwise eroded. That works as intended. This changes things to make the chance be increased--by reducing the chance to resist--if defender's weapon is rusty or otherwise eroded. --- diff --git a/src/uhitm.c b/src/uhitm.c index 1b3bb84ea..48a16883f 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* 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. */ @@ -662,15 +662,19 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ && 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;