Exemplo n.º 1
0
    /**
     * 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);
    }
Exemplo n.º 2
0
 public static float GetSpecificArmorReduction(AttackTypeEnum attackType, ArmorTypeEnum armorType)
 {
     return(attackTypeVsArmorTypeMultiplier[(int)attackType, (int)armorType]);
 }