示例#1
0
        public override DamageData.Target CalculateDamage()
        {
            DamageData.Target finalState = this.CurrentTarget;
            DamageData.HEData he         = _heData;
            he.Power = CalculatedPowerDropoff(he.Power, he.EffectiveRadius, _distanceToCentre);

            // Does not consider ERA
            if (CurrentTarget.Armor >= ARMOR_CUTOFF)
            {
                // The HE round has no effect on such a heavily armored target
                return(finalState);
            }
            else
            {
                // Lookup multiplier from the table
                float armorMultiplier;
                bool  lookupSuccessful = ArmorToHEMultiplier.TryGetValue((int)CurrentTarget.Armor, out armorMultiplier);
                if (lookupSuccessful)
                {
                    he.Power           = he.Power * armorMultiplier;
                    finalState.Health -= he.Power * he.HealthDamageFactor;
                    return(finalState);
                }
                else
                {
                    throw new Exception("target armor value not in lookup table");
                }
            }
        }
示例#2
0
 public HEDamage(DamageData.HEData data, DamageData.Target target, float distanceToCentre) : base(DamageType.HE, target)
 {
     _heData           = data;
     _distanceToCentre = distanceToCentre;
 }