| 1455 | } |
| 1456 | |
| 1457 | boolean |
| 1458 | obj_resists(struct obj *obj, |
| 1459 | int ochance, /* percent chance for ordinary objects */ |
| 1460 | int achance) /* percent chance for artifacts */ |
| 1461 | { |
| 1462 | if (obj->otyp == AMULET_OF_YENDOR |
| 1463 | || obj->otyp == SPE_BOOK_OF_THE_DEAD |
| 1464 | || obj->otyp == CANDELABRUM_OF_INVOCATION |
| 1465 | || obj->otyp == BELL_OF_OPENING |
| 1466 | || (obj->otyp == CORPSE && is_rider(&mons[obj->corpsenm]))) { |
| 1467 | return TRUE; |
| 1468 | } else { |
| 1469 | int chance = rn2(100); |
| 1470 | |
| 1471 | return (boolean) (chance < (obj->oartifact ? achance : ochance)); |
| 1472 | } |
| 1473 | } |
| 1474 | |
| 1475 | boolean |
| 1476 | obj_shudders(struct obj *obj) |
no test coverage detected