Просмотр исходного кода

Implemented all fixes from the PR

RobertoCastro446 1 год назад
Родитель
Сommit
27c73b1e54

+ 1 - 0
Assets/CardEffect/BT21/Black/Destromon_BT21_060.cs

@@ -231,6 +231,7 @@ namespace DCGO.CardEffects.BT21
                 activateClass.SetUpICardEffect("Return 2 [Vemmon] from source to bottom of deck to end the attack", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("end-attack-BT21-060");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 2 - 5
Assets/CardEffect/BT21/Black/Galacticmon_BT21_062.cs

@@ -63,12 +63,9 @@ namespace DCGO.CardEffects.BT21
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        if (!card.PermanentOfThisCard().IsToken)
+                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
                         {
-                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 

+ 5 - 5
Assets/CardEffect/BT21/Black/Greymon_BT21_057.cs

@@ -15,7 +15,7 @@ namespace DCGO.CardEffects.BT21
             {
                 static bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 3 && (targetPermanent.TopCard.ContainsCardName("Agumon") || targetPermanent.TopCard.ContainsTraits("ADVENTURE"));
+                    return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 3 && (targetPermanent.TopCard.ContainsCardName("Agumon") || targetPermanent.TopCard.EqualsTraits("ADVENTURE"));
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
@@ -32,7 +32,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] If you have [Tai Kamiya] or a Tamer with the [ADVENTURE] trait, give 1 of your opponent's Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends.";
+                    return "[On Play] If you have [Tai Kamiya] or a Tamer with the [ADVENTURE] trait, give 1 of your opponent's Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends.";
                 }
 
                 bool PermanentCondition(Permanent permanent)
@@ -43,7 +43,7 @@ namespace DCGO.CardEffects.BT21
                         {
                             return true;
                         }
-                        if (permanent.IsTamer & permanent.TopCard.CardTraits.Contains("ADVENTURE"))
+                        if (permanent.IsTamer & permanent.TopCard.EqualsTraits("ADVENTURE"))
                         {
                             return true;
                         }
@@ -210,7 +210,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] If you have [Tai Kamiya] or a Tamer with the [ADVENTURE] trait, give 1 of your opponent's Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends.";
+                    return "[When Digivolving] If you have [Tai Kamiya] or a Tamer with the [ADVENTURE] trait, give 1 of your opponent's Digimon \"[Start of Your Main Phase] This Digimon attacks.\" until their turn ends.";
                 }
 
                 bool PermanentCondition(Permanent permanent)
@@ -221,7 +221,7 @@ namespace DCGO.CardEffects.BT21
                         {
                             return true;
                         }
-                        if (permanent.IsTamer & permanent.TopCard.CardTraits.Contains("ADVENTURE"))
+                        if (permanent.IsTamer & permanent.TopCard.EqualsTraits("ADVENTURE"))
                         {
                             return true;
                         }

+ 3 - 3
Assets/CardEffect/BT21/Black/MetalGreymon_BT21_061.cs

@@ -37,7 +37,7 @@ namespace DCGO.CardEffects.BT21
             {
                 static bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 4 && (targetPermanent.TopCard.ContainsCardName("Greymon") || targetPermanent.TopCard.ContainsTraits("ADVENTURE"));
+                    return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 4 && (targetPermanent.TopCard.ContainsCardName("Greymon") || targetPermanent.TopCard.EqualsTraits("ADVENTURE"));
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
@@ -54,7 +54,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play][When Digivolving] To 1 of your opponent's Digimon, <De-Digivolve 1> for every 2 of your Tamers' colors.";
+                    return "[On Play] To 1 of your opponent's Digimon, <De-Digivolve 1> for every 2 of your Tamers' colors.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -106,7 +106,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play][When Digivolving] To 1 of your opponent's Digimon, <De-Digivolve 1> for every 2 of your Tamers' colors.";
+                    return "[When Digivolving] To 1 of your opponent's Digimon, <De-Digivolve 1> for every 2 of your Tamers' colors.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 6 - 1
Assets/CardEffect/BT21/Black/Shotmon_BT21_054.cs

@@ -158,7 +158,12 @@ namespace DCGO.CardEffects.BT21
             #region Link
             if (timing == EffectTiming.OnDeclaration)
             {
-                cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000));
+                bool DigimonCondition(Permanent permanent)
+                {
+                    return permanent.TopCard.EqualsTraits("Appmon");
+                }
+
+                cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000, null, DigimonCondition));
             }
             #endregion
 

+ 3 - 3
Assets/CardEffect/BT21/Black/Snatchmon_BT21_058.cs

@@ -20,7 +20,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
+                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
                 }
 
                 bool HasVemmonInText(CardSource cardSource)
@@ -155,7 +155,7 @@ namespace DCGO.CardEffects.BT21
 
                 string EffectDiscription()
                 {
-                    return "[On Play] [When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
+                    return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Vemmon] in its text among them to the hand. Trash the rest. Then, you may place up to 2 [Vemmon] from your trash as 1 of your Digimon's bottom digivolution cards.";
                 }
 
                 bool HasVemmonInText(CardSource cardSource)
