소스 검색

Add level 5 cardEffects

Andrej Erdelsky 1 년 전
부모
커밋
093456799b

+ 1 - 0
.gitignore

@@ -88,3 +88,4 @@ crashlytics-build.properties
 /Assets/Resources/Fonts & Materials/ANTQUAB SDF.asset
 /Assets/StreamingAssets/Card/
 /.idea
+/.idea/.idea.DCGO

+ 2 - 2
Assets/CardBaseEntity/BT18/Black/Digimon/RhinoKabuterimon-BT18-070.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5b1c05fba4dadbec43765eb66f930977f5295b1f5ac290aeb50394e9fcf69e50
-size 1566
+oid sha256:fb2962fdb9258ec87c94c3136e540de8958bc9d03a8c3e13fc0ace7fe599081f
+size 1659

+ 2 - 2
Assets/CardBaseEntity/BT18/Blue/Digimon/DaiPenmon-BT18-026.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:26e64ab80786a3e979267f9c668073e315be26546cba44be990b7786169f713d
-size 1499
+oid sha256:c3981e6b244ad717edbf5fab3449f0cfdbbb52f42f4d3e42262e92831b371e88
+size 1605

+ 2 - 2
Assets/CardBaseEntity/BT18/Green/Digimon/JetSilphymon-BT18-053.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c1e4966aa16386e67c6b9b69177dd0b2a2fb28eaed436fd1b1da6dc5b43511e7
-size 1496
+oid sha256:0d1980d710ccbbac1c472e93dd04d898180ff335250ef40435add42b4adad4b7
+size 1589

+ 2 - 2
Assets/CardBaseEntity/BT18/Purple/Digimon/Rhihimon-BT18-081.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c31cd6abad45a689a272f6b0fe77dbeb17b4f412330dcf4dc5949f5d06a3b888
-size 1549
+oid sha256:710a9094d29f2e21d1e54e15c2075c1669c93f0e43a5c9f815cad13dcfbb0464
+size 1642

+ 355 - 0
Assets/CardEffect/BT18/Black/RhinoKabuterimon_BT18_070.cs

@@ -0,0 +1,355 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class RhinoKabuterimon_BT18_070 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel4 && targetPermanent.TopCard.ContainsTraits("Hybrid")
+                                                            && (targetPermanent.TopCard.CardColors.Contains(CardColor.Black) ||
+                                                                targetPermanent.TopCard.CardColors.Contains(CardColor.Yellow));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 3,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Hand - Main
+
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Your black or yellow tamer digivolves into this card", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Hand] [Main] By placing 1 [Beetlemon] and [MetalKabuterimon] from your trash under 1 of your black or yellow Tamers, that Tamer digivolves into this card for digivolution cost of 3, ignoring its digivolution requirements.";
+                }
+
+                bool CanSelectHumanSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Beetlemon");
+                }
+
+                bool CanSelectBeastSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("MetalKabuterimon");
+                }
+
+                bool CanSelectTamerPermanentCondition(Permanent permanent)
+                {
+                    return permanent != null && CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
+                           permanent.IsTamer &&
+                           (permanent.TopCard.CardColors.Contains(CardColor.Black) ||
+                            permanent.TopCard.CardColors.Contains(CardColor.Yellow));
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return card.Owner.HandCards.Contains(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectTamerPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 tamer to digivolve.",
+                            "The opponent is selecting 1 tamer to digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition))
+                        {
+                            bool digivolve = false;
+
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            SelectCardEffect selectCardEffect =
+                                GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: (cardSource) =>
+                                    CanSelectHumanSpiritCardCondition(cardSource) ||
+                                    CanSelectBeastSpiritCardCondition(cardSource),
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message:
+                                "Select cards to place on the bottom of Digivolution cards\n(cards will be placed in the digivolution cards so that cards with lower numbers are on top).",
+                                maxCount: 2,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Trash,
+                                customRootCardList: null,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                selectCardEffect.Activate());
+
+                            bool CanTargetConditionByPreSelectedList(List<CardSource> cardSources,
+                                CardSource cardSource)
+                            {
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectHumanSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectBeastSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                return true;
+                            }
+
+                            bool CanEndSelectCondition(List<CardSource> cardSources)
+                            {
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectHumanSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectHumanSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectBeastSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectBeastSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                selectedCards.Add(cardSource);
+                                yield return null;
+                            }
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
+
+                                if (selectedCards.Count == 2)
+                                {
+                                    digivolve = true;
+                                }
+                            }
+
+                            if (digivolve)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                        targetPermanent: selectedPermanent,
+                                        cardCondition: source => source == card,
+                                        payCost: true,
+                                        reduceCostTuple: null,
+                                        fixedCostTuple: null,
+                                        ignoreDigivolutionRequirementFixedCost: 3,
+                                        isHand: true,
+                                        activateClass: activateClass,
+                                        successProcess: null));
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Collision
+
+            if (timing == EffectTiming.OnCounterTiming)
+            {
+                cardEffects.Add(CardEffectFactory.CollisionSelfStaticEffect(false, card, null));
+            }
+
+            #endregion
+
+            #region All Turns
+
+            if (timing == EffectTiming.OnAttackTargetChanged)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activateClass.SetHashString("Unsuspend_BT18_70");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[All Turns] (Once Per Turn) When an attack target is switched, you may unsuspend this Digimon.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.CanTriggerOnPermanentAttackTargetSwitch(hashtable, _ => true);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        new IUnsuspendPermanents(new List<Permanent>() { card.PermanentOfThisCard() }, activateClass).Unsuspend());
+                }
+            }
+
+            #endregion
+
+            #region When Attacking - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("DP -4000", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
+                    EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[When Attacking] (Once Per Turn) 1 of your opponent's Digimon gets -4000 DP for the turn.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    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 1 Digimon that will get DP -4000.",
+                        "The opponent is selecting 1 Digimon that will get DP -4000.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: permanent,
+                            changeValue: -4000,
+                            effectDuration: EffectDuration.UntilEachTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Black/RhinoKabuterimon_BT18_070.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ed0be4b3f875fa74cbf67cff57507a56
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 325 - 0
Assets/CardEffect/BT18/Blue/DaiPenmon_BT18_026.cs

