using System; using System.Collections; using System.Collections.Generic; namespace DCGO.CardEffects.BT12 { public class BT12_095 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); if (timing == EffectTiming.OnStartMainPhase) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Your 1 Digimon with [Agumon] or [Greymon] in its name gets DP +1000 and Blocker", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Start of Your Main Phase] 1 of your Digimon with [Agumon] or [Greymon] in its name gets +1000 DP and until the end of your opponent's turn."; } bool CanSelectPermanentCondition(Permanent permanent) { if (permanent != null) { if (permanent.TopCard != null) { if (permanent.IsDigimon) { if (permanent.TopCard.Owner == card.Owner) { if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent)) { if (permanent.TopCard.ContainsCardName("Agumon")) { return true; } if (permanent.TopCard.HasGreymonName) { return true; } } } } } } return false; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (isExistOnField(card)) { if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard())) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { return true; } } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (isExistOnField(card)) { if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard())) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { 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 DP +1000 and Blocker.", "The opponent is selecting 1 Digimon that will get DP +1000 and Blocker."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); } } } } } } if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Your 1 Digimon with [Agumon] or [Greymon] in its name gets DP +1000 and Blocker", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] 1 of your Digimon with [Agumon] or [Greymon] in its name gets +1000 DP and until the end of your opponent's turn."; } bool CanSelectPermanentCondition(Permanent permanent) { if (permanent != null) { if (permanent.TopCard != null) { if (permanent.IsDigimon) { if (permanent.TopCard.Owner == card.Owner) { if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent)) { if (permanent.TopCard.ContainsCardName("Agumon")) { return true; } if (permanent.TopCard.HasGreymonName) { return true; } } } } } } return false; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (isExistOnField(card)) { if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard())) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { return true; } } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (isExistOnField(card)) { if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard())) { if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) { 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 DP +1000 and Blocker.", "The opponent is selecting 1 Digimon that will get DP +1000 and Blocker."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); } } } } } } if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Your Turn] If one of your Digimon digivolves into a Digimon with [Greymon] or [Omnimon] in its name, by suspending this Tamer, gain 1 memory."; } bool PermanentCondition(Permanent permanent) { if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)) { if (permanent.TopCard.HasGreymonName) { return true; } if (permanent.TopCard.ContainsCardName("Omnimon")) { return true; } } return false; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition)) { return true; } } } return false; } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.CanActivateSuspendCostEffect(card); } IEnumerator ActivateCoroutine(Hashtable _hashtable) { yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap()); yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); } } if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card)); } return cardEffects; } } }