| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using UnityEngine;
- // Yuugo Kamishiro
- namespace DCGO.CardEffects.BT22
- {
- public class BT22_094 : 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 top 3, add 1 [CS] card to hand, bottom deck the rest", 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 the [CS] trait among them to the hand. Return the rest to the bottom of the deck.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnField(card);
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return cardSource.HasCSTraits;
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition: CanSelectCardCondition,
- message: "Select 1 [CS] Card",
- mode: SelectCardEffect.Mode.AddHand,
- maxCount: 1,
- selectCardCoroutine: null),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass
- ));
- }
- }
- #endregion
- #region Your Turn
-
- #region Before Pay Cost
- if (timing == EffectTiming.BeforePayCost)
- {
- ActivateClass activateClass2 = new ActivateClass();
- activateClass2.SetUpICardEffect("Reduce play cost", CanUseCondition2, card);
- activateClass2.SetUpActivateClass(CanActivateCondition2, ActivateCoroutine2, -1, true, EffectDiscription2());
- cardEffects.Add(activateClass2);
- string EffectDiscription2()
- {
- return "[Your Turn] When any of your Digimon or Tamers with the [CS] trait would be played, by returning this Tamer to the bottom of the deck, reduce the play cost by 2.";
- }
- bool PlayCardCondition(CardSource cardSource)
- {
- return (cardSource.IsDigimon
- || cardSource.IsTamer)
- && cardSource.HasCSTraits
- && cardSource.Owner == card.Owner;
- }
- bool CanUseCondition2(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenPermanentWouldPlay(hashtable, PlayCardCondition)
- && CardEffectCommons.IsExistOnBattleArea(card);
- }
- bool CanActivateCondition2(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.IsOwnerTurn(card);
- }
- IEnumerator ActivateCoroutine2(Hashtable _hashtable)
- {
- Permanent bounceTargetPermanent = card.PermanentOfThisCard();
- if (bounceTargetPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeckBouncePeremanentAndProcessAccordingToResult(
- targetPermanents: new List<Permanent>() { bounceTargetPermanent },
- activateClass: activateClass2,
- successProcess: SuccessProcess(),
- failureProcess: null));
- IEnumerator SuccessProcess()
- {
- ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
- ChangeCostClass changeCostClass = new ChangeCostClass();
- changeCostClass.SetUpICardEffect("Cost -2", CanUseChangeCostCondition, card);
- changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
- card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
- bool CanUseChangeCostCondition(Hashtable hashtable)
- {
- return true;
- }
- int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
- {
- if (CardSourceCondition(cardSource)
- && RootCondition(root)
- && PermanentsCondition(targetPermanents))
- {
- Cost -= 2;
- }
- return Cost;
- }
- bool PermanentsCondition(List<Permanent> targetPermanents)
- {
- return targetPermanents != null;
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- if (cardSource != null)
- {
- return cardSource.Owner == card.Owner;
- }
- return false;
- }
- bool RootCondition(SelectCardEffect.Root root) => true;
- bool isUpDown() => true;
- }
- }
- }
- }
- #endregion
- #region Before Pay Cost (Not Shown)
- if (timing == EffectTiming.None)
- {
- ChangeCostClass changeCostClass = new ChangeCostClass();
- changeCostClass.SetUpICardEffect("Play Cost -2", CanUseChangeCostCondition, card);
- changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
- changeCostClass.SetNotShowUI(true);
- cardEffects.Add(changeCostClass);
- bool CanUseChangeCostCondition(Hashtable hashtable)
- {
- return true;
- }
- int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
- {
- if (CardSourceCondition(cardSource)
- && RootCondition(root)
- && PermanentsCondition(targetPermanents))
- {
- Cost -= 2;
- }
- return Cost;
- }
- bool PermanentsCondition(List<Permanent> targetPermanents)
- {
- return targetPermanents != null;
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- if (cardSource != null)
- {
- return cardSource.Owner == card.Owner;
- }
- return false;
- }
- bool RootCondition(SelectCardEffect.Root root) => true;
- bool isUpDown() => true;
- }
- #endregion
- #endregion
- #region Security
- if (timing == EffectTiming.SecuritySkill)
- {
- cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|