| 758 | } |
| 759 | |
| 760 | int |
| 761 | can_twoweapon(void) |
| 762 | { |
| 763 | struct obj *otmp; |
| 764 | |
| 765 | if (!could_twoweap(gy.youmonst.data)) { |
| 766 | if (Upolyd) |
| 767 | You_cant("use two weapons in your current form."); |
| 768 | else |
| 769 | pline("%s aren't able to use two weapons at once.", |
| 770 | makeplural((flags.female && gu.urole.name.f) |
| 771 | ? gu.urole.name.f : gu.urole.name.m)); |
| 772 | } else if (!uwep || !uswapwep) { |
| 773 | const char *hand_s = body_part(HAND); |
| 774 | |
| 775 | if (!uwep && !uswapwep) |
| 776 | hand_s = makeplural(hand_s); |
| 777 | /* "your hands are empty" or "your {left|right} hand is empty" */ |
| 778 | Your("%s%s %s empty.", uwep ? "left " : uswapwep ? "right " : "", |
| 779 | hand_s, vtense(hand_s, "are")); |
| 780 | } else if (!TWOWEAPOK(uwep) || !TWOWEAPOK(uswapwep)) { |
| 781 | otmp = !TWOWEAPOK(uwep) ? uwep : uswapwep; |
| 782 | pline("%s %s suitable %s weapon%s.", Yname2(otmp), |
| 783 | is_plural(otmp) ? "aren't" : "isn't a", |
| 784 | (otmp == uwep) ? "primary" : "secondary", |
| 785 | plur(otmp->quan)); |
| 786 | } else if (bimanual(uwep) || bimanual(uswapwep)) { |
| 787 | otmp = bimanual(uwep) ? uwep : uswapwep; |
| 788 | pline("%s isn't one-handed.", Yname2(otmp)); |
| 789 | } else if (uarms) { |
| 790 | You_cant("use two weapons while wearing a shield."); |
| 791 | } else if (uswapwep->oartifact) { |
| 792 | pline("%s being held second to another weapon!", |
| 793 | Yobjnam2(uswapwep, "resist")); |
| 794 | } else if (uswapwep->otyp == CORPSE && cant_wield_corpse(uswapwep)) { |
| 795 | /* [Note: !TWOWEAPOK() check prevents ever getting here...] */ |
| 796 | ; /* must be life-saved to reach here; return FALSE */ |
| 797 | } else if (Glib || uswapwep->cursed) { |
| 798 | if (!Glib) |
| 799 | set_bknown(uswapwep, 1); |
| 800 | drop_uswapwep(); |
| 801 | } else |
| 802 | return TRUE; |
| 803 | return FALSE; |
| 804 | } |
| 805 | |
| 806 | /* uswapwep has become cursed while in two-weapon combat mode or hero is |
| 807 | attempting to dual-wield when it is already cursed or hands are slippery */ |
no test coverage detected