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

+ 1 - 1
Assets/CardEffect/BT12/Purple/BT12_083.cs

@@ -50,7 +50,7 @@ namespace DCGO.CardEffects.BT12
                         }
                     }
 
-                    int tamersCount = Combinations.GetDifferenetColorCardCount(tamerCards);
+                    int tamersCount = Combinations.GetUniqueColorCardCount(tamerCards);
 
                     return maxLevel + tamersCount;
                 }

+ 8 - 6
Assets/CardEffect/BT17/Yellow/BT17_041.cs

@@ -321,7 +321,7 @@ namespace DCGO.CardEffects.BT17
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+                        int maxCount = Math.Min(2, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
 
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
@@ -365,6 +365,8 @@ namespace DCGO.CardEffects.BT17
                             }
                         }
 
+                        List<Permanent> suspendedTargets = new List<Permanent>();
+
                         foreach (Permanent selectedPermanent in selectedPermanents)
                         {
                             if (selectedPermanent != null)
@@ -375,20 +377,20 @@ namespace DCGO.CardEffects.BT17
                                     {
                                         if (!selectedPermanent.IsSuspended && selectedPermanent.CanSuspend)
                                         {
-                                            Permanent suspendTargetPermanent = selectedPermanent;
-
-                                            yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { suspendTargetPermanent }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
+                                            suspendedTargets.Add(selectedPermanent);
                                         }
                                     }
                                 }
                             }
                         }
 
-                        if(selectedPermanents.Count > 0)
+                        if(suspendedTargets.Count > 0)
                         {
+                            yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(suspendedTargets, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
+
                             yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(
                             targetPermanent: card.PermanentOfThisCard(),
-                            changeValue: selectedPermanents.Count(),
+                            changeValue: suspendedTargets.Count,
                             effectDuration: EffectDuration.UntilEachTurnEnd,
                             activateClass: activateClass));
                         }

+ 2 - 1
Assets/CardEffect/BT21/Black/BT21_061.cs

@@ -144,7 +144,8 @@ namespace DCGO.CardEffects.BT21
 
                     IEnumerator SelectPermanentCoroutine(Permanent permanent)
                     {
-                        yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, OwnerTamerColorCountDividedBy2(), activateClass).Degeneration());
+                        for (int i = 0; i < OwnerTamerColorCountDividedBy2(); i++)
+                            yield return ContinuousController.instance.StartCoroutine(new IDegeneration(permanent, 1, activateClass).Degeneration());
                     }
                 }
             }

+ 1 - 1
Assets/CardEffect/BT21/Black/BT21_062.cs

@@ -260,7 +260,7 @@ namespace DCGO.CardEffects.BT21
             if (timing == EffectTiming.OnStartMainPhase)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete 1 oppont Digimon", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 1 opponent Digimon", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 

+ 2 - 2
Assets/CardEffect/BT21/Purple/BT21_068.cs

