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

Function dotwoweapon

src/wield.c:844–864  ·  view source on GitHub ↗

the #twoweapon command */

Source from the content-addressed store, hash-verified

842
843/* the #twoweapon command */
844int
845dotwoweapon(void)
846{
847 /* You can always toggle it off */
848 if (u.twoweap) {
849 You("switch to your primary weapon.");
850 set_twoweap(FALSE); /* u.twoweap = FALSE */
851 update_inventory();
852 return ECMD_OK;
853 }
854
855 /* May we use two weapons? */
856 if (can_twoweapon()) {
857 /* Success! */
858 You("begin two-weapon combat.");
859 set_twoweap(TRUE); /* u.twoweap = TRUE */
860 update_inventory();
861 return (rnd(20) > ACURR(A_DEX)) ? ECMD_TIME : ECMD_OK;
862 }
863 return ECMD_OK;
864}
865
866/*** Functions to empty a given slot ***/
867/* These should be used only when the item can't be put back in

Callers

nothing calls this directly

Calls 5

YouFunction · 0.85
set_twoweapFunction · 0.85
update_inventoryFunction · 0.85
can_twoweaponFunction · 0.85
rndFunction · 0.85

Tested by

no test coverage detected