예제 #1
0
        /// <summary>
        /// 攻击一个目标
        /// </summary>
        /// <param name="target">攻击目标</param>
        /// <param name="damage">攻击伤害</param>
        public void Attack(CardHolder target, int damage)
        {
            PreAttackEvent?.Invoke();

            if (AttackDamageChangeEvent != null)
            {
                damage = AttackDamageChangeEvent(damage);
            }

            target.TakeAttack(this, damage);

            AfterAttackEvent?.Invoke();
        }
예제 #2
0
 // Calls PreAttack, Attack, and PostAttack events so they go in order
 public void AttackOrder(AttackEventArgs attackEventArgs)
 {
     PreAttackEvent?.Invoke(attackEventArgs);
     AttackEvent?.Invoke(attackEventArgs);
     PostAttackEvent?.Invoke(attackEventArgs);
 }