mbunch_kascope 1 год назад
Родитель
Сommit
bb7ad7bb56

+ 16 - 2
Assets/CardEffect/EX8/Black/EX8_053.cs

@@ -9,6 +9,8 @@ namespace DCGO.CardEffects.EX8
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            bool opponentHas13kDP = false;
+
             #region Blocker
             if (timing == EffectTiming.None)
             {
@@ -20,6 +22,18 @@ namespace DCGO.CardEffects.EX8
             #endregion
 
             #region All Turns
+            if(timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => permanent.IsDigimon && permanent.DP >= 13000);
+                }
+
+                if (Condition() != opponentHas13kDP)
+                    opponentHas13kDP = Condition();
+            }
+
             if (timing == EffectTiming.None)
             {
                 string EffectDiscription()
@@ -29,8 +43,8 @@ namespace DCGO.CardEffects.EX8
 
                 bool Condition()
                 {
-                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && 
-                           CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => permanent.IsDigimon && permanent.DP >= 13000);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           opponentHas13kDP;
                 }
 
                 bool PermanentCondition(Permanent permanent)

+ 1 - 1
Assets/CardEffect/EX8/Black/EX8_055.cs

@@ -63,7 +63,7 @@ namespace DCGO.CardEffects.EX8
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 56 - 2
Assets/CardEffect/EX8/Green/EX8_074.cs

@@ -152,6 +152,60 @@ namespace DCGO.CardEffects.EX8
 
             #endregion
 
+            #region Reduce Play Cost - Not Shown
+
+            if (timing == EffectTiming.None)
+            {
+                ChangeCostClass changeCostClass = new ChangeCostClass();
+                changeCostClass.SetUpICardEffect("Play Cost -4", CanUseCondition1, card);
+                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition,
+                    rootCondition: RootCondition, isUpDown: IsUpDown, isCheckAvailability: () => true,
+                    isChangePayingCost: () => true);
+
+                changeCostClass.SetNotShowUI(true);
+                cardEffects.Add(changeCostClass);
+
+                bool CanUseCondition1(Hashtable hashtable1)
+                {
+                    return true;
+                }
+
+                int ChangeCost(CardSource cardSource, int cost, SelectCardEffect.Root root,
+                    List<Permanent> targetPermanents)
+                {
+                    if (CardSourceCondition(cardSource) &&
+                        RootCondition(root) &&
+                        PermanentsCondition(targetPermanents))
+                    {
+                        cost -= 4;
+                    }
+
+                    return cost;
+                }
+
+                bool PermanentsCondition(List<Permanent> targetPermanents)
+                {
+                    return targetPermanents == null || targetPermanents.Count(targetPermanent => targetPermanent != null) == 0;
+                }
+
+                bool CardSourceCondition(CardSource cardSource)
+                {
+                    return cardSource == card;
+                }
+
+                bool RootCondition(SelectCardEffect.Root root)
+                {
+                    return true;
+                }
+
+                bool IsUpDown()
+                {
+                    return true;
+                }
+            }
+
+            #endregion
+
             #region Alliance
 
             if (timing == EffectTiming.OnAllyAttack)
@@ -198,7 +252,7 @@ namespace DCGO.CardEffects.EX8
 
                 int DeletionMaxDP()
                 {
-                    return 8000 + 3000 * CardEffectCommons.MatchConditionPermanentCount(permanent => permanent.IsSuspended);
+                    return 8000 + (3000 * CardEffectCommons.MatchConditionPermanentCount(permanent => permanent.IsSuspended));
                 }
 
                 bool CanSelectDeletePermanentCondition(Permanent permanent)
@@ -248,7 +302,7 @@ namespace DCGO.CardEffects.EX8
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: null,
                             afterSelectPermanentCoroutine: null,

+ 3 - 3
Assets/CardEffect/EX8/Red/EX8_073.cs

@@ -68,7 +68,7 @@ namespace DCGO.CardEffects.EX8
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.ContainsCardName("Gallantmon") || cardSource.ContainsCardName("X Antibody")) >= 1)
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Gallantmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
                         {
                             return true;
                         }
@@ -117,7 +117,7 @@ namespace DCGO.CardEffects.EX8
             if (timing == EffectTiming.OnAllyAttack)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("This Digimong ets +4000 DP and gives -4000 DP to an opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpICardEffect("This Digimon gets +4000 DP and gives -4000 DP to an opponent's Digimon", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -152,7 +152,7 @@ namespace DCGO.CardEffects.EX8
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.ContainsCardName("Gallantmon") || cardSource.ContainsCardName("X Antibody")) >= 1)
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Gallantmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
                         {
                             return true;
                         }

+ 30 - 26
Assets/CardEffect/P/Green/P_166.cs

@@ -89,20 +89,22 @@ namespace DCGO.CardEffects.P
                         cardEffect: activateClass);
 
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                    
-                    int suspendedCount = CardEffectCommons.MatchConditionPermanentCount(DigimonIsSuspended);
-                    
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                        targetPermanent: card.PermanentOfThisCard(),
-                        cardCondition: CanSelectDigimonToDigivolveCondition,
-                        payCost: true,
-                        reduceCostTuple: (reduceCost: suspendedCount, reduceCostCardCondition: null),
-                        fixedCostTuple: null,
-                        ignoreDigivolutionRequirementFixedCost: -1,
-                        isHand: true,
-                        activateClass: activateClass,
-                        successProcess: null));
 
