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

Function stylus_ok

src/engrave.c:480–499  ·  view source on GitHub ↗

getobj callback for an object to engrave with */

Source from the content-addressed store, hash-verified

478
479/* getobj callback for an object to engrave with */
480staticfn int
481stylus_ok(struct obj *obj)
482{
483 if (!obj)
484 return GETOBJ_SUGGEST;
485
486 /* Potential extension: exclude weapons that don't make any sense (such as
487 * bullwhips) and downplay rings and gems that wouldn't be good to write
488 * with (such as glass and non-gem rings) */
489 if (obj->oclass == WEAPON_CLASS || obj->oclass == WAND_CLASS
490 || obj->oclass == GEM_CLASS || obj->oclass == RING_CLASS)
491 return GETOBJ_SUGGEST;
492
493 /* Only markers and towels are recommended tools. */
494 if (obj->oclass == TOOL_CLASS
495 && (obj->otyp == TOWEL || obj->otyp == MAGIC_MARKER))
496 return GETOBJ_SUGGEST;
497
498 return GETOBJ_DOWNPLAY;
499}
500
501/* can hero engrave at all (at their location)? */
502staticfn boolean

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected