convert attack damage AD_foo to property resistance */
| 5651 | |
| 5652 | /* convert attack damage AD_foo to property resistance */ |
| 5653 | staticfn int |
| 5654 | adtyp_to_prop(int dmgtyp) |
| 5655 | { |
| 5656 | switch (dmgtyp) { |
| 5657 | case AD_COLD: |
| 5658 | return COLD_RES; |
| 5659 | case AD_FIRE: |
| 5660 | return FIRE_RES; |
| 5661 | case AD_ELEC: |
| 5662 | return SHOCK_RES; |
| 5663 | case AD_ACID: |
| 5664 | return ACID_RES; |
| 5665 | case AD_DISN: |
| 5666 | return DISINT_RES; |
| 5667 | default: |
| 5668 | break; |
| 5669 | } |
| 5670 | return 0; /* prop_types start at 1 */ |
| 5671 | } |
| 5672 | |
| 5673 | /* Is hero wearing or wielding an object with resistance to attack |
| 5674 | damage type? Returns the percentage protection that the object gives. */ |
no outgoing calls
no test coverage detected