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

Function donning

src/do_wear.c:1573–1597  ·  view source on GitHub ↗

check whether the target object is currently being put on (or taken off-- also checks for doffing--[why?]) */

Source from the content-addressed store, hash-verified

1571/* check whether the target object is currently being put on (or taken off--
1572 also checks for doffing--[why?]) */
1573boolean
1574donning(struct obj *otmp)
1575{
1576 boolean result = FALSE;
1577
1578 /* 'W' (or 'P' used for armor) sets ga.afternmv */
1579 if (doffing(otmp))
1580 result = TRUE;
1581 else if (otmp == uarm)
1582 result = (ga.afternmv == Armor_on);
1583 else if (otmp == uarmu)
1584 result = (ga.afternmv == Shirt_on);
1585 else if (otmp == uarmc)
1586 result = (ga.afternmv == Cloak_on);
1587 else if (otmp == uarmf)
1588 result = (ga.afternmv == Boots_on);
1589 else if (otmp == uarmh)
1590 result = (ga.afternmv == Helmet_on);
1591 else if (otmp == uarmg)
1592 result = (ga.afternmv == Gloves_on);
1593 else if (otmp == uarms)
1594 result = (ga.afternmv == Shield_on);
1595
1596 return result;
1597}
1598
1599/* check whether the target object is currently being taken off,
1600 so that stop_donning() and steal() can vary messages and doname()

Callers 6

remove_worn_itemFunction · 0.85
cancel_doffFunction · 0.85
stop_donningFunction · 0.85
wornarm_destroyedFunction · 0.85
doname_baseFunction · 0.85
break_armorFunction · 0.85

Calls 1

doffingFunction · 0.85

Tested by

no test coverage detected