using System.Collections; using System.Collections.Generic; using System.Linq; namespace DCGO.CardEffects.BT19 { public class BT19_014 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alliance if (timing == EffectTiming.OnAllyAttack) { cardEffects.Add(CardEffectFactory.AllianceSelfEffect( isInheritedEffect: false, card: card, condition: null)); } #endregion #region Reboot if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect( isInheritedEffect: false, card: card, condition: null)); } #endregion #region Material Save if (timing == EffectTiming.WhenPermanentWouldBeDeleted) { cardEffects.Add(CardEffectFactory.MaterialSaveEffect(card: card, materialSaveCount: 4)); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect( "All of your opponent's Digimon get -DP for the turn then, play 1 [ShootingStarmon] from under your Tamers", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[On Play] For each color in this Digimon's digivolution cards, all of your opponent's Digimon get -1000 DP for the turn. Then, you may play 1 [ShootingStarmon] from under your Tamers without paying the cost."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool OpponentPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool PlayCardCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.EqualsCardName("ShootingStarmon") && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass, SelectCardEffect.Root.DigivolutionCards); } bool TamerHasDigimonCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.IsTamer && permanent.DigivolutionCards.Count(PlayCardCondition) >= 1; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDPPlayerEffect( permanentCondition: OpponentPermanentCondition, changeValue: -1000 * card.PermanentOfThisCard().DigivolutionCardsColors.Count, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass)); if (CardEffectCommons.HasMatchConditionPermanent(TamerHasDigimonCondition)) { Permanent selectedPermanent = null; SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: TamerHasDigimonCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select a Tamer.", "The opponent is selecting a Tamer."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } if (selectedPermanent != null) { List selectedCards = new List(); SelectCardEffect selectCardEffect = GManager.instance.GetComponent(); selectCardEffect.SetUp( canTargetCondition: PlayCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: () => true, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, message: "Select 1 digivolution card to play.", maxCount: 1, canEndNotMax: false, isShowOpponent: true, mode: SelectCardEffect.Mode.Custom, root: SelectCardEffect.Root.Custom, customRootCardList: selectedPermanent.DigivolutionCards, canLookReverseCard: true, selectPlayer: card.Owner, cardEffect: activateClass); selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.", "The opponent is selecting 1 digivolution card to play."); selectCardEffect.SetUpCustomMessage_ShowCard("Played Card"); yield return StartCoroutine(selectCardEffect.Activate()); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards( cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.DigivolutionCards, activateETB: true)); } } } } #endregion #region When Attacking if (timing == EffectTiming.OnAllyAttack) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Delete 1 Digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription()); cardEffects.Add(activateClass); string EffectDescription() { return "[When Attacking] Delete 1 of your opponent's Digimon with as much or less DP than this Digimon."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnAttack(hashtable, card); } bool IsEnemyPermanentWithAsMuchOrLessDpSharedCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && permanent.DP <= card.PermanentOfThisCard().DP; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(IsEnemyPermanentWithAsMuchOrLessDpSharedCondition)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: IsEnemyPermanentWithAsMuchOrLessDpSharedCondition, 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 #region DigiXros if (timing == EffectTiming.None) { AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass(); addDigiXrosConditionClass.SetUpICardEffect($"DigiXros -2", CanUseCondition, card); addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros); addDigiXrosConditionClass.SetNotShowUI(true); cardEffects.Add(addDigiXrosConditionClass); bool CanUseCondition(Hashtable hashtable) { return true; } DigiXrosCondition GetDigiXros(CardSource cardSource) { if (cardSource == card) { DigiXrosConditionElement elementA = new DigiXrosConditionElement(CanSelectCardConditionA, "OmniShoutmon"); bool CanSelectCardConditionA(CardSource conditionCardSource) { if (conditionCardSource) { if (conditionCardSource.Owner == card.Owner) { if (conditionCardSource.IsDigimon) { if (conditionCardSource.CardNames_DigiXros.Contains("OmniShoutmon")) { return true; } } } } return false; } DigiXrosConditionElement elementB = new DigiXrosConditionElement(CanSelectCardConditionB, "ZeigGreymon"); bool CanSelectCardConditionB(CardSource conditionCardSource) { if (conditionCardSource) { if (conditionCardSource.Owner == card.Owner) { if (conditionCardSource.IsDigimon) { if (conditionCardSource.CardNames_DigiXros.Contains("ZeigGreymon")) { return true; } } } } return false; } DigiXrosConditionElement elementC = new DigiXrosConditionElement(CanSelectCardConditionC, "AtlurBallistamon"); bool CanSelectCardConditionC(CardSource conditionCardSource) { if (conditionCardSource) { if (conditionCardSource.Owner == card.Owner) { if (conditionCardSource.IsDigimon) { if (conditionCardSource.CardNames_DigiXros.Contains("AtlurBallistamon")) { return true; } } } } return false; } DigiXrosConditionElement elementD = new DigiXrosConditionElement(CanSelectCardConditionD, "JaegerDorulumon"); bool CanSelectCardConditionD(CardSource conditionCardSource) { if (conditionCardSource) { if (conditionCardSource.Owner == card.Owner) { if (conditionCardSource.IsDigimon) { if (conditionCardSource.CardNames_DigiXros.Contains("JaegerDorulumon")) { return true; } } } } return false; } DigiXrosConditionElement elementE = new DigiXrosConditionElement(CanSelectCardConditionE, "RaptorSparrowmon"); bool CanSelectCardConditionE(CardSource conditionCardSource) { if (conditionCardSource) { if (conditionCardSource.Owner == card.Owner) { if (conditionCardSource.IsDigimon) { if (conditionCardSource.CardNames_DigiXros.Contains("RaptorSparrowmon")) { return true; } } } } return false; } List elements = new List() { elementA, elementB, elementC, elementD, elementE }; DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2); return digiXrosCondition; } return null; } } #endregion return cardEffects; } } }