+                    if (CardEffectCommons.IsOwnerTurn(card))
+                    {
+                        int suspendedCount = CardEffectCommons.MatchConditionPermanentCount(DigimonIsSuspended);
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            cardCondition: CanSelectDigimonToDigivolveCondition,
+                            payCost: true,
+                            reduceCostTuple: (reduceCost: suspendedCount, reduceCostCardCondition: null),
+                            fixedCostTuple: null,
+                            ignoreDigivolutionRequirementFixedCost: -1,
+                            isHand: true,
+                            activateClass: activateClass,
+                            successProcess: null));
+                    }
                 }
             }
             
@@ -145,20 +147,22 @@ namespace DCGO.CardEffects.P
                         cardEffect: activateClass);
 
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                    
-                    int suspendedCount = CardEffectCommons.MatchConditionPermanentCount(DigimonIsSuspended);
-                    
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
-                        targetPermanent: card.PermanentOfThisCard(),
-                        cardCondition: CanSelectDigimonToDigivolveCondition,
-                        payCost: true,
-                        reduceCostTuple: (reduceCost: suspendedCount, reduceCostCardCondition: null),
-                        fixedCostTuple: null,
-                        ignoreDigivolutionRequirementFixedCost: -1,
-                        isHand: true,
-                        activateClass: activateClass,
-                        successProcess: null));
 
+                    if (CardEffectCommons.IsOwnerTurn(card))
+                    {
+                        int suspendedCount = CardEffectCommons.MatchConditionPermanentCount(DigimonIsSuspended);
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            cardCondition: CanSelectDigimonToDigivolveCondition,
+                            payCost: true,
+                            reduceCostTuple: (reduceCost: suspendedCount, reduceCostCardCondition: null),
+                            fixedCostTuple: null,
+                            ignoreDigivolutionRequirementFixedCost: -1,
+                            isHand: true,
+                            activateClass: activateClass,
+                            successProcess: null));
+                    }
                 }
             }
             

+ 5 - 48
Assets/CardEffect/ST17/Blue/ST17_13.cs

@@ -45,7 +45,6 @@ namespace DCGO.CardEffects.ST17
             #region Security Effect
             if (timing == EffectTiming.SecuritySkill)
             {
-
                 #region De-Digivolve
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("De-Digivolve 1 to 1 Digimon", CanUseCondition, card);
@@ -113,7 +112,9 @@ namespace DCGO.CardEffects.ST17
 
                 ActivateClass activateClassDigivolve = new ActivateClass();
                 activateClassDigivolve.SetUpICardEffect("Digivolve into this Digimon", CanUseConditionAfterBattle, card);
-                activateClassDigivolve.SetUpActivateClass(CanActivateConditionAfterBattle, ActivateCoroutineAfterBattle, -1, true, EffectDiscriptionAfterBattle());
+                activateClassDigivolve.SetUpActivateClass(null, ActivateCoroutineAfterBattle, -1, true, EffectDiscriptionAfterBattle());
+                activateClass.SetIsSecurityEffect(true);
+                activateClass.SetIsDigimonEffect(true);
                 card.Owner.UntilEndBattleEffects.Add(GetCardEffectAfterBattle);
 
                 string EffectDiscriptionAfterBattle()
@@ -139,11 +140,6 @@ namespace DCGO.CardEffects.ST17
                 }
 
                 bool CanUseConditionAfterBattle(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
-                }
-
-                bool CanActivateConditionAfterBattle(Hashtable hashtable)
                 {
                     return CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionAfterBattle);
                 }
