| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects.BT11
- {
- public class BT11_061 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.OnDeclaration)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Main] By suspending this Digimon, reveal the top 3 cards of your deck. Add 1 [Snatchmon], [Destromon], [Galacticmon], or [Fusionize] among them to your hand, and place 1 [Vemmon] among them under this Digimon as its bottom digivolution card. Place the rest at the bottom of your deck in any order.";
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- if (cardSource.CardNames.Contains("Snatchmon"))
- {
- return true;
- }
- if (cardSource.CardNames.Contains("Destromon"))
- {
- return true;
- }
- if (cardSource.CardNames.Contains("Galacticmon"))
- {
- return true;
- }
- if (cardSource.CardNames.Contains("Fusionize"))
- {
- return true;
- }
- return false;
- }
- bool CanSelectCardCondition1(CardSource cardSource)
- {
- if (cardSource.CardNames.Contains("Vemmon"))
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.CanActivateSuspendCostEffect(card))
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 [Snatchmon], [Destromon], [Galacticmon], or [Fusionize].",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition1,
- message: "Select 1 [Vemmon].",
- mode: SelectCardEffect.Mode.Custom,
- maxCount: 1,
- selectCardCoroutine: SelectCardCoroutine),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass
- ));
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { cardSource }, activateClass));
- }
- }
- }
- }
- ActivateClass activateClass2 = new ActivateClass();
- activateClass2.SetUpICardEffect("Digivolution Cost -1", CanUseCondition2, card);
- activateClass2.SetUpActivateClass(CanActivateCondition2, ActivateCoroutine2, 1, false, EffectDiscription2());
- activateClass2.SetIsInheritedEffect(true);
- activateClass2.SetNotShowUI(true);
- activateClass2.SetIsBackgroundProcess(true);
- activateClass2.SetHashString("DigivolutionCost-1_BT11_061");
- string EffectDiscription2()
- {
- return "";
- }
- bool CanUseCondition2(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
- {
- List<CardSource> evoRootTops = CardEffectCommons.GetEvoRootTopsFromEnterFieldHashtable(
- hashtable,
- permanent => permanent.cardSources.Contains(card));
- if (evoRootTops != null)
- {
- if (!evoRootTops.Contains(card))
- {
- if (card.PermanentOfThisCard().TopCard.CardNames.Contains("Destromon"))
- {
- return true;
- }
- if (card.PermanentOfThisCard().TopCard.CardNames.Contains("Galacticmon"))
- {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
- bool CanActivateCondition2(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card);
- }
- IEnumerator ActivateCoroutine2(Hashtable _hashtable)
- {
- yield return null;
- }
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- cardEffects.Add(activateClass2);
- }
- if (timing == EffectTiming.None)
- {
- ChangeCostClass changeCostClass = new ChangeCostClass();
- changeCostClass.SetUpICardEffect($"Digivolution Cost -1", CanUseCondition, card);
- changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
- changeCostClass.SetIsInheritedEffect(true);
- cardEffects.Add(changeCostClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- if (!card.cEntity_EffectController.isOverMaxCountPerTurn(activateClass2, activateClass2.MaxCountPerTurn))
- {
- return true;
- }
- }
- }
- return false;
- }
- int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
- {
- if (CardSourceCondition(cardSource))
- {
- if (RootCondition(root))
- {
- if (PermanentsCondition(targetPermanents))
- {
- Cost -= 1;
- }
- }
- }
- return Cost;
- }
- bool PermanentsCondition(List<Permanent> targetPermanents)
- {
- if (targetPermanents != null)
- {
- if (targetPermanents.Count(PermanentCondition) >= 1)
- {
- return true;
- }
- }
- return false;
- }
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent == card.PermanentOfThisCard();
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- if (cardSource.CardNames.Contains("Destromon"))
- {
- return true;
- }
- if (cardSource.CardNames.Contains("Galacticmon"))
- {
- return true;
- }
- return false;
- }
- bool RootCondition(SelectCardEffect.Root root)
- {
- return true;
- }
- bool isUpDown()
- {
- return true;
- }
- }
- return cardEffects;
- }
- }
- }
|