@@ -0,0 +1,325 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class DaiPenmon_BT18_026 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel4 && targetPermanent.TopCard.ContainsTraits("Hybrid")
+                                                            && (targetPermanent.TopCard.CardColors.Contains(CardColor.Blue) ||
+                                                                targetPermanent.TopCard.CardColors.Contains(CardColor.Red));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 3,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Hand - Main
+
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Your blue or red tamer digivolves into this card", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Hand] [Main] By placing 1 [Kumamon] and [Korikakumon] from your trash under 1 of your blue or red Tamers, that Tamer digivolves into this card for digivolution cost of 3, ignoring its digivolution requirements.";
+                }
+
+                bool CanSelectHumanSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Kumamon");
+                }
+
+                bool CanSelectBeastSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Korikakumon");
+                }
+
+                bool CanSelectTamerPermanentCondition(Permanent permanent)
+                {
+                    return permanent != null && CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
+                           permanent.IsTamer &&
+                           (permanent.TopCard.CardColors.Contains(CardColor.Blue) || permanent.TopCard.CardColors.Contains(CardColor.Red));
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return card.Owner.HandCards.Contains(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectTamerPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 tamer to digivolve.",
+                            "The opponent is selecting 1 tamer to digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition))
+                        {
+                            bool digivolve = false;
+
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            SelectCardEffect selectCardEffect =
+                                GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: (cardSource) =>
+                                    CanSelectHumanSpiritCardCondition(cardSource) ||
+                                    CanSelectBeastSpiritCardCondition(cardSource),
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message:
+                                "Select cards to place on the bottom of Digivolution cards\n(cards will be placed in the digivolution cards so that cards with lower numbers are on top).",
+                                maxCount: 2,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Trash,
+                                customRootCardList: null,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                selectCardEffect.Activate());
+
+                            bool CanTargetConditionByPreSelectedList(List<CardSource> cardSources,
+                                CardSource cardSource)
+                            {
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectHumanSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectBeastSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                return true;
+                            }
+
+                            bool CanEndSelectCondition(List<CardSource> cardSources)
+                            {
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectHumanSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectHumanSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectBeastSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectBeastSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                selectedCards.Add(cardSource);
+                                yield return null;
+                            }
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
+
+                                if (selectedCards.Count == 2)
+                                {
+                                    digivolve = true;
+                                }
+                            }
+
+                            if (digivolve)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                        targetPermanent: selectedPermanent,
+                                        cardCondition: source => source == card,
+                                        payCost: true,
+                                        reduceCostTuple: null,
+                                        fixedCostTuple: null,
+                                        ignoreDigivolutionRequirementFixedCost: 3,
+                                        isHand: true,
+                                        activateClass: activateClass,
+                                        successProcess: null));
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Iceclad
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.IcecladSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+
+            #endregion
+            
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect(" Delete 1 of your opponent's Digimon with no digivolution cards",
+                    CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving]  Delete 1 of your opponent's Digimon with no digivolution cards.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+                
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
+                           permanent.HasNoDigivolutionCards;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    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: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Destroy,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.",
+                        "The opponent is selecting 1 Digimon to delete.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                }
+            }
+
+            #endregion
+
+            #region Your Turn - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true,
+                    card: card, condition: Condition));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Blue/DaiPenmon_BT18_026.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 01865bf75885e7844b6a4b1a463d3ffc
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 340 - 0
Assets/CardEffect/BT18/Green/JetSilphymon_BT18_053.cs

@@ -0,0 +1,340 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class JetSilphymon_BT18_053 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel4 && targetPermanent.TopCard.ContainsTraits("Hybrid")
+                                                            && (targetPermanent.TopCard.CardColors.Contains(CardColor.Green) ||
+                                                                targetPermanent.TopCard.CardColors.Contains(CardColor.Red));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 3,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Hand - Main
+
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Your green or red tamer digivolves into this card", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Hand] [Main] By placing 1 [Kazemon] and [Zephyrmon] from your trash under 1 of your green or red Tamers, that Tamer digivolves into this card for digivolution cost of 3, ignoring its digivolution requirements.";
+                }
+
+                bool CanSelectHumanSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Kazemon");
+                }
+
+                bool CanSelectBeastSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Zephyrmon");
+                }
+
+                bool CanSelectTamerPermanentCondition(Permanent permanent)
+                {
+                    return permanent != null && CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
+                           permanent.IsTamer &&
+                           (permanent.TopCard.CardColors.Contains(CardColor.Green) || permanent.TopCard.CardColors.Contains(CardColor.Red));
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return card.Owner.HandCards.Contains(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectTamerPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 tamer to digivolve.",
+                            "The opponent is selecting 1 tamer to digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition))
+                        {
+                            bool digivolve = false;
+
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            SelectCardEffect selectCardEffect =
+                                GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: (cardSource) =>
+                                    CanSelectHumanSpiritCardCondition(cardSource) ||
+                                    CanSelectBeastSpiritCardCondition(cardSource),
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message:
+                                "Select cards to place on the bottom of Digivolution cards\n(cards will be placed in the digivolution cards so that cards with lower numbers are on top).",
+                                maxCount: 2,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Trash,
+                                customRootCardList: null,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                selectCardEffect.Activate());
+
+                            bool CanTargetConditionByPreSelectedList(List<CardSource> cardSources,
+                                CardSource cardSource)
+                            {
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectHumanSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectBeastSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                return true;
+                            }
+
+                            bool CanEndSelectCondition(List<CardSource> cardSources)
+                            {
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectHumanSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectHumanSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectBeastSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectBeastSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                selectedCards.Add(cardSource);
+                                yield return null;
+                            }
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
+
+                                if (selectedCards.Count == 2)
+                                {
+                                    digivolve = true;
+                                }
+                            }
+
+                            if (digivolve)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                        targetPermanent: selectedPermanent,
+                                        cardCondition: source => source == card,
+                                        payCost: true,
+                                        reduceCostTuple: null,
+                                        fixedCostTuple: null,
+                                        ignoreDigivolutionRequirementFixedCost: 3,
+                                        isHand: true,
+                                        activateClass: activateClass,
+                                        successProcess: null));
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Raid
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                cardEffects.Add(CardEffectFactory.RaidSelfEffect(
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon or Tamers", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[On Play] Suspend 1 of your opponent's Digimon or Tamers. It can't unsuspend until the end of their turn.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+                
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) &&
+                           (permanent.IsDigimon || permanent.IsTamer);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    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: null,
+                        afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass);
+
+                    selectPermanentEffect.SetUpCustomMessage(
+                        "Select 1 Digimon or Tamer that will get suspended and unable to unsuspend.",
+                        "The opponent is selecting 1 Digimon that will get suspended and unable to unsuspend.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    
+                    IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                    {
+                        foreach (Permanent permanent in permanents)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
+                                targetPermanent: permanent,
+                                activateClass: activateClass
+                            ));
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Your Turn - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true,
+                    card: card, condition: Condition));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Green/JetSilphymon_BT18_053.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a2f60b2b30d988140a513340c8403f05
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 400 - 0
Assets/CardEffect/BT18/Purple/Rhihimon_BT18_081.cs

