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

Function invoke_ok

src/artifact.c:1726–1745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1724
1725/* getobj callback for object to be invoked */
1726staticfn int
1727invoke_ok(struct obj *obj)
1728{
1729 if (!obj)
1730 return GETOBJ_EXCLUDE;
1731
1732 /* artifacts and other special items */
1733 if (obj->oartifact || objects[obj->otyp].oc_unique
1734 || (obj->otyp == FAKE_AMULET_OF_YENDOR && !obj->known))
1735 return GETOBJ_SUGGEST;
1736
1737 /* synonym for apply, though actually invoking it will do different things
1738 * depending if it's a regular crystal ball, an artifact one that has an
1739 * invoke power, and a (theoretical) artifact one that doesn't have an
1740 * invoke power */
1741 if (obj->otyp == CRYSTAL_BALL)
1742 return GETOBJ_SUGGEST;
1743
1744 return GETOBJ_EXCLUDE;
1745}
1746
1747/* the #invoke command */
1748int

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected