Rolls to see whether an object in inventory resists damage from the given damage type, due to an equipped item protecting it. Use u_adtyp_resistance_obj to discover whether objects are protected in general (e.g. for enlightenment) and this function to actually do the roll to see whether a specific object is protected. This function doesn't check for other reasons why an object migh
| 5707 | be protected; you will usually need to do an obj_resists() call |
| 5708 | too. */ |
| 5709 | boolean |
| 5710 | inventory_resistance_check(int dmgtyp) |
| 5711 | { |
| 5712 | int prob = u_adtyp_resistance_obj(dmgtyp); |
| 5713 | |
| 5714 | if (!prob) |
| 5715 | return FALSE; |
| 5716 | |
| 5717 | return rn2(100) < prob; |
| 5718 | } |
| 5719 | |
| 5720 | /* for enlightenment; currently only useful in wizard mode; cf from_what() */ |
| 5721 | char * |
no test coverage detected