decide whether this obj is effective when attacking against shades; does not consider the bonus for blessed objects versus undead */
| 552 | /* decide whether this obj is effective when attacking against shades; |
| 553 | does not consider the bonus for blessed objects versus undead */ |
| 554 | boolean |
| 555 | shade_glare(struct obj *obj) |
| 556 | { |
| 557 | const struct artifact *arti; |
| 558 | |
| 559 | /* any silver object is effective */ |
| 560 | if (objects[obj->otyp].oc_material == SILVER) |
| 561 | return TRUE; |
| 562 | /* non-silver artifacts with bonus against undead also are effective */ |
| 563 | arti = get_artifact(obj); |
| 564 | if (arti != &artilist[ART_NONARTIFACT] && (arti->spfx & SPFX_DFLAG2) |
| 565 | && arti->mtype == M2_UNDEAD) |
| 566 | return TRUE; |
| 567 | /* [if there was anything with special bonus against noncorporeals, |
| 568 | it would be effective too] */ |
| 569 | /* otherwise, harmless to shades */ |
| 570 | return FALSE; |
| 571 | } |
| 572 | |
| 573 | /* returns 1 if name is restricted for otmp->otyp */ |
| 574 | boolean |
no test coverage detected