| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Chaperomon
- namespace DCGO.CardEffects.BT22
- {
- public class BT22_036 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Overclock
- if (timing == EffectTiming.OnEndTurn)
- {
- cardEffects.Add(CardEffectFactory.OverclockSelfEffect(trait: "Puppet", isInheritedEffect: false, card: card,
- condition: null));
- }
- #endregion
- #region Hand Main
- if (timing == EffectTiming.OnDeclaration)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Place 1 [ShoeShoemon] from trash into a [Shoemon] sources, then digivolve", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Hand] [Main] If you have [Arisa Kinosaki], by placing 1 [ShoeShoemon] from your trash as any of your [Shoemon]'s bottom digivolution card, it digivolves into this card for a digivolution cost of 3, ignoring digivolution requirements.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnHand(card)
- && CardEffectCommons.IsOwnerTurn(card)
- && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsArisaKinosaki)
- && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsShoemon)
- && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsShoeShoemon);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnHand(card)
- && CardEffectCommons.IsOwnerTurn(card)
- && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsArisaKinosaki)
- && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsShoemon)
- && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsShoeShoemon);
- }
- bool IsArisaKinosaki(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.TopCard.EqualsCardName("Arisa Kinosaki");
- bool IsShoemon(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) && permanent.TopCard.EqualsCardName("Shoemon");
- bool IsShoeShoemon(CardSource cardSource) => cardSource.EqualsCardName("ShoeShoemon");
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- CardSource selectedShoeShoeMon = null;
- #region Select ShoeShoemon From trash
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, IsShoeShoemon));
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: IsShoeShoemon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => false,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 [ShoeShoemon] to add to sources",
- maxCount: maxCount,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Trash,
- customRootCardList: null,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedShoeShoeMon = cardSource;
- yield return null;
- }
- selectCardEffect.SetUpCustomMessage("Select 1 [ShoeShoemon] to add to sources.", "The opponent is selecting 1 [ShoeShoemon] to add to sources.");
- yield return StartCoroutine(selectCardEffect.Activate());
- #endregion
- if (selectedShoeShoeMon != null)
- {
- Permanent selectedShoemon = null;
- #region Select Shoemon on Field
- int maxCount1 = Math.Min(1, CardEffectCommons.MatchConditionOwnersPermanentCount(card, IsShoemon));
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: IsShoemon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedShoemon = permanent;
- yield return null;
- }
- selectPermanentEffect.SetUpCustomMessage("Select 1 [Shoemon] to gain source", "The opponent is selecting 1 [Shoemon] to gain source");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- #endregion
- if (selectedShoemon != null)
- {
- yield return ContinuousController.instance.StartCoroutine(
- selectedShoemon.AddDigivolutionCardsBottom(new List<CardSource>() { selectedShoeShoeMon }, activateClass));
- if (selectedShoemon.DigivolutionCards.Contains(selectedShoeShoeMon)) yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.DigivolveIntoHandOrTrashCard(
- targetPermanent: selectedShoemon,
- cardCondition: cs => cs == card,
- payCost: true,
- reduceCostTuple: null,
- fixedCostTuple: null,
- ignoreDigivolutionRequirementFixedCost: 3,
- isHand: true,
- activateClass: activateClass,
- successProcess: null,
- isOptional: false));
- }
- }
- yield return null;
- }
- }
- #endregion
- #region All Turns - ESS
- if (timing == EffectTiming.WhenRemoveField)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 of your other Digimon to prevent this Digimon from leaving", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("BT22_036_Substitute");
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return "[All Turns] [Once Per Turn] When this Digimon would leave the battle area other than by your effects, by deleting 1 of your Tokens or other [Puppet] trait Digimon, it doesn't leave.";
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
- permanent != card.PermanentOfThisCard() &&
- (permanent.IsToken || permanent.TopCard.ContainsTraits("Puppet"));
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card) &&
- !CardEffectCommons.IsByEffect(hashtable, cardEffect => CardEffectCommons.IsOwnerEffect(cardEffect, card));
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- Permanent thisCardPermanent = card.PermanentOfThisCard();
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
- "The opponent is selecting 1 Digimon to delete.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- yield return ContinuousController.instance.StartCoroutine(
- CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
- targetPermanents: new List<Permanent>() { permanent },
- activateClass: activateClass,
- successProcess: _ => SuccessProcess(),
- failureProcess: null));
- IEnumerator SuccessProcess()
- {
- thisCardPermanent.willBeRemoveField = false;
- thisCardPermanent.HideDeleteEffect();
- thisCardPermanent.HideHandBounceEffect();
- thisCardPermanent.HideDeckBounceEffect();
- thisCardPermanent.HideWillRemoveFieldEffect();
- yield return null;
- }
- }
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|