@@ -310,7 +310,7 @@ namespace DCGO.CardEffects.BT21
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnReturnRoLibraryBottomDigivolutionCard(hashtable, cardSource => cardSource.EqualsCardName("Vemmon"), card);
+                    return CardEffectCommons.CanTriggerOnReturnToLibraryBottomDigivolutionCard(hashtable, cardSource => cardSource.EqualsCardName("Vemmon"), card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 2 - 2
Assets/CardEffect/BT21/Black/Sunarizamon_BT21_055.cs

@@ -24,7 +24,7 @@ namespace DCGO.CardEffects.BT21
 
                 bool CardSourceCondition(CardSource cardSource)
                 {
-                    if (cardSource.ContainsTraits("Mineral") | cardSource.ContainsTraits("Rock"))
+                    if (cardSource.EqualsTraits("Mineral") | cardSource.EqualsTraits("Rock"))
                     {
                         return true;
                     }
@@ -74,7 +74,7 @@ namespace DCGO.CardEffects.BT21
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     Permanent trashedPermanent = CardEffectCommons.GetPermanentFromHashtable(hashtable);
-                    return (trashedPermanent.TopCard.ContainsTraits("Mineral") || trashedPermanent.TopCard.ContainsTraits("Rock")) &&
+                    return (trashedPermanent.TopCard.EqualsTraits("Mineral") || trashedPermanent.TopCard.EqualsTraits("Rock")) &&
                            CardEffectCommons.CanTriggerOnTrashSelfDigivolutionCard(hashtable, cardEffect => cardEffect != null, card);
                 }
 

+ 12 - 2
Assets/CardEffect/BT21/Black/Timemon_BT21_059.cs

@@ -15,11 +15,16 @@ namespace DCGO.CardEffects.BT21
             if (timing == EffectTiming.None)
             {
                 AddAppFusionConditionClass addAppFusionConditionClass = new AddAppFusionConditionClass();
-                addAppFusionConditionClass.SetUpICardEffect($"App Fusion", true, card);
+                addAppFusionConditionClass.SetUpICardEffect($"App Fusion", CanUseCondition, card);
                 addAppFusionConditionClass.SetUpAddAppFusionConditionClass(getAppFusionCondition: GetAppFusion);
                 addAppFusionConditionClass.SetNotShowUI(true);
                 cardEffects.Add(addAppFusionConditionClass);
 
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
                 AppFusionCondition GetAppFusion(CardSource cardSource)
                 {
                     if (cardSource == card)
@@ -147,7 +152,12 @@ namespace DCGO.CardEffects.BT21
             #region Link
             if (timing == EffectTiming.OnDeclaration)
             {
-                cardEffects.Add(CardEffectFactory.LinkEffect(card, 2, 3000));
+                bool DigimonCondition(Permanent permanent)
+                {
+                    return permanent.TopCard.EqualsTraits("Appmon");
+                }
+
+                cardEffects.Add(CardEffectFactory.LinkEffect(card, 2, 3000, null, DigimonCondition));
             }
             #endregion
 

+ 76 - 106
Assets/CardEffect/BT21/Black/Vemmon_BT21_056.cs

@@ -12,6 +12,7 @@ namespace DCGO.CardEffects.BT21
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region On Play
+
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -132,145 +133,114 @@ namespace DCGO.CardEffects.BT21
                     }
                 }
             }
+
             #endregion
 
-            #region Inherit
-            ActivateClass activateClassInherit = new ActivateClass();
-            activateClassInherit.SetUpICardEffect("Digivolution Cost -1", CanUseConditionInherit, card);
-            activateClassInherit.SetUpActivateClass(CanActivateConditionInherit, ActivateCoroutineInherit, 1, false, EffectDiscriptionInherit());
-            activateClassInherit.SetIsInheritedEffect(true);
-            activateClassInherit.SetNotShowUI(true);
-            activateClassInherit.SetIsBackgroundProcess(true);
-            activateClassInherit.SetHashString("DigivolutionCost-1_BT21_056");
+            #region Your Turn Inherited
 
-            string EffectDiscriptionInherit()
+            if (timing == EffectTiming.BeforePayCost)
             {
-                return "[Your Turn] [Once Per Turn] When this Digimon would digivolve into a Digimon card with [Vemmon] in its text, reduce the digivolution cost by 1.";
-            }
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("DigivolutionCost-1_BT21_056");
+                cardEffects.Add(activateClass);
 
