| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Keisuke Amasawa
- namespace DCGO.CardEffects.BT23
- {
- public class BT23_090 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Start Of Your Turn
- if (timing == EffectTiming.OnStartTurn)
- {
- cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.None)
- {
- string EffectDiscription()
- {
- return "[All Turns] All of your [Hudie] Digimon get +1000 DP.";
- }
- bool Condition()
- {
- return CardEffectCommons.IsExistOnBattleArea(card);
- }
- bool PermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
- permanent.TopCard.HasHudieTraits;
- }
- cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
- permanentCondition: PermanentCondition,
- changeValue: 1000,
- isInheritedEffect: false,
- card: card,
- condition: Condition,
- effectName: EffectDiscription));
- }
- #endregion
- #region End Of Your Turn
- if (timing == EffectTiming.OnEndTurn)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("By suspending this tamer & bouncing 1 [Hudie] digimon to hand, play 1 [CS] tamer in hand", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[End of Your Turn] By suspending this Tamer and returning 1 of your Digimon with the [Hudie] trait to the hand, you may play 1 Tamer card with the [CS] trait from your hand without paying the cost.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.IsOwnerTurn(card)
- && CardEffectCommons.CanActivateSuspendCostEffect(card) &&
- CardEffectCommons.HasMatchConditionPermanent(PermanentCondition);
- }
- bool PermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && permanent.TopCard.EqualsTraits("Hudie");
- }
- bool CardCondition(CardSource cardSource)
- {
- return cardSource.IsTamer
- && cardSource.HasCSTraits
- && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
- permanents: new List<Permanent>() { card.PermanentOfThisCard() },
- hashtable: hashtable).Tap()
- );
- if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: PermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to bounce to hand.", "The opponent is selecting 1 Digimon to bounce to hand.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- if (selectedPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BouncePeremanentAndProcessAccordingToResult(
- targetPermanents: new List<Permanent>() { selectedPermanent },
- activateClass: activateClass,
- successProcess: SuccessProcess(),
- failureProcess: null)
- );
- IEnumerator SuccessProcess()
- {
- if (CardEffectCommons.HasMatchConditionOwnersHand(card, CardCondition))
- {
- CardSource selectedHandCard = null;
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CardCondition));
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedHandCard = cardSource;
- yield return null;
- }
- selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
- selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- if (selectedHandCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
- cardSources: new List<CardSource>() { selectedHandCard },
- activateClass: activateClass,
- payCost: false,
- isTapped: false,
- root: SelectCardEffect.Root.Hand,
- activateETB: true)
- );
- }
- }
- }
- }
- }
- }
- #endregion
- #region Security
- if (timing == EffectTiming.SecuritySkill)
- {
- cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|