Пример #1
0
 bool CheckFilterToCancel(EnemyAttackAction enemyAttack)
 {
     if (enemyAttack.IsActionCanceled)
     {
         return(true);
     }
     return(!ActivateEffect(enemyAttack));
 }
Пример #2
0
 /*****************************************************************************************/
 protected override void BeginGameAction(GameAction gameAction)
 {
     if (gameAction is EnemyAttackAction enemyAttackAction && PlayCard(enemyAttackAction))
     {
         this.enemyAttackAction = enemyAttackAction;
         enemyAttackAction.ChooseCardOptionalAction.ChosenCardEffects.Add(playFromHand = PlayFromHand);
     }
 }
Пример #3
0
 bool PlayCard(EnemyAttackAction enemyAttackAction)
 {
     if (!CheckPlayedFromHand())
     {
         return(false);
     }
     if (enemyAttackAction.Investigator.CurrentLocation != ThisCard.VisualOwner.CurrentLocation)
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
 bool ActivateEffect(EnemyAttackAction enemyAttack)
 {
     if (!ThisCard.IsInPlay)
     {
         return(false);
     }
     if (ThisCard.VisualOwner != enemyAttack.Investigator)
     {
         return(false);
     }
     if (enemyAttack.EnemyDamage < 1)
     {
         return(false);
     }
     if (ThisCard.VisualOwner.AllEnemiesInMyLocation.FindAll(c => c != enemyAttack.Enemy).Count < 1)
     {
         return(false);
     }
     return(true);
 }
Пример #5
0
        IEnumerator ExhaustAndDoDamage(EnemyAttackAction enemyAttack)
        {
            List <CardEffect> allEnemies = new List <CardEffect>();

            foreach (CardComponent enemy in ThisCard.VisualOwner.AllEnemiesInMyLocation.FindAll(c => c != enemyAttack.Enemy))
            {
                allEnemies.Add(new CardEffect(
                                   card: enemy,
                                   effect: () => DoDamage(enemy),
                                   animationEffect: ((CardEnemy)enemy.CardLogic).BadEffectForEnemyAnimation,
                                   type: EffectType.Choose,
                                   name: "Hacer daño a " + enemy.Info.Name,
                                   investigatorImageCardInfoOwner: ThisCard.VisualOwner));
            }
            yield return(new ChooseCardAction(allEnemies, cancelableCardEffect: ref cardEffect).RunNow());

            IEnumerator DoDamage(CardComponent enemy)
            {
                yield return(new DamageEnemyAction(enemy, enemyAttack.EnemyDamage).RunNow());

                enemyAttack.EnemyDamage = 0;
            }
        }