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

Function dowear

src/do_wear.c:2431–2450  ·  view source on GitHub ↗

the #wear command */

Source from the content-addressed store, hash-verified

2429
2430/* the #wear command */
2431int
2432dowear(void)
2433{
2434 struct obj *otmp;
2435
2436 /* cantweararm() checks for suits of armor, not what we want here;
2437 verysmall() or nohands() checks for shields, gloves, etc... */
2438 if (verysmall(gy.youmonst.data) || nohands(gy.youmonst.data)) {
2439 pline("Don't even bother.");
2440 return ECMD_OK;
2441 }
2442 if (uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf
2443 && uleft && uright && uamul && ublindf) {
2444 /* 'W' message doesn't mention accessories */
2445 You("are already wearing a full complement of armor.");
2446 return ECMD_OK;
2447 }
2448 otmp = getobj("wear", wear_ok, GETOBJ_NOFLAGS);
2449 return otmp ? accessory_or_armor_on(otmp) : ECMD_CANCEL;
2450}
2451
2452/* the #puton command */
2453int

Callers

nothing calls this directly

Calls 4

YouFunction · 0.85
getobjFunction · 0.85
accessory_or_armor_onFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected