Exemple #1
0
        public override DamageData.Target CalculateDamage()
        {
            DamageData.Target      finalState = this.CurrentTarget;
            DamageData.KineticData ke         = _keData;

            Logger.LogDamage($"Initial KE dmg is {ke.Power}");

            // Calculate attenuation of air friction
            ke.Power = CalculateKEAttenuationSimple(
                ke.Power,
                _distance,
                ke.Friction
                );

            Logger.LogDamage($"Attenuated KE dmg is {ke.Power}");

            // Hack because the formulas below do not work, remove when fixed:
            finalState.Health -= ke.Power;
            return(finalState);

            //if (finalState.EraData.Value > 0.0f) {
            //    // Calculate effects of ERA
            //    float finalEra = Math.Max(
            //        0.0f,
            //        finalState.EraData.Value - ke.Power * finalState.EraData.KEFractionMultiplier
            //    );
            //    finalState.EraData.Value = finalEra;

            //    ke.Power = CalculatePostEraPower(
            //        ke.Power,
            //        finalState.EraData.KEFractionMultiplier
            //    );
            //    Logger.LogDamage($"Post ERA KE dmg is {ke.Power}");
            //}

            //// Armor degradation
            //float finalArmor = Math.Max(
            //    0.0f,
            //    finalState.Armor - (ke.Power / finalState.Armor) * ke.Degradation
            //);
            //finalState.Armor = finalArmor;

            //// Calculate final damage
            //float finalDamage = Math.Max(
            //    0.0f,
            //    (ke.Power - finalState.Armor) * ke.HealthDamageFactor
            //);
            //Logger.LogDamage($"Final KE dmg is {finalDamage}");
            //float finalHealth = Math.Max(
            //    0.0f,
            //    finalState.Health - finalDamage
            //);
            //finalState.Health = finalHealth;

            //return finalState;
        }
Exemple #2
0
 public KEDamage(DamageData.KineticData data, DamageData.Target target, float distance)
     : base(DamageType.KE, target)
 {
     _keData   = data;
     _distance = distance;
 }