using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT17 { public class BT17_006 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Your Turn - ESS if (timing == EffectTiming.OnAddDigivolutionCards) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Digivolve into SoC trash card", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription()); activateClass.SetIsInheritedEffect(true); activateClass.SetHashString("DigivolveTrash_BT17_006"); cardEffects.Add(activateClass); string EffectDescription() { return "[Your Turn] (Once Per Turn) When an effect places a Tamer card in this Digimon's digivolution cards, this Digimon may digivolve into a Digimon card with the [SoC] trait in your trash."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.CanTriggerOnAddDigivolutionCard( hashtable: hashtable, permanentCondition: permanent => permanent == card.PermanentOfThisCard(), cardEffectCondition: cardEffect => cardEffect.EffectSourceCard != null, cardCondition: cardSource => cardSource.IsTamer) && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectSoCCardCondition); } bool CanSelectSoCCardCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.ContainsTraits("SoC") && cardSource.CanPlayCardTargetFrame(card.PermanentOfThisCard().PermanentFrame, true, activateClass); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard( targetPermanent: card.PermanentOfThisCard(), cardCondition: CanSelectSoCCardCondition, payCost: true, reduceCostTuple: null, fixedCostTuple: null, ignoreDigivolutionRequirementFixedCost: -1, isHand: false, activateClass: activateClass, successProcess: null)); } } #endregion return cardEffects; } } }