using System.Collections; using System.Collections.Generic; using System; //Consulmon namespace DCGO.CardEffects.BT23 { public class BT23_052 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Link Condition if (timing == EffectTiming.None) { static bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.HasAppmonTraits; } cardEffects.Add(CardEffectFactory.AddSelfLinkConditionStaticEffect(permanentCondition: PermanentCondition, linkCost: 2, card: card)); } #endregion #region Alternative Digivolution Condition if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.EqualsTraits("Stnd."); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null) ); } #endregion #region Link if (timing == EffectTiming.OnDeclaration) { cardEffects.Add(CardEffectFactory.LinkEffect(card)); } #endregion #region On Play if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("1 of your opponent's Digimon can't attack players", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[On Play] 1 of your opponent's Digimon can't attack players until their turn ends."; } bool CanSelectPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerOnPlay(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1) return true; } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { 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 Digimon that will get effects.", "The opponent is selecting Digimon that will get effects."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { bool DefenderCondition(Permanent defender) { return defender == null; } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack( targetPermanent: permanent, defenderCondition: DefenderCondition, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack to player")); } } } #endregion #region When Digivolving if (timing == EffectTiming.OnEnterFieldAnyone) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("1 of your opponent's Digimon can't attack players", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[When Digivolving] 1 of your opponent's Digimon can't attack players until their turn ends."; } bool CanSelectPermanentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleAreaDigimon(card)) { if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1) return true; } return false; } IEnumerator ActivateCoroutine(Hashtable hashtable) { 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 Digimon that will get effects.", "The opponent is selecting Digimon that will get effects."); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); IEnumerator SelectPermanentCoroutine(Permanent permanent) { bool DefenderCondition(Permanent defender) { return defender == null; } yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack( targetPermanent: permanent, defenderCondition: DefenderCondition, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack to player")); } } } #endregion #region When Linking if (timing == EffectTiming.WhenLinked) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Gain Reboot and Blocker", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); activateClass.SetIsLinkedEffect(true); cardEffects.Add(activateClass); string EffectDiscription() { return " [When Linking] This Digimon gains and until your opponent's turn ends."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenLinking(hashtable, null, card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker( targetPermanent: card.PermanentOfThisCard(), effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainReboot( targetPermanent: card.PermanentOfThisCard(), effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass)); } } #endregion #region Security if (timing == EffectTiming.SecuritySkill) { cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card)); } #endregion return cardEffects; } } }