@@ -39,7 +39,7 @@ namespace DCGO.CardEffects.BT21
             if(timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete 3k or mill 2", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 4k or mill 2", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
@@ -114,7 +114,7 @@ namespace DCGO.CardEffects.BT21
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete 3k or mill 2", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Delete 4k or mill 2", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 

+ 3 - 6
Assets/CardEffect/BT21/Red/BT21_010.cs

@@ -51,13 +51,10 @@ namespace DCGO.CardEffects.BT21
                 {
                     var tamers = card.Owner
                         .GetBattleAreaPermanents()
-                        .Filter(x => x.IsTamer && x.TopCard.EqualsTraits("Hero"));
+                        .Filter(x => x.IsTamer && x.TopCard.EqualsTraits("Hero"))
+                        .Map(x => x.TopCard);
 
-                    if (tamers.Count >= 3)
-                    {
-                        return true;
-                    }
-                    return false;
+                    return Combinations.GetUniqueNameCardCount(tamers) >= 3;
                 }
 
                 bool PermanentCondition(Permanent targetPermanent)

+ 2 - 2
Assets/CardEffect/BT21/Red/BT21_027.cs

@@ -86,7 +86,7 @@ namespace DCGO.CardEffects.BT21
                                 {
                                     if (cardSource.IsDigimon)
                                     {
-                                        if (cardSource.EqualsCardName("OmniShoutmon"))
+                                        if (cardSource.EqualsCardNameDigiXros("OmniShoutmon"))
                                         {
                                             return true;
                                         }
@@ -107,7 +107,7 @@ namespace DCGO.CardEffects.BT21
                                 {
                                     if (cardSource.IsDigimon)
                                     {
-                                        if (cardSource.EqualsCardName("ZeigGreymon"))
+                                        if (cardSource.EqualsCardNameDigiXros("ZeigGreymon"))
                                         {
                                             return true;
                                         }

+ 4 - 11
Assets/CardEffect/BT21/Red/BT21_082.cs

@@ -65,18 +65,11 @@ namespace DCGO.CardEffects.BT21
 
                 int costReduction()
                 {
-                    List<String> cards = new List<String>();
+                    List<CardSource> cards = card.Owner.GetBattleAreaPermanents()
+                        .Filter<Permanent>(permanent => permanent.TopCard.CardColors.Contains(CardColor.Red) && permanent.IsTamer)
+                        .Map(x => x.TopCard);
 
-                    foreach (Permanent selection in card.Owner.GetBattleAreaPermanents().Filter<Permanent>(permanent=>permanent.TopCard.CardColors.Contains(CardColor.Red) && permanent.IsTamer))
-                    {
-                        foreach (string name in selection.TopCard.CardNames)
-                        {
-                            if(!cards.Contains(name.Replace(" ","")))
-                                cards.Add(name.Replace(" ", ""));
-                        }
-                    }
-
-                    return cards.Count;
+                    return Combinations.GetUniqueNameCardCount(cards);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 3 - 3
Assets/CardEffect/BT21/White/BT21_102.cs

@@ -59,7 +59,7 @@ namespace DCGO.CardEffects.BT21
             if (timing == EffectTiming.OnDeclaration)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Play Adventure/Hero Digimon for reduced cost", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Play Adventure/Hero card for reduced cost", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
                 activateClass.SetHashString("Play_BT21_102");
                 cardEffects.Add(activateClass);
@@ -103,8 +103,8 @@ namespace DCGO.CardEffects.BT21
                         mode: SelectHandEffect.Mode.Custom,
                         cardEffect: activateClass);
 
-                    selectHandEffect.SetUpCustomMessage("Select 1 digimon to play.",
-                        "The opponent is selecting 1 digimon to play.");
+                    selectHandEffect.SetUpCustomMessage("Select 1 card to play.",
+                        "The opponent is selecting 1 card to play.");
                     selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
 
                     yield return StartCoroutine(selectHandEffect.Activate());

+ 2 - 1
Assets/CardEffect/EX3/Red/EX3_012.cs

@@ -75,7 +75,8 @@ namespace DCGO.CardEffects.EX3
 
                         bool CardEffectCondition(ICardEffect cardEffect)
                         {
-                            return cardEffect.EffectSourceCard.Owner != card.Owner;
+                            return cardEffect != null &&
+                                   cardEffect.EffectSourceCard.Owner == card.Owner.Enemy;
                         }
 
                         yield return null;

+ 19 - 7
Assets/CardEffect/EX6/Yellow/EX6_063.cs

@@ -66,6 +66,8 @@ namespace DCGO.CardEffects.EX6
                     {
                         if (CardEffectCommons.HasMatchConditionPermanent(IsOwnerYellowDigimonSharedCondition))
                         {
+                            Permanent selectedPermanent = null;
+
                             int maxCount = Math.Min(1,
                                 CardEffectCommons.MatchConditionPermanentCount(IsOwnerYellowDigimonSharedCondition));
                             
@@ -93,8 +95,12 @@ namespace DCGO.CardEffects.EX6
                             
                             IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBarrier(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
+                                selectedPermanent = permanent;
+                                yield return null;
                             }
+
+                            if(selectedPermanent != null)
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBarrier(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
                         }
                     }
                 }
@@ -139,12 +145,14 @@ namespace DCGO.CardEffects.EX6
                     {
                         if (CardEffectCommons.HasMatchConditionPermanent(IsOwnerYellowDigimonSharedCondition))
                         {
+                            Permanent selectedPermanent = null;
+
                             int maxCount = Math.Min(1,
                                 CardEffectCommons.MatchConditionPermanentCount(IsOwnerYellowDigimonSharedCondition));
-                            
+
                             SelectPermanentEffect selectPermanentEffect =
                                 GManager.instance.GetComponent<SelectPermanentEffect>();
-                            
+
                             selectPermanentEffect.SetUp(
                                 selectPlayer: card.Owner,
                                 canTargetCondition: IsOwnerYellowDigimonSharedCondition,
@@ -157,17 +165,21 @@ namespace DCGO.CardEffects.EX6
                                 afterSelectPermanentCoroutine: null,
                                 mode: SelectPermanentEffect.Mode.Custom,
                                 cardEffect: activateClass);
-                            
+
                             selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain Barrier.",
                                 "The opponent is selecting 1 Digimon that will gain Barrier.");
-                            
+
                             yield return ContinuousController.instance.StartCoroutine(
                                 selectPermanentEffect.Activate());
-                            
+
                             IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBarrier(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
+                                selectedPermanent = permanent;
+                                yield return null;
                             }
+
+                            if (selectedPermanent != null)
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBarrier(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
                         }
                     }
                 }

+ 6 - 5
Assets/CardEffect/EX7/Red/EX7_014.cs

@@ -207,12 +207,13 @@ namespace DCGO.CardEffects.EX7
                          return false;
                      }
 
-                     bool CardEffectCondition(ICardEffect cardEffect)
-                     {
-                         return true;
-                     }
+                    bool CardEffectCondition(ICardEffect cardEffect)
+                    {
+                        return cardEffect != null &&
+                               cardEffect.EffectSourceCard.Owner == card.Owner.Enemy;
+                    }
 
-                     yield return null;
+                    yield return null;
                     
                 }
             }

+ 33 - 30
Assets/CardEffect/P/Red/P_186.cs

@@ -68,15 +68,12 @@ namespace DCGO.CardEffects.P
 
             if (timing == EffectTiming.None)
             {
-                int count()
-                {
-                    return 2 * ((card.Owner.TrashCards.Count + card.Owner.Enemy.TrashCards.Count) / 5);
-                }
-
                 ChangeCostClass changeCostClass = new ChangeCostClass();
                 changeCostClass.SetUpICardEffect($"Play Cost -", CanUseCondition, card);
-                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => true, isChangePayingCost: () => true);
-                changeCostClass.SetNotShowUI(true);
+                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost,
+                    cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: IsUpDown,
+                    isCheckAvailability: () => false, isChangePayingCost: () => true);
+
                 cardEffects.Add(changeCostClass);
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -85,8 +82,6 @@ namespace DCGO.CardEffects.P
                     {
                         if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
                         {
-                            changeCostClass.SetEffectName($"Play Cost -{count()}");
-
                             return true;
                         }
                     }
