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

Function dotakeoff

src/do_wear.c:1832–1855  ·  view source on GitHub ↗

the #takeoff command - remove worn armor */

Source from the content-addressed store, hash-verified

1830
1831/* the #takeoff command - remove worn armor */
1832int
1833dotakeoff(void)
1834{
1835 struct obj *otmp = (struct obj *) 0;
1836
1837 count_worn_stuff(&otmp, FALSE);
1838 if (!Narmorpieces && !Naccessories) {
1839 /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */
1840 if (uskin)
1841 pline_The("%s merged with your skin!",
1842 uskin->otyp >= GRAY_DRAGON_SCALES
1843 ? "dragon scales are"
1844 : "dragon scale mail is");
1845 else
1846 pline("Not wearing any armor or accessories.");
1847 return ECMD_OK;
1848 }
1849 if (Narmorpieces != 1 || ParanoidRemove || gi.item_action_in_progress)
1850 otmp = getobj("take off", takeoff_ok, GETOBJ_NOFLAGS);
1851 if (!otmp)
1852 return ECMD_CANCEL;
1853
1854 return armor_or_accessory_off(otmp);
1855}
1856
1857/* 'i' or 'I[' followed by <invlet> and then 'T';
1858 plain dotakeoff() would not give any feedback when picking suit

Callers 1

ia_dotakeoffFunction · 0.85

Calls 5

count_worn_stuffFunction · 0.85
pline_TheFunction · 0.85
getobjFunction · 0.85
armor_or_accessory_offFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected