public void OnAttack(IAttacker attacker, ITargetable defender) { AttackBattleAction action = attacker.Attack(defender); AttackBattleAction counterAction = null; if ((action.Type & AttackBattleAction.DamageType.CanBeCounter) != 0) { ITargetable a = attacker as ITargetable; if (a != null) { counterAction = defender.Counter(a); } } action.Execute(); if (counterAction != null) { counterAction.Execute(); } attacker.DeathCheck(); defender.DeathCheck(); }
protected void Apply(ITargetable target) { target.ApplyDamage(Damage, AttackBattleAction.DamageType.Ability); target.DeathCheck(); }