Check if something worn is cursed _and_ unremovable. */
| 1890 | |
| 1891 | /* Check if something worn is cursed _and_ unremovable. */ |
| 1892 | int |
| 1893 | cursed(struct obj *otmp) |
| 1894 | { |
| 1895 | if (!otmp) { |
| 1896 | impossible("cursed without otmp"); |
| 1897 | return 0; |
| 1898 | } |
| 1899 | /* Curses, like chickens, come home to roost. */ |
| 1900 | if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) { |
| 1901 | boolean use_plural = (is_boots(otmp) || is_gloves(otmp) |
| 1902 | || otmp->otyp == LENSES || otmp->quan > 1L); |
| 1903 | |
| 1904 | /* might be trying again after applying grease to hands */ |
| 1905 | if (Glib && otmp->bknown |
| 1906 | /* for weapon, we'll only get here via 'A )' */ |
| 1907 | && (uarmg ? (otmp == uwep) |
| 1908 | : ((otmp->owornmask & (W_WEP | W_RING)) != 0))) |
| 1909 | pline("Despite your slippery %s, you can't.", |
| 1910 | fingers_or_gloves(TRUE)); |
| 1911 | else |
| 1912 | You("can't. %s cursed.", use_plural ? "They are" : "It is"); |
| 1913 | set_bknown(otmp, 1); |
| 1914 | return 1; |
| 1915 | } |
| 1916 | return 0; |
| 1917 | } |
| 1918 | |
| 1919 | int |
| 1920 | armoroff(struct obj *otmp) |
no test coverage detected