MCPcopy Index your code
hub / github.com/NetHack/NetHack / obj_resists

Function obj_resists

src/zap.c:1457–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1455}
1456
1457boolean
1458obj_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
1475boolean
1476obj_shudders(struct obj *obj)

Callers 15

maybe_absorb_itemFunction · 0.85
mdrop_special_objsFunction · 0.85
impact_arti_lightFunction · 0.85
maybe_destroy_armorFunction · 0.85
hmon_hitmon_weapon_meleeFunction · 0.85
joustFunction · 0.85
flooreffectsFunction · 0.85
dosinkringFunction · 0.85
bury_an_objFunction · 0.85
breaktestFunction · 0.85
forcelockFunction · 0.85
delobj_coreFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected