using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT11 { public class BT11_028 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("This Digimon gains Blocker and it gets DP+", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] Until the end of your opponent's turn, this Digimon gains (When an opponent's Digimon attacks, you may suspend this Digimon to force the opponent to attack it instead) and gets +2000 DP for every 4 cards in your opponent's hand."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker( targetPermanent: card.PermanentOfThisCard(), effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); int plusDP = 2000 * (card.Owner.Enemy.HandCards.Count / 4); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP( targetPermanent: card.PermanentOfThisCard(), changeValue: plusDP, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); } } if (timing == EffectTiming.OnAddHand) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription()); activateClass.SetIsInheritedEffect(true); activateClass.SetHashString("Unsuspend_BT11_028"); cardEffects.Add(activateClass); string EffectDiscription() { return "[All Turns][Once Per Turn] When an effect adds cards to your opponent's hand, unsuspend this Digimon."; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.CanTriggerWhenAddHand(hashtable, player => player == card.Owner.Enemy, cardEffect => cardEffect != null)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { return true; } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { Permanent selectedPermanent = card.PermanentOfThisCard(); yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents( new List() { selectedPermanent }, activateClass).Unsuspend()); } } return cardEffects; } } }