check whether the target object is currently being put on (or taken off-- also checks for doffing--[why?]) */
| 1571 | /* check whether the target object is currently being put on (or taken off-- |
| 1572 | also checks for doffing--[why?]) */ |
| 1573 | boolean |
| 1574 | donning(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() |
no test coverage detected