MCPcopy Index your code
hub / github.com/NetHack/NetHack / cursed

Function cursed

src/do_wear.c:1892–1917  ·  view source on GitHub ↗

Check if something worn is cursed _and_ unremovable. */

Source from the content-addressed store, hash-verified

1890
1891/* Check if something worn is cursed _and_ unremovable. */
1892int
1893cursed(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
1919int
1920armoroff(struct obj *otmp)

Callers 5

armoroffFunction · 0.85
select_offFunction · 0.85
do_takeoffFunction · 0.85
tiphatFunction · 0.85
doapplyFunction · 0.85

Calls 6

weldedFunction · 0.85
fingers_or_glovesFunction · 0.85
YouFunction · 0.85
set_bknownFunction · 0.85
impossibleFunction · 0.70
plineFunction · 0.70

Tested by

no test coverage detected