@@ -94,46 +89,54 @@ namespace DCGO.CardEffects.P
                     return false;
                 }
 
-                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                bool PermanentCondition(Permanent Permanent)
                 {
-                    if (CardSourceCondition(cardSource))
+                    if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(Permanent))
                     {
-                        if (RootCondition(root))
+                        if (Permanent.IsDigimon)
                         {
-                            if (PermanentsCondition(targetPermanents))
+                            if (Permanent.DP >= 13000)
                             {
-                                int reducedCount = count();
-
-                                if (reducedCount >= 1)
-                                    Cost -= reducedCount;
+                                return true;
                             }
                         }
                     }
 
-                    return Cost;
+                    return false;
                 }
 
-                bool PermanentCondition(Permanent Permanent)
+                int count()
                 {
-                    if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(Permanent))
+                    return 2 * ((card.Owner.TrashCards.Count + card.Owner.Enemy.TrashCards.Count) / 5);
+                }
+
+                int ChangeCost(CardSource cardSource, int cost, SelectCardEffect.Root root,
+                    List<Permanent> targetPermanents)
+                {
+                    if (CardSourceCondition(cardSource))
                     {
-                        if (Permanent.DP >= 13000)
+                        if (RootCondition(root))
                         {
-                            return true;
+                            if (PermanentsCondition(targetPermanents))
+                            {
+                                cost -= count();
+                            }
                         }
                     }
 
-                    return false;
+                    return cost;
                 }
 
                 bool PermanentsCondition(List<Permanent> targetPermanents)
                 {
-                    if (targetPermanents != null)
+                    if (targetPermanents == null)
                     {
-                        if (targetPermanents.Count(PermanentCondition) > 0)
-                        {
-                            return true;
-                        }
+                        return true;
+                    }
+
+                    if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
+                    {
+                        return true;
                     }
 
                     return false;
@@ -146,10 +149,10 @@ namespace DCGO.CardEffects.P
 
                 bool RootCondition(SelectCardEffect.Root root)
                 {
-                    return root == SelectCardEffect.Root.Hand;
+                    return (root == SelectCardEffect.Root.Hand);
                 }
 
-                bool isUpDown()
+                bool IsUpDown()
                 {
                     return true;
                 }

+ 3 - 2
Assets/CardEffect/ST20/Black/ST20_14.cs

@@ -75,8 +75,8 @@ namespace DCGO.CardEffects.ST20
 
                 bool PermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
-                           && permanent.TopCard.Level >= 5
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           permanent.TopCard.HasLevel && permanent.TopCard.Level >= 5
                            && permanent.willBeRemoveField;
                 }
 
