public override void CalculateAbilityDamageTaken(MyHero hero, AbilitiesMenu menu) { ActiveAbilities.Clear(); foreach (var ability in hero.GetValidAbilities(this).Where(x => courierDamageAbilities.Contains(x.AbilityId))) { ActiveAbilities[ability] = ability.CalculateDamage(hero.Hero, Unit); } if (ActiveAbilities.Any()) { AbilityDamageCalculated = true; } }
public void CalculateAbilityDamageTaken(MyHero hero, AbilitiesMenu menu) { if (hero.Team == Team) { return; } ActiveAbilities.Clear(); foreach (var ability in hero.GetValidAbilities(this) .Where(x => menu.IsAbilityEnabled(x.Name)) .OrderByDescending(x => menu.GetAbilityPriority(x.Name))) { ActiveAbilities[ability] = ability.CalculateDamage(hero.Hero, Unit); } if (ActiveAbilities.Any()) { AbilityDamageCalculated = true; } }