-            bool CanUseConditionInherit(Hashtable hashtable)
-            {
-                if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                string EffectDiscription()
                 {
-                    if (CardEffectCommons.IsOwnerTurn(card))
-                    {
-                        if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
-                        {
-                            List<CardSource> evoRootTops = CardEffectCommons.GetEvoRootTopsFromEnterFieldHashtable(
-                                hashtable,
-                                permanent => permanent.cardSources.Contains(card));
+                    return "[Your Turn] [Once Per Turn] When this Digimon would digivolve into a Digimon card with [Vemmon] in its text, reduce the digivolution cost by 1.";
+                }
 
-                            if (evoRootTops != null)
-                            {
-                                if (!evoRootTops.Contains(card))
-                                {
-                                    if (card.PermanentOfThisCard().TopCard.HasText("Vemmon"))
-                                    {
-                                        return true;
-                                    }
-                                }
-                            }
-                        }
-                    }
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                        permanent == card.PermanentOfThisCard();
                 }
 
-                return false;
-            }
+                bool CardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon &&
+                        cardSource.HasText("Vemmon");
+                }
 
-            bool CanActivateConditionInherit(Hashtable hashtable)
-            {
-                return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
-            }
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                        CardEffectCommons.IsOwnerTurn(card) &&
+                        CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, CardCondition);
+                }
 
-            IEnumerator ActivateCoroutineInherit(Hashtable _hashtable)
-            {
-                yield return null;
-            }
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
 
-            if (timing == EffectTiming.OnEnterFieldAnyone)
-            {
-                cardEffects.Add(activateClassInherit);
-            }
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (isExistOnField(card))
+                    {
+                        Hashtable hashtable = new Hashtable();
+                        hashtable.Add("CardEffect", activateClass);
 
-            if (timing == EffectTiming.None)
-            {
-                ChangeCostClass changeCostClass = new ChangeCostClass();
-                changeCostClass.SetUpICardEffect($"Digivolution Cost -1", CanUseConditionChangeCost, card);
-                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                        ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
 
-                changeCostClass.SetIsInheritedEffect(true);
-                cardEffects.Add(changeCostClass);
+                        ChangeCostClass changeCostClass = new ChangeCostClass();
+                        changeCostClass.SetUpICardEffect("Digivolution Cost -1", CanUseCondition1, card);
+                        changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                        card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
 
-                bool CanUseConditionChangeCost(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.IsOwnerTurn(card))
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
+
+                        bool CanUseCondition1(Hashtable hashtable)
                         {
-                            if (!card.cEntity_EffectController.isOverMaxCountPerTurn(activateClassInherit, activateClassInherit.MaxCountPerTurn))
-                            {
-                                return true;
-                            }
+                            return true;
                         }
-                    }
 
-                    return false;
-                }
-
-                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                {
-                    if (CardSourceCondition(cardSource))
-                    {
-                        if (RootCondition(root))
+                        int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
                         {
-                            if (PermanentsCondition(targetPermanents))
+                            if (CardSourceCondition(cardSource) && RootCondition(root) && PermanentsCondition(targetPermanents))
                             {
                                 Cost -= 1;
                             }
-                        }
-                    }
 
-                    return Cost;
-                }
+                            return Cost;
+                        }
 
-                bool PermanentsCondition(List<Permanent> targetPermanents)
-                {
-                    if (targetPermanents != null)
-                    {
-                        if (targetPermanents.Count(PermanentCondition) >= 1)
+                        bool PermanentsCondition(List<Permanent> targetPermanents)
                         {
-                            return true;
+                            return targetPermanents != null &&
+                                targetPermanents.Count(PermanentCondition) >= 1;
                         }
-                    }
 
-                    return false;
-                }
-
-                bool PermanentCondition(Permanent targetPermanent)
-                {
-                    return targetPermanent == card.PermanentOfThisCard();
-                }
+                        bool PermanentCondition(Permanent targetPermanent)
+                        {
+                            return targetPermanent.TopCard != null &&
+                                targetPermanent.TopCard.Owner == card.Owner &&
+                                targetPermanent.TopCard.Owner.GetBattleAreaPermanents().Contains(targetPermanent);
+                        }
 
-                bool CardSourceCondition(CardSource cardSource)
-                {
-                    if (cardSource.HasText("Vemmon"))
-                    {
-                        return true;
-                    }
+                        bool CardSourceCondition(CardSource cardSource)
+                        {
+                            return cardSource != null &&
+                                cardSource.Owner == card.Owner &&
+                                cardSource.HasText("Vemmon");
+                        }
 
-                    return false;
-                }
+                        bool RootCondition(SelectCardEffect.Root root)
+                        {
+                            return true;
+                        }
 
-                bool RootCondition(SelectCardEffect.Root root)
-                {
-                    return true;
-                }
+                        bool isUpDown()
+                        {
+                            return true;
+                        }
 
-                bool isUpDown()
-                {
-                    return true;
+                    }
                 }
             }
+
             #endregion
 
             return cardEffects;

+ 6 - 1
Assets/CardEffect/BT21/Black/Watchmon_BT21_053.cs

@@ -109,7 +109,12 @@ namespace DCGO.CardEffects.BT21
             #region Link
             if (timing == EffectTiming.OnDeclaration)
             {
-                cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000));
+                bool DigimonCondition(Permanent permanent)
+                {
+                    return permanent.TopCard.EqualsTraits("Appmon");
+                }
+
+                cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000, null, DigimonCondition));
             }
             #endregion