using System; using System.Collections; using System.Collections.Generic; // Keisuke Amasawa namespace DCGO.CardEffects.BT23 { public class BT23_090 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Start Of Your Turn if (timing == EffectTiming.OnStartTurn) { cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card)); } #endregion #region All Turns if (timing == EffectTiming.None) { string EffectDiscription() { return "[All Turns] All of your [Hudie] Digimon get +1000 DP."; } bool Condition() { return CardEffectCommons.IsExistOnBattleArea(card); } bool PermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.TopCard.HasHudieTraits; } cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect( permanentCondition: PermanentCondition, changeValue: 1000, isInheritedEffect: false, card: card, condition: Condition, effectName: EffectDiscription)); } #endregion #region End Of Your Turn if (timing == EffectTiming.OnEndTurn) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("By suspending this tamer & bouncing 1 [Hudie] digimon to hand, play 1 [CS] tamer in hand", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[End of Your Turn] By suspending this Tamer and returning 1 of your Digimon with the [Hudie] trait to the hand, you may play 1 Tamer card with the [CS] trait from your hand without paying the cost."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.CanActivateSuspendCostEffect(card) && CardEffectCommons.HasMatchConditionPermanent(PermanentCondition); } bool PermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && permanent.TopCard.EqualsTraits("Hudie"); } bool CardCondition(CardSource cardSource) { return cardSource.IsTamer && cardSource.HasCSTraits && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass( permanents: new List() { card.PermanentOfThisCard() }, hashtable: hashtable).Tap() ); if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition)) { Permanent selectedPermanent = null; SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition)); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: PermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to bounce to hand.", "The opponent is selecting 1 Digimon to bounce to hand."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); if (selectedPermanent != null) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BouncePeremanentAndProcessAccordingToResult( targetPermanents: new List() { selectedPermanent }, activateClass: activateClass, successProcess: SuccessProcess(), failureProcess: null) ); IEnumerator SuccessProcess() { if (CardEffectCommons.HasMatchConditionOwnersHand(card, CardCondition)) { CardSource selectedHandCard = null; SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CardCondition)); selectHandEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: true, canEndNotMax: false, isShowOpponent: true, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, mode: SelectHandEffect.Mode.Custom, cardEffect: activateClass); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedHandCard = cardSource; yield return null; } selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play."); selectHandEffect.SetUpCustomMessage_ShowCard("Played Card"); yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate()); if (selectedHandCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards( cardSources: new List() { selectedHandCard }, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true) ); } } } } } } #endregion #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } #endregion return cardEffects; } } }