| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.EX2
- {
- public class EX2_039 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.OnDiscardLibrary)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash up to 3 cards from deck top", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "When this card is trashed from your deck, if it wasn't trashed by [EX2-039 Impmon]'s effect, you may trash up to 3 cards from the top of your deck.";
- }
- bool CardEffectCondition(ICardEffect cardEffect)
- {
- if (cardEffect != null)
- {
- if (cardEffect.EffectSourceCard != null)
- {
- if (cardEffect.EffectSourceCard != null)
- {
- if (cardEffect.EffectSourceCard.CardID == "EX2-039")
- {
- return false;
- }
- }
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.CanTriggerWhenSelfDiscardLibrary(hashtable, card))
- {
- if (!CardEffectCommons.IsByEffect(hashtable, CardEffectCondition))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnTrash(card))
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- int maxCount = 3;
- SelectCountEffect selectCountEffect = GManager.instance.GetComponent<SelectCountEffect>();
- if (selectCountEffect != null)
- {
- selectCountEffect.SetUp(
- SelectPlayer: card.Owner,
- targetPermanent: null,
- MaxCount: maxCount,
- CanNoSelect: true,
- Message: "How many cards do you trash?",
- Message_Enemy: "The opponent is choosing how many cards to trash.",
- SelectCountCoroutine: SelectCountCoroutine);
- yield return ContinuousController.instance.StartCoroutine(selectCountEffect.Activate());
- IEnumerator SelectCountCoroutine(int count)
- {
- yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(count, card.Owner, activateClass).AddTrashCardsFromLibraryTop());
- }
- }
- }
- }
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[On Play] Reveal the top 4 cards of your deck. Add 1 Digimon card with [Beelzemon] in its name and 1 [Ai & Mako] among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- if (cardSource.ContainsCardName("Beelzemon"))
- {
- if (cardSource.IsDigimon)
- {
- return true;
- }
- }
- return false;
- }
- bool CanSelectCardCondition1(CardSource cardSource)
- {
- if (cardSource.CardNames.Contains("Ai & Mako"))
- {
- return true;
- }
- if (cardSource.CardNames.Contains("Ai&Mako"))
- {
- return true;
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 4,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 Digimon card with [Beelzemon] in its name.",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition1,
- message: "Select 1 [Ai & Mako].",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass,
- mutualConditions: true
- ));
- }
- }
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- if (card.PermanentOfThisCard().TopCard.ContainsCardName("Beelzemon"))
- {
- return true;
- }
- }
- }
- return false;
- }
- cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 3000, isInheritedEffect: true, card: card, condition: Condition));
- }
- return cardEffects;
- }
- }
- }
|