#define will_weld(optr) \
((optr)->cursed && (erodeable_wep(optr) || (optr)->otyp == TIN_OPENER))
+/* to dual-wield, 'obj' must be a weapon or a weapon-tool, and not a bow
+ or arrow or missile (dart, shuriken, boomerang), so not matching the
+ one-handed weapons which yield "you begin bashing" if used for melee;
+ empty hands and two-handed weapons have to be handled separately */
+#define TWOWEAPOK(obj) \
+ (((obj)->oclass == WEAPON_CLASS) \
+ ? !(is_launcher(obj) ||is_ammo(obj) || is_missile(obj)) \
+ : is_weptool(obj))
+
+static const char
+ are_no_longer_twoweap[] = "are no longer using two weapons at once",
+ can_no_longer_twoweap[] = "can no longer wield two weapons at once";
+
/*** Functions that place a given item in a slot ***/
/* Proper usage includes:
* 1. Initializing the slot during character generation or a
{
/* Separated function so swapping works easily */
int res = 0;
- boolean had_wep = (uwep != 0);
+ boolean was_twoweap = u.twoweap, had_wep = (uwep != 0);
if (!wep) {
/* No weapon */
prinv((char *) 0, wep, 0L);
wep->owornmask = dummy;
}
+
setuwep(wep);
+ if (was_twoweap && !u.twoweap && flags.verbose) {
+ /* skip this message if we already got "empty handed" one above;
+ also, Null is not safe for neither TWOWEAPOK() or bimanual() */
+ if (uwep)
+ You("%s.", ((TWOWEAPOK(uwep) && !bimanual(uwep))
+ ? are_no_longer_twoweap
+ : can_no_longer_twoweap));
+ }
/* KMH -- Talking artifacts are finally implemented */
arti_speak(wep);
You("are now empty %s.", body_part(HANDED));
res = 1;
} else if (was_twoweap && !u.twoweap) {
- You("are no longer wielding two weapons at once.");
+ You("%s.", are_no_longer_twoweap);
res = 1;
}
return res;
{
struct obj *otmp;
- /* to dual-wield, obj must be a weapon or a weapon-tool, and not
- a bow or arrow or missile (dart, shuriken, boomerang), matching
- the sorts of weapons which yield "you begin bashing" when used
- for melee; we don't bother including polearms here because
- they'll be rejected as two-weapon because they're two-handed */
-#define TWOWEAPOK(obj) \
- (((obj)->oclass == WEAPON_CLASS) \
- ? !(is_launcher(obj) ||is_ammo(obj) || is_missile(obj)) \
- : is_weptool(obj))
-
if (!could_twoweap(g.youmonst.data)) {
if (Upolyd)
You_cant("use two weapons in your current form.");
untwoweapon()
{
if (u.twoweap) {
- You("can no longer use two weapons at once.");
+ You("%s.", can_no_longer_twoweap);
set_twoweap(FALSE); /* u.twoweap = FALSE */
update_inventory();
}