using System.Collections; using System.Collections.Generic; // MetalGreymon namespace DCGO.CardEffects.EX12 { public class EX12_016 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alternative Digivolution Condition if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.ContainsCardName("Greymon") || targetPermanent.TopCard.EqualsTraits("ME") || targetPermanent.TopCard.EqualsTraits("VB"); } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 4) ); } #endregion #region Decode if (timing == EffectTiming.WhenRemoveField) { bool SourceCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.HasLevel && cardSource.Level <= 4 && (cardSource.ContainsCardName("Agumon") || cardSource.ContainsCardName("Greymon") || cardSource.EqualsTraits("ME") || cardSource.EqualsTraits("VB")); } string[] decodeStrings = { "(Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait)", "Level 4 or lower Digimon card with [Agumon]/[Greymon] in name or [ME]/[VB] trait" }; cardEffects.Add(CardEffectFactory.DecodeSelfEffect(card: card, isInheritedEffect: false, decodeStrings: decodeStrings, sourceCondition: SourceCondition, condition: null)); } #endregion #region Shared OP/WD string SharedEffectName = "Delete 1 enemy 6K DP or lower Digimon, then taunt 1 enemy Digimon"; CardEffectFactory.ActivateClassesForSharedEffects (ref cardEffects, timing, card, SharedEffectName, SharedActivateCoroutine, SharedEffectDescription, optional: false, onPlay: true, whenDigivolving: true); string SharedEffectDescription(string tag) { return $"[{tag}] Delete 1 of your opponent's Digimon with 6000 DP or less. Then, give 1 of their Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends."; } IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass) { bool CanSelectPermanentCondition1(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && permanent.HasDP && permanent.DP <= card.Owner.MaxDP_DeleteEffect(6000, activateClass); } bool CanSelectPermanentCondition2(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card); } if(CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1)) { SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition1, 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(CanSelectPermanentCondition2)) { Permanent selectedPermanment = null; SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermanentCondition2, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: 1, canNoSelect: false, canEndNotMax: false, selectPermanentCoroutine: SelectPermanentCoroutine, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Custom, cardEffect: activateClass); IEnumerator SelectPermanentCoroutine(Permanent permanent) { selectedPermanment = permanent; yield return null; } selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to gain [Start of Your Main Phase] This Digimon attacks", "The opponent is selecting 1 Digimon to gain [Start of Your Main Phase] This Digimon attacks"); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); if (selectedPermanment != null) { yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.StartOfMainAttack( targetPermanent: selectedPermanment, cardEffect: activateClass)); } } } #endregion #region Assembly if (timing == EffectTiming.None) { AddAssemblyConditionClass addAssemblyConditionClass = new AddAssemblyConditionClass(); addAssemblyConditionClass.SetUpICardEffect("Assembly", CanUseCondition, card); addAssemblyConditionClass.SetUpAddAssemblyConditionClass(getAssemblyCondition: GetAssembly); addAssemblyConditionClass.SetNotShowUI(true); cardEffects.Add(addAssemblyConditionClass); bool CanUseCondition(Hashtable hashtable) { return true; } AssemblyCondition GetAssembly(CardSource cardSource) { if (cardSource == card) { AssemblyConditionElement element = new AssemblyConditionElement(CanSelectCardCondition); bool CanSelectCardCondition(CardSource cardSource) { return cardSource.HasLevel && cardSource.Level <= 4 && (cardSource.ContainsCardName("Agumon") || cardSource.ContainsCardName("Greymon") || cardSource.EqualsTraits("ME") || cardSource.EqualsTraits("VB")); } AssemblyCondition assemblyCondition = new AssemblyCondition( element: element, CanTargetCondition_ByPreSelecetedList: null, selectMessage: "Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait", elementCount: 1, reduceCost: 2); return assemblyCondition; } return null; } } #endregion #region Inherited if (timing == EffectTiming.WhenRemoveField) { bool SourceCondition(CardSource cardSource) { return cardSource.IsDigimon && cardSource.HasLevel && cardSource.Level <= 4 && (cardSource.ContainsCardName("Agumon") || cardSource.ContainsCardName("Greymon") || cardSource.EqualsTraits("ME") || cardSource.EqualsTraits("VB")); } string[] decodeStrings = { "(Lv.4 or lower w/[Agumon]/[Greymon] in name or w/[ME]/[VB] trait)", "Level 4 or lower Digimon card with [Agumon]/[Greymon] in name or [ME]/[VB] trait" }; cardEffects.Add(CardEffectFactory.DecodeSelfEffect(card: card, isInheritedEffect: true, decodeStrings: decodeStrings, sourceCondition: SourceCondition, condition: null)); } #endregion return cardEffects; } } }