getobj callback for an object to engrave with */
| 478 | |
| 479 | /* getobj callback for an object to engrave with */ |
| 480 | staticfn int |
| 481 | stylus_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)? */ |
| 502 | staticfn boolean |
nothing calls this directly
no outgoing calls
no test coverage detected