예제 #1
0
        public void AutoAttack(IHero targetHero)
        {
            Contract.Assert(targetHero != null, "targetHero!=null");
            Contract.Assert(CanAttack, "CanAttack");

            foreach (var effect in PreFightEffectByType)
            {
                effect.Value.Activate();
            }

            foreach (var ability in OnAttackAbilities)
            {
                ability.Apply(targetHero);
            }

            NextAutoAttackTimeInSeconds += AutoAttackInterval;

            targetHero.ApplyDamage(AutoAttackDamage);
        }