using System; using System.Collections; using System.Collections.Generic; // Impmon namespace DCGO.CardEffects.EX10 { public class EX10_037 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region When trashed from deck if (timing == EffectTiming.OnDiscardLibrary) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Delete 1 level 4 or lower digimon", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); activateClass.SetIsDigimonEffect(true); cardEffects.Add(activateClass); string EffectDiscription() { return "When this card is trashed from the top of the deck, you may delete 1 of your opponent's level 4 or lower Digimon."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.CanTriggerWhenSelfDiscardLibrary(hashtable, card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnTrash(card) && CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermamentCondition); } bool CanSelectPermamentCondition(Permanent permanent) { return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && permanent.TopCard.HasLevel && permanent.TopCard.Level <= 4; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectPermamentCondition)) { #region Destroy Enemy Digimon SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent(); int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, CanSelectPermamentCondition)); selectPermanentEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectPermamentCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: maxCount, canNoSelect: true, canEndNotMax: false, selectPermanentCoroutine: null, afterSelectPermanentCoroutine: null, mode: SelectPermanentEffect.Mode.Destroy, cardEffect: activateClass); selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to destroy", "The opponent is selecting 1 Digimon to destroy"); yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate()); #endregion } } } #endregion #region Start of Your Main Phase if (timing == EffectTiming.OnStartMainPhase) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash top 2 deck cards", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Start of Your Main Phase] Trash the top 2 cards of your deck."; } bool CanUseCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card); } bool CanActivateCondition(Hashtable hashtable) { return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.IsOwnerTurn(card); } IEnumerator ActivateCoroutine(Hashtable hashtable) { yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(2, card.Owner, activateClass).AddTrashCardsFromLibraryTop()); } } #endregion #region ESS if (timing == EffectTiming.None) { bool Condition() { return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card); } int GetDPChangeValue() { int stacksOf10 = card.Owner.TrashCards.Count / 10; return stacksOf10 * 1000; } cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: GetDPChangeValue(), isInheritedEffect: true, card: card, condition: Condition)); } #endregion return cardEffects; } } }