| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.BT20
- {
- public class BT20_089 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Rule: Name Change
- if (timing == EffectTiming.None)
- {
- ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
- changeCardNamesClass.SetUpICardEffect("Also treated as [Eiji Nagasumi]/[Leon Alexander]", CanUseCondition, card);
- changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
- cardEffects.Add(changeCardNamesClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
- {
- if (cardSource == card)
- {
- CardNames.Add("Eiji Nagasumi");
- CardNames.Add("Leon Alexander");
- }
- return CardNames;
- }
- }
- #endregion
- #region Start of Your Turn
- if (timing == EffectTiming.OnStartMainPhase)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Start of Your Main Phase] If your opponent has a Digimon, gain 1 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1)
- {
- if (card.Owner.CanAddMemory(activateClass))
- {
- return true;
- }
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Mind Link", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] When any of your Digimon are played or digivolve, you may <Mind Link> with 1 of your Digimon with [Pulsemon] in text or the [SoC] or [SEEKERS] trait.";
- }
- bool MyPlayedDigimonCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool IsMyProperDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
- (permanent.TopCard.HasText("Pulsemon") ||
- (permanent.TopCard.HasSocTraits || permanent.TopCard.HasSeekersTraits));
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- if (isExistOnField(card))
- {
- if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, MyPlayedDigimonCondition))
- return true;
- if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, MyPlayedDigimonCondition))
- return true;
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return isExistOnField(card) &&
- CardEffectCommons.HasMatchConditionPermanent(IsMyProperDigimon);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(
- new MindLinkClass(
- tamer: card.PermanentOfThisCard(),
- digimonCondition: IsMyProperDigimon,
- activateClass: activateClass
- ).MindLink()
- );
- }
- }
- #endregion
- #region All Turns - ESS
- bool ESSDigimonCondition()
- {
- Permanent permanent = card.PermanentOfThisCard();
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
- (permanent.TopCard.HasText("Pulsemon") ||
- (permanent.TopCard.HasSocTraits || permanent.TopCard.HasSeekersTraits));
- }
- if (timing == EffectTiming.OnAllyAttack)
- {
- cardEffects.Add(CardEffectFactory.AllianceSelfEffect(isInheritedEffect: true, card: card, condition: ESSDigimonCondition));
- }
- if (timing == EffectTiming.OnDetermineDoSecurityCheck)
- {
- cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: true, card: card, condition: ESSDigimonCondition));
- }
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: ESSDigimonCondition));
- }
- #endregion
- #region End of All Turns
- if (timing == EffectTiming.OnEndTurn)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Play 1 [Eiji Nagasumi] from this Digimon's digivolution cards", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
- activateClass.SetIsInheritedEffect(true);
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[End of All Turns] You may play 1 [Eiji Nagasumi] from this Digimon's digivolution cards without paying the cost.";
- }
- bool IsEijiCardCondition(CardSource cardSource)
- {
- return CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass) &&
- cardSource.EqualsCardName("Eiji Nagasumi");
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card) &&
- card.PermanentOfThisCard().DigivolutionCards.Some(IsEijiCardCondition);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- Permanent selectedPermanent = card.PermanentOfThisCard();
- if (selectedPermanent != null)
- {
- if (selectedPermanent.DigivolutionCards.Some(IsEijiCardCondition))
- {
- int maxCount = 1;
- List<CardSource> selectedCards = new List<CardSource>();
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: IsEijiCardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 digivolution card to play.",
- maxCount: maxCount,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Custom,
- customRootCardList: selectedPermanent.DigivolutionCards,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage("Select 1 digivolution card to play.",
- "The opponent is selecting 1 digivolution card to play.");
- selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
- yield return StartCoroutine(selectCardEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCards.Add(cardSource);
- yield return null;
- }
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
- cardSources: selectedCards,
- activateClass: activateClass,
- payCost: false,
- isTapped: false,
- root: SelectCardEffect.Root.DigivolutionCards,
- activateETB: true));
- }
- }
- }
- }
- }
- #endregion
- #region Security Effect
- if (timing == EffectTiming.SecuritySkill)
- {
- cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|