forked from MagicBane/Server
item physical resists refactored
This commit is contained in:
@@ -159,14 +159,16 @@ public class Resists {
|
||||
}
|
||||
|
||||
private static float[] getArmorResists(Item armor, float[] phys) {
|
||||
|
||||
if (armor == null)
|
||||
return phys;
|
||||
ItemBase ab = armor.getItemBase();
|
||||
if (ab == null)
|
||||
return phys;
|
||||
phys[0] += ab.getSlashResist();
|
||||
phys[1] += ab.getCrushResist();
|
||||
phys[2] += ab.getPierceResist();
|
||||
|
||||
if (armor.template.item_type.equals(Enum.ItemType.ARMOR)) {
|
||||
phys[0] += armor.template.combat_attack_resist.get("Slashing");
|
||||
phys[1] += armor.template.combat_attack_resist.get("Crushing");
|
||||
phys[2] += armor.template.combat_attack_resist.get("Piercing");
|
||||
}
|
||||
|
||||
return phys;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user