fix #K2924 - breaking a wand without free hands

Breaking a wand didn't require the hero to have free hands.
That's definitely a bug when they're both welded to the same
two-handed weapon.  It's debatable when welded separately to
a one-handed weapon and to a shield but simpler to pretend
there's no such distinction.

This also makes glass wand join balsa wand as "fragile".  Hero
doesn't need as much strength to break them as other wands and
the wording for breaking them is slightly different.

My fixes entry initially had a trailing space.  When I took
that out, I spotted a couple of others so take those out too.
This commit is contained in:
PatR
2020-11-12 04:30:25 -08:00
parent 6b37efa9e1
commit e23f764d11
2 changed files with 17 additions and 11 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.349 $ $NHDT-Date: 1604880453 2020/11/09 00:07:33 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.350 $ $NHDT-Date: 1605184219 2020/11/12 12:30:19 $
General Fixes and Modified Features
-----------------------------------
@@ -290,6 +290,9 @@ monster hiding under an egg that hatched was kept hidden
restful sleep regenerates hit points
attacking non-adjacent concealed mimic by applying a polearm would make the
hero be stuck to that mimic
hero could break a wand ("raising the wand high over your head, you break it
in two") even if hands were welded to a two-handed weapon or to a
one-handed weapon and also to a shield
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
+11 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 apply.c $NHDT-Date: 1604442295 2020/11/03 22:24:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.330 $ */
/* NetHack 3.7 apply.c $NHDT-Date: 1605184220 2020/11/12 12:30:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.331 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3406,21 +3406,24 @@ struct obj *obj;
boolean fillmsg = FALSE;
int expltype = EXPL_MAGICAL;
char confirm[QBUFSZ], buf[BUFSZ];
boolean is_fragile = objdescr_is(obj, "balsa");
if (!paranoid_query(ParanoidBreakwand,
safe_qbuf(confirm,
"Are you really sure you want to break ",
"?", obj, yname, ysimple_name, "the wand")))
return 0;
boolean is_fragile = (objdescr_is(obj, "balsa")
|| objdescr_is(obj, "glass"));
if (nohands(g.youmonst.data)) {
You_cant("break %s without hands!", yname(obj));
return 0;
} else if (!freehand()) {
Your("%s are occupied!", makeplural(body_part(HAND)));
return 0;
} else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) {
You("don't have the strength to break %s!", yname(obj));
return 0;
}
if (!paranoid_query(ParanoidBreakwand,
safe_qbuf(confirm,
"Are you really sure you want to break ",
"?", obj, yname, ysimple_name, "the wand")))
return 0;
pline("Raising %s high above your %s, you %s it in two!", yname(obj),
body_part(HEAD), is_fragile ? "snap" : "break");