the #seerings command */
| 4639 | |
| 4640 | /* the #seerings command */ |
| 4641 | int |
| 4642 | doprring(void) |
| 4643 | { |
| 4644 | if (!uleft && !uright) { |
| 4645 | You("are not wearing any rings."); |
| 4646 | } else { |
| 4647 | char lets[3]; /* 3: uright, uleft, terminator */ |
| 4648 | boolean use_inuse_mode = FALSE; |
| 4649 | int ct = 0; |
| 4650 | |
| 4651 | /* if either ring is a meat ring, switch to use_inuse_mode in order |
| 4652 | to label it/them as "Rings" rather than "Comestibles" */ |
| 4653 | if (uright) { |
| 4654 | lets[ct++] = obj_to_let(uright); |
| 4655 | if (uright->oclass != RING_CLASS) |
| 4656 | use_inuse_mode = TRUE; |
| 4657 | } |
| 4658 | if (uleft) { |
| 4659 | lets[ct++] = obj_to_let(uleft); |
| 4660 | if (uleft->oclass != RING_CLASS) |
| 4661 | use_inuse_mode = TRUE; |
| 4662 | } |
| 4663 | lets[ct] = '\0'; |
| 4664 | /* also switch to use_inuse_mode if there are two rings or player |
| 4665 | used the 'm' prefix */ |
| 4666 | if (ct > 1 || iflags.menu_requested) |
| 4667 | use_inuse_mode = TRUE; |
| 4668 | |
| 4669 | (void) dispinv_with_action(lets, use_inuse_mode, |
| 4670 | /* note; alternate label will be ignored |
| 4671 | if 'use_inuse_mode' is False */ |
| 4672 | (ct == 1) ? "Ring" : "Rings"); |
| 4673 | } |
| 4674 | return ECMD_OK; |
| 4675 | } |
| 4676 | |
| 4677 | /* the #seeamulet command */ |
| 4678 | int |
nothing calls this directly
no test coverage detected