MCPcopy Create free account
hub / github.com/NetHack/NetHack / drop_uswapwep

Function drop_uswapwep

src/wield.c:808–831  ·  view source on GitHub ↗

uswapwep has become cursed while in two-weapon combat mode or hero is attempting to dual-wield when it is already cursed or hands are slippery */

Source from the content-addressed store, hash-verified

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 */
808void
809drop_uswapwep(void)
810{
811 char left_hand[QBUFSZ];
812 struct obj *obj = uswapwep;
813
814 /* this used to use makeplural(body_part(HAND)) but in order to be
815 dual-wielded, or to get this far attempting to achieve that,
816 uswapwep must be one-handed; since it's secondary, the hand must
817 be the left one */
818 Sprintf(left_hand, "left %s", body_part(HAND));
819 if (!obj->cursed)
820 /* attempting to two-weapon while Glib */
821 pline("%s from your %s!", Yobjnam2(obj, "slip"), left_hand);
822 else if (!u.twoweap)
823 /* attempting to two-weapon when uswapwep is cursed */
824 pline("%s your grasp and %s from your %s!",
825 Yobjnam2(obj, "evade"), otense(obj, "drop"), left_hand);
826 else
827 /* already two-weaponing but can't anymore because uswapwep has
828 become cursed */
829 Your("%s spasms and drops %s!", left_hand, yobjnam(obj, (char *) 0));
830 dropx(obj);
831}
832
833void
834set_twoweap(boolean on_off)

Callers 3

can_twoweaponFunction · 0.85
hmonasFunction · 0.85
curseFunction · 0.85

Calls 7

body_partFunction · 0.85
Yobjnam2Function · 0.85
otenseFunction · 0.85
YourFunction · 0.85
yobjnamFunction · 0.85
dropxFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected