Where are armor factors in M&B2 Bannerlord?

Users who are viewing this thread

Armor factors (armor_soak_factor and armor_reduction_factor) are really easy to find in M&B Warband, but I can't find them in Bannerlord.
I would like to rebalance armor, does someone know where to look?

Cheers!
 
Solution
This took a lot longer to find than I thought it would, to be honest.

Code:
public static float ComputeRawDamageNew(DamageTypes damageType, float magnitude, float armorEffectiveness, float absorbedDamageRatio)
        {
            float num = 0f;
            float bluntDamageFactorByDamageType = CombatStatCalculator.GetBluntDamageFactorByDamageType(damageType);
            float num2 = magnitude * bluntDamageFactorByDamageType;
            float num3 = 100f / (100f + armorEffectiveness);
            num += num2 * num3;
            if (damageType != DamageTypes.Blunt)
            {
                float num4;
                if (damageType != DamageTypes.Cut)
                {
                    if (damageType != DamageTypes.Pierce)...
I think those are now handled in C++. In the spitems.xml there only lists a [body part]_armor value. I imagine there is a calculation somewhere in the dlls that controls how that value is used.
 
Upvote 0
This took a lot longer to find than I thought it would, to be honest.

Code:
public static float ComputeRawDamageNew(DamageTypes damageType, float magnitude, float armorEffectiveness, float absorbedDamageRatio)
        {
            float num = 0f;
            float bluntDamageFactorByDamageType = CombatStatCalculator.GetBluntDamageFactorByDamageType(damageType);
            float num2 = magnitude * bluntDamageFactorByDamageType;
            float num3 = 100f / (100f + armorEffectiveness);
            num += num2 * num3;
            if (damageType != DamageTypes.Blunt)
            {
                float num4;
                if (damageType != DamageTypes.Cut)
                {
                    if (damageType != DamageTypes.Pierce)
                    {
                        return 0f;
                    }
                    num4 = Math.Max(0f, magnitude * num3 - armorEffectiveness * 0.33f);
                }
                else
                {
                    num4 = Math.Max(0f, magnitude * num3 - armorEffectiveness * 0.5f);
                }
                num += num4 * (1f - bluntDamageFactorByDamageType);
            }
            return num * absorbedDamageRatio;

Code:
private static float GetBluntDamageFactorByDamageType(DamageTypes damageType)
        {
            float result = 0f;
            switch (damageType)
            {
            case DamageTypes.Cut:
                result = 0.1f;
                break;
            case DamageTypes.Pierce:
                result = 0.25f;
                break;
            case DamageTypes.Blunt:
                result = 1f;
                break;
            }
            return result;
        }
 
Upvote 0
Solution
Back
Top Bottom