item physical resists refactored

This commit is contained in:
2024-03-06 14:53:17 -05:00
parent 84e74c5052
commit 3048f86f5b
3 changed files with 18 additions and 42 deletions
+8 -6
View File
@@ -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;
}