Beispiel #1
0
        public CombatResult CalculateAverageDamage(Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic = true)
        {
            EnsureEffectProcs();

            var result = new CombatResult();
            foreach (var effect in Effects)
            {
                result.Add(effect.CalculateAverageDamage(myForce, enemyForce, boosts, vsEpic));
            }

            // Apply Rally Effects - Rally will only work once for each ability and will affect abilities which deal no damage
            if (boosts != null)
            {
                foreach (var rallyEffect in boosts.Where(x => x.Type == EffectType.Rally))
                {
                    var abilBonus = rallyEffect.ParentAbilityProcChance*rallyEffect.EffectValue*this.ProcChance;
                    if (HasEffect(EffectType.FlurryDamage))
                    {
                        var baseBonus = abilBonus;
                        abilBonus = 0;
                        foreach (var effect in GetEffects(EffectType.FlurryDamage))
                        {
                            abilBonus += baseBonus*effect.EffectValue;
                        }
                    }
                    result.Damage += abilBonus;
                }
            }

            return result;
        }
Beispiel #2
0
        public CombatResult CalculateAverageDamage(Force myForce, Force enemyForce, bool vsEpic = true)
        {
            var result = new CombatResult();

            foreach (var ability in Abilities)
            {
                // Formations can never recieve Boosts
                result.Add(ability.CalculateAverageDamage(myForce, enemyForce, null, vsEpic));
            }

            return result;
        }
Beispiel #3
0
        public CombatResult CalculateAverageDamage(Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic = true)
        {
            var result = new CombatResult();

            var useableBoosts = new List<Effect>();
            if(boosts != null)
            {
                useableBoosts.AddRange(boosts.Where(effect => effect.IsBoostEffect() && this.IsClassification(effect.TargetType)).ToList());
            }
            foreach (var ability in Abilities)
            {
                result.Add(ability.CalculateAverageDamage(myForce, enemyForce, useableBoosts, vsEpic));
            }

            return result;
        }
Beispiel #4
0
        public CombatResult CalculateTotalDamageContribution(Guid claimerID, Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic = true)
        {
            var result = new CombatResult();

            result.Add(this.CalculateAverageDamage(myForce, enemyForce, boosts, vsEpic));
            result.Add(this.CalculateReinforcedDamage(claimerID, myForce, enemyForce, boosts, vsEpic));

            return result;
        }
Beispiel #5
0
        public CombatResult CalculateReinforcedDamage(Guid claimerID, Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic = true)
        {
            EnsureEffectProcs();

            var result = new CombatResult();

            if (HasEffect(EffectType.Reinforce) == false)
            {
                return result;
            }

            foreach (var effect in GetEffects(EffectType.Reinforce))
            {
                result.Add(effect.CalculateReinforcedDamage(claimerID, myForce, enemyForce, boosts, vsEpic));
            }

            return result;
        }
Beispiel #6
0
        public CombatResult CalculateAverageForceDamage(Force enemy)
        {
            var total = new CombatResult();
            foreach (var unit in GetUnits())
            {
                total.Add(unit.CalculateTotalDamageContribution(this, enemy, this.GetBoostAbilities(), enemy.IsEpicBoss));
            }

            return total;
        }
Beispiel #7
0
        public CombatResult CalculateReinforcedDamage(Guid claimerID, Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic)
        {
            var result = new CombatResult();

            foreach (var unit in myForce.ClaimReinforcements(claimerID, TargetType, EffectValue))
            {
                // Add each reinforced units total average damage potential (including reinforcements it might bring in too)
                var baseDamage = unit.CalculateTotalDamageContribution(myForce, enemyForce, boosts, vsEpic);
                result.Add(baseDamage.AdjustToProcChance(ParentAbilityProcChance));
            }

            return result;
        }
Beispiel #8
0
        public CombatResult CalculateReinforcedDamage(Force myForce, Force enemyForce, List<Effect> boosts, bool vsEpic = true)
        {
            var result = new CombatResult();

            foreach (var ability in Abilities.Where(x => x.HasEffect(EffectType.Reinforce)))
            {
                result.Add(ability.CalculateReinforcedDamage(this.ID, myForce, enemyForce, boosts, vsEpic));
            }

            return result;
        }