@@ -0,0 +1,400 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT18
+{
+    public class Rhihimon_BT18_081 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.IsLevel4 && targetPermanent.TopCard.ContainsTraits("Hybrid")
+                                                            && (targetPermanent.TopCard.CardColors.Contains(CardColor.Purple) ||
+                                                                targetPermanent.TopCard.CardColors.Contains(CardColor.Yellow));
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 3,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Hand - Main
+
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Your purple or yellow tamer digivolves into this card", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Hand] [Main] By placing 1 [Loweemon] and [KaiserLeomon] from your trash under 1 of your purple or yellow Tamers, that Tamer digivolves into this card for digivolution cost of 3, ignoring its digivolution requirements.";
+                }
+
+                bool CanSelectHumanSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("Loweemon");
+                }
+
+                bool CanSelectBeastSpiritCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsCardName("KaiserLeomon");
+                }
+
+                bool CanSelectTamerPermanentCondition(Permanent permanent)
+                {
+                    return permanent != null && CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
+                           permanent.IsTamer &&
+                           (permanent.TopCard.CardColors.Contains(CardColor.Purple) ||
+                            permanent.TopCard.CardColors.Contains(CardColor.Yellow));
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return card.Owner.HandCards.Contains(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectTamerPermanentCondition))
+                    {
+                        Permanent selectedPermanent = null;
+
+                        SelectPermanentEffect selectPermanentEffect =
+                            GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectTamerPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 tamer to digivolve.",
+                            "The opponent is selecting 1 tamer to digivolve.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
+
+                            yield return null;
+                        }
+
+                        if (selectedPermanent != null &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectHumanSpiritCardCondition) &&
+                            CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectBeastSpiritCardCondition))
+                        {
+                            bool digivolve = false;
+
+
+                            List<CardSource> selectedCards = new List<CardSource>();
+
+                            SelectCardEffect selectCardEffect =
+                                GManager.instance.GetComponent<SelectCardEffect>();
+
+                            selectCardEffect.SetUp(
+                                canTargetCondition: (cardSource) =>
+                                    CanSelectHumanSpiritCardCondition(cardSource) ||
+                                    CanSelectBeastSpiritCardCondition(cardSource),
+                                canTargetCondition_ByPreSelecetedList: CanTargetConditionByPreSelectedList,
+                                canEndSelectCondition: CanEndSelectCondition,
+                                canNoSelect: () => false,
+                                selectCardCoroutine: SelectCardCoroutine,
+                                afterSelectCardCoroutine: null,
+                                message:
+                                "Select cards to place on the bottom of Digivolution cards\n(cards will be placed in the digivolution cards so that cards with lower numbers are on top).",
+                                maxCount: 2,
+                                canEndNotMax: false,
+                                isShowOpponent: true,
+                                mode: SelectCardEffect.Mode.Custom,
+                                root: SelectCardEffect.Root.Trash,
+                                customRootCardList: null,
+                                canLookReverseCard: true,
+                                selectPlayer: card.Owner,
+                                cardEffect: activateClass);
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                selectCardEffect.Activate());
+
+                            bool CanTargetConditionByPreSelectedList(List<CardSource> cardSources,
+                                CardSource cardSource)
+                            {
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectHumanSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 1)
+                                {
+                                    if (CanSelectBeastSpiritCardCondition(cardSource))
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                return true;
+                            }
+
+                            bool CanEndSelectCondition(List<CardSource> cardSources)
+                            {
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectHumanSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectHumanSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card,
+                                        CanSelectBeastSpiritCardCondition))
+                                {
+                                    if (cardSources.Count(CanSelectBeastSpiritCardCondition) == 0)
+                                    {
+                                        return false;
+                                    }
+                                }
+
+                                if (cardSources.Count(CanSelectHumanSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                if (cardSources.Count(CanSelectBeastSpiritCardCondition) >= 2)
+                                {
+                                    return false;
+                                }
+
+                                return true;
+                            }
+
+                            IEnumerator SelectCardCoroutine(CardSource cardSource)
+                            {
+                                selectedCards.Add(cardSource);
+                                yield return null;
+                            }
+
+                            if (selectedCards.Count >= 1)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
+
+                                if (selectedCards.Count == 2)
+                                {
+                                    digivolve = true;
+                                }
+                            }
+
+                            if (digivolve)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                        targetPermanent: selectedPermanent,
+                                        cardCondition: source => source == card,
+                                        payCost: true,
+                                        reduceCostTuple: null,
+                                        fixedCostTuple: null,
+                                        ignoreDigivolutionRequirementFixedCost: 3,
+                                        isHand: true,
+                                        activateClass: activateClass,
+                                        successProcess: null));
+                            }
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Jamming
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+
+            #endregion
+
+            #region When Digivolving
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 Tamer card from trash", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[When Digivolving] You may play 1 Tamer card with inherited effects from your trash without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsTamer && cardSource.HasInheritedEffect &&
+                           CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<CardSource> selectedCards = new List<CardSource>();
+
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectCardCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select 1 Tamer card to play.",
+                        maxCount: 1,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: SelectCardEffect.Root.Trash,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    selectCardEffect.SetUpCustomMessage("Select 1 Tamer card to play.", "The opponent is selecting 1 Tamer card to play.");
+                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                    yield return ContinuousController.instance.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.Trash,
+                        activateETB: true));
+                }
+            }
+
+            #endregion
+
+            #region When Attacking - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("DP -4000", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
+                    EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[When Attacking] (Once Per Turn) 1 of your opponent's Digimon gets -4000 DP for the turn.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanSelectPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    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 1 Digimon that will get DP -4000.",
+                        "The opponent is selecting 1 Digimon that will get DP -4000.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                            targetPermanent: permanent,
+                            changeValue: -4000,
+                            effectDuration: EffectDuration.UntilEachTurnEnd,
+                            activateClass: activateClass));
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Purple/Rhihimon_BT18_081.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 415063e5fd8204346bc528308cd307f0
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: