コード例 #1
0
    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();
    }