/** * METHODS */ public static float ArmorDamageReduction(AttackTypeEnum attackType, ArmorTypeEnum armorType, float armorAmount) { float typeReduction = GetSpecificArmorReduction(attackType, armorType); float reduction = armorAmount * ArmorReductionMultiplier; if (armorAmount >= 0f) { reduction = 1f - (reduction / (1f + reduction)); } else { reduction = 2f - Mathf.Pow(1f - ArmorReductionMultiplier, -armorAmount); } return(reduction * typeReduction); }
public static float GetSpecificArmorReduction(AttackTypeEnum attackType, ArmorTypeEnum armorType) { return(attackTypeVsArmorTypeMultiplier[(int)attackType, (int)armorType]); }