Exemple #1
0
        public static float ComputeRawDamageOld(
            DamageTypes damageType,
            float magnitude,
            float armorEffectiveness,
            float absorbedDamageRatio)
        {
            float num1 = 0.0f;
            float factorByDamageType = CombatStatCalculator.GetBluntDamageFactorByDamageType(damageType);
            float num2 = magnitude * factorByDamageType;
            float num3 = num1 + num2 * (float)(100.0 / (100.0 + (double)armorEffectiveness));
            float num4;

            switch (damageType)
            {
            case DamageTypes.Cut:
                num4 = Math.Max(0.0f, magnitude * (float)(1.0 - 0.600000023841858 * (double)armorEffectiveness / (20.0 + 0.400000005960464 * (double)armorEffectiveness)));
                break;

            case DamageTypes.Pierce:
                num4 = Math.Max(0.0f, magnitude * (float)(45.0 / (45.0 + (double)armorEffectiveness)));
                break;

            case DamageTypes.Blunt:
label_5:
                return(num3 * absorbedDamageRatio);

            default:
                return(0.0f);
            }
            num3 += num4 * (1f - factorByDamageType);
            goto label_5;
        }
Exemple #2
0
 public static float CalculateBaseBlowMagnitudeForThrust(
     float linearSpeed,
     float weaponWeight,
     float exraLinearSpeed)
 {
     return(CombatStatCalculator.CalculateStrikeMagnitudeForThrust(linearSpeed, weaponWeight, exraLinearSpeed, false));
 }
Exemple #3
0
        public static float CalculateBaseBlowMagnitudeForSwing(
            float angularSpeed,
            float weaponReach,
            float weaponWeight,
            float weaponInertia,
            float weaponCoM,
            float impactPoint,
            float exraLinearSpeed)
        {
            impactPoint = Math.Min(impactPoint, 0.93f);
            float num1 = MBMath.ClampFloat(0.4f / weaponReach, 0.0f, 1f);
            float num2 = 0.0f;

            for (int index = 0; index < 5; ++index)
            {
                float impactPointAsPercent = impactPoint + (float)index / 4f * num1;
                if ((double)impactPointAsPercent < 1.0)
                {
                    float magnitudeForSwing = CombatStatCalculator.CalculateStrikeMagnitudeForSwing(angularSpeed, impactPointAsPercent, weaponWeight, weaponReach, weaponInertia, weaponCoM, exraLinearSpeed);
                    if ((double)num2 < (double)magnitudeForSwing)
                    {
                        num2 = magnitudeForSwing;
                    }
                }
                else
                {
                    break;
                }
            }
            return(num2);
        }
Exemple #4
0
        public static float ComputeRawDamageNew(
            DamageTypes damageType,
            float magnitude,
            float armorEffectiveness,
            float absorbedDamageRatio)
        {
            float num1 = 0.0f;
            float factorByDamageType = CombatStatCalculator.GetBluntDamageFactorByDamageType(damageType);
            float num2 = magnitude * factorByDamageType;
            float num3 = (float)(100.0 / (100.0 + (double)armorEffectiveness));
            float num4 = num1 + num2 * num3;
            float num5;

            switch (damageType)
            {
            case DamageTypes.Cut:
                num5 = Math.Max(0.0f, (float)((double)magnitude * (double)num3 - (double)armorEffectiveness * 0.5));
                break;

            case DamageTypes.Pierce:
                num5 = Math.Max(0.0f, (float)((double)magnitude * (double)num3 - (double)armorEffectiveness * 0.330000013113022));
                break;

            case DamageTypes.Blunt:
label_5:
                return(num4 * absorbedDamageRatio);

            default:
                return(0.0f);
            }
            num4 += num5 * (1f - factorByDamageType);
            goto label_5;
        }
Exemple #5
0
        private static float CalculateStrikeMagnitudeForPassiveUsage(
            float weaponWeight,
            float extraLinearSpeed)
        {
            float magnitudeForThrust = CombatStatCalculator.CalculateStrikeMagnitudeForThrust(0.0f, (float)(20.0 / ((double)extraLinearSpeed > 0.0 ? (double)MathF.Pow(extraLinearSpeed, 0.1f) : 1.0)) + weaponWeight, extraLinearSpeed * 0.83f, false);

            return((double)magnitudeForThrust < 10.0 ? 0.0f : magnitudeForThrust);
        }
Exemple #6
0
 public static float CalculateBaseBlowMagnitudeForPassiveUsage(
     float weaponWeight,
     float exraLinearSpeed)
 {
     return(CombatStatCalculator.CalculateStrikeMagnitudeForPassiveUsage(weaponWeight, exraLinearSpeed));
 }