@@ -185,19 +181,6 @@ namespace DCGO.CardEffects.ST17
 
                         if (selectedPermanent != null)
                         {
-                            /*if (card.CanPlayCardTargetFrame(selectedPermanent.PermanentFrame, false, activateClassDigivolve))
-                            {
-                                PlayCardClass playCardClass = new PlayCardClass(
-                                    cardSources: new List<CardSource>() { card },
-                                    hashtable: CardEffectCommons.CardEffectHashtable(activateClassDigivolve),
-                                    payCost: false,
-                                    targetPermanent: selectedPermanent,
-                                    isTapped: false,
-                                    root: SelectCardEffect.Root.Execution,
-                                    activateETB: true);
-
-                                yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());
-                            }*/
                             yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoExcecutingAreaCard(
                                 targetPermanent: selectedPermanent,
                                 cardCondition: CanSelectCardConditionAferBattle,
@@ -241,20 +224,7 @@ namespace DCGO.CardEffects.ST17
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                    {
-                        if (permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    return !cardSource.CanNotTrashFromDigivolutionCards(activateClass);
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanSelectPermanentCondition1(Permanent permanent)
@@ -277,20 +247,7 @@ namespace DCGO.CardEffects.ST17
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleArea(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)

+ 4 - 0
Assets/Scripts/CardController.cs

@@ -280,6 +280,10 @@ public class PlayCardClass
             {
                 Root = SelectCardEffect.Root.Security;
             }
+            else if (CardEffectCommons.IsExistOnExecutingArea(card))
+            {
+                Root = SelectCardEffect.Root.Execution;
+            }
 
             List<Permanent> targetPermanents = new List<Permanent>();
 

+ 41 - 43
Assets/Scripts/CardEffectCommons.cs

@@ -750,8 +750,8 @@ public partial class CardEffectCommons
         int ignoreDigivolutionRequirementFixedCost,
         ICardEffect activateClass,
         IEnumerator successProcess,
-        bool ignoreLevel = false,
-        bool ignoreSelection = false)
+        bool ignoreSelection = false,
+        IgnoreRequirement ignoreRequirements = IgnoreRequirement.None)
     {
         if (targetPermanent == null) yield break;
         if (targetPermanent.TopCard == null) yield break;
@@ -760,7 +760,7 @@ public partial class CardEffectCommons
 
         Player owner = targetPermanent.TopCard.Owner;
         SelectCardEffect.Root root = SelectCardEffect.Root.Execution;
-        bool ignoreDigivolutionRequirement = ignoreDigivolutionRequirementFixedCost >= 0;
+        bool ignoreDigivolutionRequirement = !ignoreRequirements.Equals(IgnoreRequirement.None) || ignoreDigivolutionRequirementFixedCost >= 0;//  ignoreDigivolutionRequirementFixedCost >= 0 || ignoreRequirements;
 
         int fixedCost = -1;
 
@@ -773,7 +773,6 @@ public partial class CardEffectCommons
         {
             fixedCost = ignoreDigivolutionRequirementFixedCost;
         }
-
         bool CanSelectCardCondition(CardSource cardSource)
         {
             if (cardSource.IsDigimon)
@@ -782,13 +781,13 @@ public partial class CardEffectCommons
                 {
                     if (!cardSource.CanNotEvolve(targetPermanent))
                     {
-                        if (ignoreLevel
-                        || cardSource.CanPlayCardTargetFrame(
+                        if (cardSource.CanPlayCardTargetFrame(
                             frame: targetPermanent.PermanentFrame,
                             PayCost: payCost,
                             cardEffect: activateClass,
                             root: root,
-                            fixedCost: fixedCost))
+                            fixedCost: fixedCost,
+                            ignore: ignoreRequirements))
                         {
                             return true;
                         }
@@ -939,7 +938,6 @@ public partial class CardEffectCommons
             }
         }
         #endregion
-
         List<CardSource> selectedCards = new List<CardSource>();
 
         IEnumerator SelectCardCoroutine(CardSource cardSource)
@@ -949,40 +947,39 @@ public partial class CardEffectCommons
             yield return null;
         }
 
-            if (owner.ExecutingCards.Count(CanSelectCardCondition) >= 1)
-            {
-                int maxCount = 1;
-
-                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                selectCardEffect.SetUp(
-                            canTargetCondition: CanSelectCardCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            canNoSelect: () => true,
-                            selectCardCoroutine: SelectCardCoroutine,
-                            afterSelectCardCoroutine: null,
-                            message: "Select 1 card to digivolve.",
-                            maxCount: maxCount,
-                            canEndNotMax: false,
-                            isShowOpponent: true,
-                            mode: SelectCardEffect.Mode.Custom,
-                            root: SelectCardEffect.Root.Execution,
-                            customRootCardList: null,
-                            canLookReverseCard: true,
-                            selectPlayer: owner,
-                            cardEffect: activateClass);
-
-                selectCardEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
-                selectCardEffect.SetUpCustomMessage_ShowCard("Selected Card");
-
-                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-            }
-            else
-            {
-                selectedCards.Add(activateClass.EffectSourceCard);
-            }
-        
+        if (owner.ExecutingCards.Count(CanSelectCardCondition) > 1)
+        {
+            int maxCount = 1;
+
+            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+            selectCardEffect.SetUp(
+                        canTargetCondition: CanSelectCardCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select 1 card to digivolve.",
+                        maxCount: maxCount,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectCardEffect.Mode.Custom,
+                        root: SelectCardEffect.Root.Execution,
+                        customRootCardList: null,
+                        canLookReverseCard: true,
+                        selectPlayer: owner,
+                        cardEffect: activateClass);
+
+            selectCardEffect.SetUpCustomMessage("Select 1 card to digivolve.", "The opponent is selecting 1 card to digivolve.");
+            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Card");
+
+            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+        }
+        else
+        {
+            selectedCards.Add(activateClass.EffectSourceCard);
+        }
 
         PlayCardClass playCardClass = new PlayCardClass(
             cardSources: selectedCards,
@@ -993,7 +990,8 @@ public partial class CardEffectCommons
             root: root,
             activateETB: true);
 
-        if (ignoreLevel) playCardClass.SetIgnoreLevel();
+        playCardClass.SetIgnoreRequirements(ignoreRequirements);
+
         if (!ignoreDigivolutionRequirement && fixedCost >= 0) playCardClass.SetFixedCost(fixedCost);
 
         yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());