| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Agumon
- namespace DCGO.CardEffects.ST24
- {
- public class ST24_04 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.EqualsCardName("Koromon");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
- }
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.EqualsTraits("DATA SQUAD");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 2, permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
- }
- #endregion
- #region Shared WM/OP
- string SharedEffectName() => "Reveal 3, add 1 [DATA SQUAD], place 1 such under tamer face-down.";
- string SharedEffectDescription(string tag) => $"[{tag}] Reveal the top 3 cards of your deck. Among them, add 1 [DATA SQUAD] trait card to the hand and place 1 such card face down under any of your [DATA SQUAD] trait Tamers. Return the rest to the bottom of the deck.";
- bool SharedCanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && card.Owner.LibraryCards.Count >= 1;
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return cardSource.EqualsTraits("DATA SQUAD");
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaTamer(permanent, card)
- && permanent.TopCard.EqualsTraits("DATA SQUAD");
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- int tamerCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, CanSelectPermanentCondition));
- CardSource tuckedCard = null;
- if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition))
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 card with [DATA SQUAD] trait to add to hand.",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 card with [DATA SQUAD] trait to place under a [DATA SQUAD] tamer.",
- mode: SelectCardEffect.Mode.Custom,
- maxCount: 1,
- selectCardCoroutine: PlaceUnderTamer),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass));
- }
- else
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 card with [DATA SQUAD] trait to add to hand.",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass));
- }
- IEnumerator PlaceUnderTamer(CardSource source)
- {
- tuckedCard = source;
- yield return null;
- }
- if (tuckedCard != null)
- {
- if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectTamerCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer that will add card to sources.", "The opponent is selecting 1 Tamer that will add card to sources.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectTamerCoroutine(Permanent permanent)
- {
- Permanent selectedPermanent = permanent;
- if (selectedPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddDigivolutionCardsBottom(new List<CardSource>() { tuckedCard }, activateClass, isFacedown: true));
- }
- }
- }
- }
- }
- #endregion
- #region When Moving
- if (timing == EffectTiming.OnMove)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
- activateClass.SetUpActivateClass(SharedCanActivateCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, SharedEffectDescription("When Moving"));
- cardEffects.Add(activateClass);
- bool PermanentCondition(Permanent permanent)
- {
- return permanent == card.PermanentOfThisCard();
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.CanTriggerOnMove(hashtable, PermanentCondition);
- }
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(SharedEffectName(), CanUseCondition, card);
- activateClass.SetUpActivateClass(SharedCanActivateCondition, (hashTable) => SharedActivateCoroutine(hashTable, activateClass), -1, false, SharedEffectDescription("On Play"));
- cardEffects.Add(activateClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- }
- #endregion
- #region Inherit
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return CardEffectCommons.IsOwnerTurn(card);
- }
- cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
- changeValue: 2000,
- isInheritedEffect: true,
- card: card,
- condition: Condition));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|