Example #1
0
 bool CheckFilterToCancel(EnemyAttackAction enemyAttack)
 {
     if (enemyAttack.IsActionCanceled)
     {
         return(true);
     }
     return(!ActivateEffect(enemyAttack));
 }
Example #2
0
 /*****************************************************************************************/
 protected override void BeginGameAction(GameAction gameAction)
 {
     if (gameAction is EnemyAttackAction enemyAttackAction && PlayCard(enemyAttackAction))
     {
         this.enemyAttackAction = enemyAttackAction;
         enemyAttackAction.ChooseCardOptionalAction.ChosenCardEffects.Add(playFromHand = PlayFromHand);
     }
 }
Example #3
0
 bool PlayCard(EnemyAttackAction enemyAttackAction)
 {
     if (!CheckPlayedFromHand())
     {
         return(false);
     }
     if (enemyAttackAction.Investigator.CurrentLocation != ThisCard.VisualOwner.CurrentLocation)
     {
         return(false);
     }
     return(true);
 }
Example #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);
 }
Example #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;
            }
        }