@@ -113,6 +113,7 @@ namespace DCGO.CardEffects.ST20
                             {
                                 return cardSource.IsDigimon &&
                                         cardSource.HasAdventureTraits &&
+                                        cardSource.HasLevel &&
                                         cardSource.Level <= 5;
                             }
 

+ 1 - 1
Assets/CardEffect/ST21/Blue/ST21_04.cs

@@ -37,7 +37,7 @@ namespace DCGO.CardEffects.ST21
 
                 foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents())
                 {
-                    if (permanent.IsTamer && permanent.TopCard.HasAdventureTraits)
+                    if (permanent.IsTamer)
                     {
                         tamerCards.Add(permanent.TopCard);
                     }

+ 1 - 1
Assets/CardEffect/ST21/Green/ST21_09.cs

@@ -37,7 +37,7 @@ namespace DCGO.CardEffects.ST21
 
                 foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents())
                 {
-                    if (permanent.IsTamer && permanent.TopCard.HasAdventureTraits)
+                    if (permanent.IsTamer)
                     {
                         tamerCards.Add(permanent.TopCard);
                     }

+ 1 - 1
Assets/CardEffect/ST21/Yellow/ST21_06.cs

@@ -29,7 +29,7 @@ namespace DCGO.CardEffects.ST21
 
                 foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents())
                 {
-                    if (permanent.IsTamer && permanent.TopCard.HasAdventureTraits)
+                    if (permanent.IsTamer)
                     {
                         tamerCards.Add(permanent.TopCard);
                     }

+ 4 - 0
Assets/Scripts/AttackProcess.cs

@@ -464,6 +464,10 @@ public class AttackProcess : MonoBehaviourPunCallbacks
             yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(effectHashtable, EffectTiming.OnEndAttack));
         }
 
+        // activate cutin effects
+        yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.RuleProcess());
+        yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing_CutIn.TriggeredSkillProcess(true, null));
+
         #region reset effects which continues until the end of attack
         foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
         {

+ 2 - 1
Assets/Scripts/CardEffectCommons/GameContextDeterminarion.cs

@@ -150,7 +150,8 @@ public partial class CardEffectCommons
         bool isPlayOption = false,
         int fixedCost = -1) =>
     cardSource != null &&
-    (isPlayOption || !cardSource.IsOption)
+    (isPlayOption || !cardSource.IsOption) &&
+    !GManager.instance.GetComponent<SelectDigiXrosClass>().selectedDigicrossCards.Contains(cardSource)
     && cardSource.Owner.fieldCardFrames.Some((frame) =>
     frame.IsEmptyFrame()
     && cardSource.CanPlayCardTargetFrame(frame, payCost, cardEffect, root, isBreedingArea: isBreedingArea, fixedCost:fixedCost));

+ 46 - 0
Assets/Scripts/Combinations.cs

@@ -49,6 +49,52 @@ public static class Combinations
         }
     }
 
+    //GetUniqueNameCardCount
+    public static int GetUniqueNameCardCount(List<CardSource> cardSources)
+    {
+        List<string> cardNames = new List<string>();
+        List<CardSource> sourceList = new List<CardSource>();
+
+        foreach (CardSource cardSource in cardSources)
+        {
+            foreach (string name in cardSource.CardNames)
+            {
+                if (!cardNames.Contains(name))
+                {
+                    cardNames.Add(name);
+                    sourceList.Add(cardSource);
+
+                    break;
+                }
+            }
+        }
+
+        return sourceList.Count;
+    }
+
+    //GetUniqueColorCardCount
+    public static int GetUniqueColorCardCount(List<CardSource> cardSources)
+    {
+        List<CardColor> cardColors = new List<CardColor>();
+        List<CardSource> sourceList = new List<CardSource>();
+
+        foreach (CardSource cardSource in cardSources)
+        {
+            foreach(CardColor cardColor in cardSource.CardColors)
+            {
+                if (!cardColors.Contains(cardColor))
+                {
+                    cardColors.Add(cardColor);
+                    sourceList.Add(cardSource);
+                    
+                    break;
+                }
+            }
+        }
+
+        return sourceList.Count;
+    }
+
     //GetDifferenetColorCardCount
     public static int GetDifferenetColorCardCount(List<CardSource> cardSources, bool allowSkip = false)
     {

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:5944778eb5b52a81b1e362aad56ac159b335336636e5b81026632ab8d83f17f2
+oid sha256:a8cdff1aa30e5bac3024cfb4c31834f2545a56d9eab369bd0f61426b2055f617
 size 20168