| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects.BT18
- {
- public class BT18_060 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand, and place 1 [Vemmon] among them as the bottom digivolution card of 1 of your Digimon. Return the rest to the bottom of the deck.";
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- if (cardSource.HasText("Vemmon"))
- {
- return true;
- }
- return false;
- }
- bool CanSelectCardCondition1(CardSource cardSource)
- {
- if (cardSource.CardNames.Contains("Vemmon"))
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanSelectOwnerDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.CanTriggerOnPlay(hashtable, card))
- {
- return true;
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- CardSource tuckedCard = null;
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 card with [Vemmon] in its text.",
- 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(cardSource != null)
- {
- tuckedCard = cardSource;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectOwnerDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectOwnerDigimon,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- IEnumerator SelectOwnerDigimon(Permanent permanent)
- {
- if(permanent != null)
- yield return ContinuousController.instance.StartCoroutine(permanent.AddDigivolutionCardsBottom(new List<CardSource>() { tuckedCard }, activateClass));
- }
- }
- }
- #endregion
- #region Your Turn - ESS
- 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.IsExistOnBattleAreaDigimon(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.HasText("Vemmon"))
- {
- 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.HasText("Vemmon"))
- {
- return true;
- }
- return false;
- }
- bool RootCondition(SelectCardEffect.Root root)
- {
- return true;
- }
- bool isUpDown()
- {
- return true;
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|