used to check whether a monster is getting reflection from an artifact */
| 534 | |
| 535 | /* used to check whether a monster is getting reflection from an artifact */ |
| 536 | boolean |
| 537 | arti_reflects(struct obj *obj) |
| 538 | { |
| 539 | const struct artifact *arti = get_artifact(obj); |
| 540 | |
| 541 | if (arti != &artilist[ART_NONARTIFACT]) { |
| 542 | /* while being worn */ |
| 543 | if ((obj->owornmask & ~W_ART) && (arti->spfx & SPFX_REFLECT)) |
| 544 | return TRUE; |
| 545 | /* just being carried */ |
| 546 | if (arti->cspfx & SPFX_REFLECT) |
| 547 | return TRUE; |
| 548 | } |
| 549 | return FALSE; |
| 550 | } |
| 551 | |
| 552 | /* decide whether this obj is effective when attacking against shades; |
| 553 | does not consider the bonus for blessed objects versus undead */ |
no test coverage detected