| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- using System.Collections;
- using System.Collections.Generic;
- // Orochimon
- namespace DCGO.CardEffects.BT25
- {
- public class BT25_071 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternate Digivolution Requirement
- if (timing == EffectTiming.None)
- {
- static bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.EqualsTraits("TS");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 4, permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
- }
- #endregion
- #region Shared OP / WD
- string SharedEffectName = "1 enemy Digimon/Tamer can't attack until their turn ends";
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName,
- SharedActivateCoroutine,
- SharedEffectDescription,
- optional: false,
- onPlay: true,
- whenDigivolving: true);
- string SharedEffectDescription(string tag) => $"[{tag}] 1 of your opponent's Digimon or Tamers can't attack until their turn ends.";
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
- && (permanent.IsDigimon
- || permanent.IsTamer);
- }
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(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: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select Digimon/Tamer to give can't attack until their turn ends.", "The opponent is selecting Digimon/Tamer to give can't attack until your turn ends.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
- targetPermanent: permanent,
- defenderCondition: null,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass,
- effectName: "Can't Attack"));
- }
- }
- }
- #endregion
- #region Shared AT/Inherited
- string SharedEffectName1() => "Reveal 3, may play 1 play cost 4 or lower [TS] trait Digimon card, bot deck the rest.";
- string SharedEffectDescription1() => "[All Turns] [Once Per Turn] When this Digimon suspends, reveal the top 3 cards of your deck. You may play 1 play cost 4 or lower [TS] trait Digimon card among them without paying the cost. Return the rest to the bottom of the deck.";
- bool SharedCanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- bool SharedCanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.CanTriggerWhenSelfPermanentSuspends(hashtable, card);
- }
- IEnumerator SharedActivateCoroutine1(Hashtable hashtable, ActivateClass activateClass)
- {
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon
- && cardSource.HasPlayCost
- && cardSource.GetCostItself <= 4
- && cardSource.EqualsTraits("TS");
- }
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
- revealCount: 3,
- simplifiedSelectCardConditions:
- new SimplifiedSelectCardConditionClass[]
- {
- new SimplifiedSelectCardConditionClass(
- canTargetCondition:CanSelectCardCondition,
- message: "Select 1 Digimon card to play for free.",
- mode: SelectCardEffect.Mode.Custom,
- maxCount: 1,
- selectCardCoroutine: SelectCardCoroutine),
- },
- remainingCardsPlace: RemainingCardsPlace.DeckBottom,
- activateClass: activateClass,
- canNoSelect: true
- ));
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- if (cardSource != null)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
- cardSources: new List<CardSource> { cardSource },
- activateClass: activateClass,
- payCost: false,
- isTapped: false,
- root: SelectCardEffect.Root.Library,
- activateETB: true));
- }
- }
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.OnTappedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(SharedEffectName1(), SharedCanUseCondition, card);
- activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine1(hash, activateClass), 1, true, SharedEffectDescription1());
- activateClass.SetHashString("BT25_073_AT");
- cardEffects.Add(activateClass);
- }
- #endregion
- #region All Turns Inherited
- if (timing == EffectTiming.OnTappedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(SharedEffectName1(), SharedCanUseCondition, card);
- activateClass.SetUpActivateClass(SharedCanActivateCondition, hash => SharedActivateCoroutine1(hash, activateClass), 1, true, SharedEffectDescription1());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("BT25_073_AT_ESS");
- cardEffects.Add(activateClass);
- }
- #endregion
- return cardEffects;
- }
- }
- }
|