using System.Collections; using System.Collections.Generic; using System; //Examon namespace DCGO.CardEffects.BT23 { public class BT23_047 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alternate Digivolution if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.IsLevel6 && targetPermanent.TopCard.HasCSTraits; } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 5, ignoreDigivolutionRequirement: false, card: card, condition: null)); } #endregion #region DNA Digivolution - Green Lv.6 + Blue Lv.6: Cost 0 if (timing == EffectTiming.None) { AddJogressConditionClass addJogressConditionClass = new AddJogressConditionClass(); addJogressConditionClass.SetUpICardEffect($"DNA Digivolution", CanUseCondition, card); addJogressConditionClass.SetUpAddJogressConditionClass(getJogressCondition: GetJogress); addJogressConditionClass.SetNotShowUI(true); cardEffects.Add(addJogressConditionClass); bool CanUseCondition(Hashtable hashtable) { return true; } JogressCondition GetJogress(CardSource cardSource) { if (cardSource == card) { bool PermanentCondition1(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)) { if (permanent.TopCard.CardColors.Contains(CardColor.Green)) { if (permanent.Levels_ForJogress(card).Contains(6)) { return true; } } } return false; } bool PermanentCondition2(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)) { if (permanent.TopCard.CardColors.Contains(CardColor.Blue)) { if (permanent.Levels_ForJogress(card).Contains(6)) { return true; } } } return false; } JogressConditionElement[] elements = new JogressConditionElement[] { new JogressConditionElement(PermanentCondition1, "a level 6 green Digimon"), new JogressConditionElement(PermanentCondition2, "a level 6 blue Digimon"), }; JogressCondition jogressCondition = new JogressCondition(elements, 0); return jogressCondition; } return null; } } #endregion #region Static Effects #region Piercing if (timing == EffectTiming.OnDetermineDoSecurityCheck) { cardEffects.Add(CardEffectFactory.PierceSelfEffect( isInheritedEffect: false, card: card, condition: null)); } #endregion #region Security Atk +1 if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null)); } #endregion #region Partition List partitionConditions = new List(); partitionConditions.Add(new PartitionCondition(5, CardColor.Green)); partitionConditions.Add(new PartitionCondition(5, CardColor.Blue)); if (timing == EffectTiming.WhenRemoveField) { cardEffects.Add(CardEffectFactory.PartitionSelfEffect( isInheritedEffect: false, card: card, condition: null, cardSourceConditions: partitionConditions) ); } #endregion #endregion #region OP/WD Shared string SharedEffectDiscription(string tag) { return $"[{tag}] Suspend 5 of your opponent's Digimon or Tamers. None of your opponent's Digimon can unsuspend in their next unsuspend phase. Then, this Digimon may attack."; } bool SharedCanSelectOpponentsDigimon(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool SharedCanSelectOpponentsDigimonOrTamer(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) && (permanent.IsDigimon || permanent.IsTamer); } bool SharedCanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass) { if (CardEffectCommons.HasMatchConditionPermanent(SharedCanSelectOpponentsDigimonOrTamer)) { int maxCount = Math.Min(5, CardEffectCommons.MatchConditionPermanentCount(SharedCanSelectOpponentsDigimonOrTamer)); SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: SharedCanSelectOpponentsDigimonOrTamer, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Tap, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage($"Select {maxCount} Digimon/Tamer to suspend.", $"The opponent is selecting {maxCount} Digimon/Tamer to suspend."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect( permanentCondition: SharedCanSelectOpponentsDigimon, effectDuration: EffectDuration.UntilOwnerActivePhase, activateClass: activateClass, isOnlyActivePhase: true, effectName: "Your Digimon can't unsuspend")); if (card.PermanentOfThisCard().CanAttack(activateClass)) { SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent(); selectAttackEffect.SetUp( attacker: card.PermanentOfThisCard(), canAttackPlayerCondition: () => true, defenderCondition: (permanent) => true, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate()); } } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Suspend 5 digimon/tamer, none can unsuspend. Then you may attack", CanUseCondition, card); activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, SharedEffectDiscription("On Play")); cardEffects.Add(activateClass); bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.CanTriggerOnPlay(hashtable, card); } } #endregion #region When Digivolving if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Suspend 5 digimon/tamer, none can unsuspend. Then you may attack", CanUseCondition, card); activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, false, SharedEffectDiscription("When Digivolving")); cardEffects.Add(activateClass); bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } } #endregion #region Your Turn - OPT if (timing == EffectTiming.OnLoseSecurity) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash 1 option card, then delete 1 suspended digimon/tamer", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription()); activateClass.SetHashString("YT_BT23_047"); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn] [Once Per Turn] When your opponent's security stack is removed from, trash 1 of their Option cards in the battle area. Then, delete 1 of their suspended Digimon or Tamers."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.IsOwnerTurn(card) && CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner.Enemy); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } bool CanSelectTrashPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) && permanent.IsOption; } bool CanSelectDeletionPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) && permanent.IsSuspended && (permanent.IsDigimon || permanent.IsTamer); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTrashPermanentCondition)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectTrashPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Destroy, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); } if (CardEffectCommons.HasMatchConditionPermanent(CanSelectDeletionPermanentCondition)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectDeletionPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Destroy, cardEffect: activateClass); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); } } } #endregion return cardEffects; } } }