using System.Collections; using System.Collections.Generic; using System; //Blastmon namespace DCGO.CardEffects.EX10 { public class EX10_034 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Digixros if (timing == EffectTiming.None) { AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass(); addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", 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 element = new DigiXrosConditionElement(CanSelectCardCondition, "Bagra Army trait"); DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition, "Bagra Army trait"); DigiXrosConditionElement element2 = new DigiXrosConditionElement(CanSelectCardCondition, "Bagra Army trait"); bool CanSelectCardCondition(CardSource cardSource) { if (cardSource != null) { if (cardSource.Owner == card.Owner) { if (cardSource.IsDigimon) { if (cardSource.EqualsTraits("Bagra Army")) { return true; } } } } return false; } List elements = new List() { element, element1, element2 }; DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2); return digiXrosCondition; } return null; } } #endregion #region Static Effects #region Collision if (timing == EffectTiming.OnCounterTiming) { cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null)); } #endregion #region Fragment if (timing == EffectTiming.WhenPermanentWouldBeDeleted) { string EffectDiscription() { return "> (When this Digimon would be deleted, by trashing any 3 of its digivolution cards, it isn’t deleted.)"; } cardEffects.Add(CardEffectFactory.FragmentSelfEffect(isInheritedEffect: false, card: card, condition: null, trashValue: 3, effectName: "Fragment <3>", effectDiscription: EffectDiscription())); } #endregion #region Blocker if (timing == EffectTiming.None) { cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect( isInheritedEffect: false, card: card, condition: null)); } #endregion #endregion #region On Play - gain must attack if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("1 digimon gains attack on Start of your main phase", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] Until your opponent's turn ends, give 1 of their Digimon \"[Start of Your Main Phase] This Digimon attacks.\""; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleAreaDigimon(card)) { if (CardEffectCommons.CanTriggerOnPlay(hashtable, card)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } bool CanSelectPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { Permanent selectedPermanent = null; int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition)); SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } if (selectedPermanent != null) { ActivateClass activateClass1 = new ActivateClass(); activateClass1.SetUpICardEffect("[Start of Your Main Phase] This Digimon attacks.", CanUseCondition1, selectedPermanent.TopCard); activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1()); activateClass1.SetEffectSourcePermanent(selectedPermanent); selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect); if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass)) { yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent().CreateDebuffEffect(selectedPermanent)); } string EffectDiscription1() { return "[Start of Your Main Phase] This Digimon attacks."; } bool CanUseCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent)) { if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner) { return true; } } } return false; } bool CanActivateCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass)) { if (selectedPermanent.CanAttack(activateClass1)) { return true; } } } return false; } ICardEffect GetCardEffect(EffectTiming _timing) { if (_timing == EffectTiming.OnStartMainPhase) { return activateClass1; } return null; } IEnumerator ActivateCoroutine1(Hashtable _hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (selectedPermanent.CanAttack(activateClass1)) { SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent(); selectAttackEffect.SetUp( attacker: selectedPermanent, canAttackPlayerCondition: () => true, defenderCondition: (permanent) => true, cardEffect: activateClass1); selectAttackEffect.SetCanNotSelectNotAttack(); yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate()); } } } } } } } #endregion #region When Digivolving - gain must attack if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("1 digimon gains attack on Start of your main phase", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] [When Digivolving] Until your opponent's turn ends, give 1 of their Digimon \"[Start of Your Main Phase] This Digimon attacks.\""; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleAreaDigimon(card)) { if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } bool CanSelectPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { Permanent selectedPermanent = null; int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition)); SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanent = permanent; yield return null; } if (selectedPermanent != null) { ActivateClass activateClass1 = new ActivateClass(); activateClass1.SetUpICardEffect("[Start of Your Main Phase] This Digimon attacks.", CanUseCondition1, selectedPermanent.TopCard); activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1()); activateClass1.SetEffectSourcePermanent(selectedPermanent); selectedPermanent.UntilOwnerTurnEndEffects.Add(GetCardEffect); if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass)) { yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent().CreateDebuffEffect(selectedPermanent)); } string EffectDiscription1() { return "[Start of Your Main Phase] This Digimon attacks."; } bool CanUseCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (selectedPermanent.TopCard.Owner.GetBattleAreaDigimons().Contains(selectedPermanent)) { if (GManager.instance.turnStateMachine.gameContext.TurnPlayer == selectedPermanent.TopCard.Owner) { return true; } } } return false; } bool CanActivateCondition1(Hashtable hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass)) { if (selectedPermanent.CanAttack(activateClass1)) { return true; } } } return false; } ICardEffect GetCardEffect(EffectTiming _timing) { if (_timing == EffectTiming.OnStartMainPhase) { return activateClass1; } return null; } IEnumerator ActivateCoroutine1(Hashtable _hashtable1) { if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent)) { if (selectedPermanent.CanAttack(activateClass1)) { SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent(); selectAttackEffect.SetUp( attacker: selectedPermanent, canAttackPlayerCondition: () => true, defenderCondition: (permanent) => true, cardEffect: activateClass1); selectAttackEffect.SetCanNotSelectNotAttack(); yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate()); } } } } } } } #endregion #region All Turns - OPT if (timing == EffectTiming.OnAllyAttack) { List removedPermanents = new List(); ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash 2 source cards, gain and +3000 DP", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription()); activateClass.SetHashString("AT_EX10_034"); cardEffects.Add(activateClass); string EffectDiscription() { return "[All Turns] [Once Per Turn] When Digimon attack, by trashing any 2 of this Digimon's digivolution cards, this Digimon gains and +3000 DP until your turn ends."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, IsAttackingDigimon); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && card.PermanentOfThisCard().DigivolutionCards.Count >= 2; } bool IsAttackingDigimon(Permanent permanent) { return permanent.IsDigimon; } IEnumerator ActivateCoroutine(Hashtable hashtable) { Permanent thisPermanent = card.PermanentOfThisCard(); List selectedCards = new List(); #region Trash Digivolution Cards SelectCardEffect selectCardEffect = GManager.instance.GetComponent(); selectCardEffect.SetUp( canTargetCondition: _ => true, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, canNoSelect: () => false, selectCardCoroutine: SelectCardCoroutine, afterSelectCardCoroutine: null, message: "Select 2 digivolution cards to trash.", maxCount: 2, canEndNotMax: false, isShowOpponent: true, mode: SelectCardEffect.Mode.Custom, root: SelectCardEffect.Root.Custom, customRootCardList: thisPermanent.DigivolutionCards, canLookReverseCard: true, selectPlayer: card.Owner, cardEffect: activateClass); IEnumerator SelectCardCoroutine(CardSource cardSource) { selectedCards.Add(cardSource); yield return null; } selectCardEffect.SetUseFaceDown(); selectCardEffect.SetUpCustomMessage("Select 2 digivolution cards to trash.", "The opponent is selecting 2 digivolution cards to trash."); yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate()); #endregion if (selectedCards.Count == 2) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsAndProcessAccordingToResult( targetPermanent: thisPermanent, targetDigivolutionCards: selectedCards, activateClass: activateClass, successProcess: SuccessProcess, failureProcess: null)); IEnumerator SuccessProcess(List trashedSources) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack( targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilOwnerTurnEnd, activateClass: activateClass )); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP( targetPermanent: card.PermanentOfThisCard(), changeValue: 3000, effectDuration: EffectDuration.UntilOwnerTurnEnd, activateClass: activateClass )); } } } } #endregion return cardEffects; } } }