mbunch_kascope 1 gadu atpakaļ
vecāks
revīzija
d2f83d7606

+ 21 - 21
Assets/CardEffect/BT1/Blue/WereGarurumon_BT1_040.cs

@@ -41,31 +41,31 @@ namespace CardEffect.BT1.Blue
             {
                 yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(3, activateClass));
 
-                        ActivateClass activateClass1 = new ActivateClass();
-                        activateClass1.SetUpICardEffect("Memory -3", CanUseCondition1, card);
-                        activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
-                        CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilEachTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
+                    ActivateClass activateClass1 = new ActivateClass();
+                    activateClass1.SetUpICardEffect("Memory -3", CanUseCondition1, card);
+                    activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
+                    CardEffectCommons.AddEffectToPlayer(effectDuration: EffectDuration.UntilEachTurnEnd, card: card, cardEffect: activateClass1, timing: EffectTiming.OnEndTurn);
 
-                        string EffectDiscription1()
-                        {
-                            return "Lose 3 memory.";
-                        }
+                    string EffectDiscription1()
+                    {
+                        return "Lose 3 memory.";
+                    }
 
-                        bool CanUseCondition1(Hashtable hashtable)
-                        {
-                            return true;
-                        }
+                    bool CanUseCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
 
-                        bool CanActivateCondition1(Hashtable hashtable)
-                        {
-                            return true;
-                        }
+                    bool CanActivateCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
 
-                        IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass1));
-                        }
-            }
+                    IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-3, activateClass1));
+                    }
+                }
         }
 
         return cardEffects;

+ 3 - 3
Assets/CardEffect/BT10/Purple/Skullbulkimon_BT10_080.cs

@@ -176,7 +176,7 @@ public class Skullbulkimon_BT10_080 : CEntity_Effect
 
             bool CanSelectPermanentCondition(Permanent permanent)
             {
-                return CardEffectCommons.IsExistOnBattleArea(card);
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
             bool RootCondition(SelectCardEffect.Root root)
@@ -222,12 +222,12 @@ public class Skullbulkimon_BT10_080 : CEntity_Effect
 
                         bool CanUseCondition1(Hashtable hashtable1)
                         {
-                            return CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent);
+                            return CardEffectCommons.CanTriggerOnDeletion(hashtable1, card);
                         }
 
                         bool CanActivateCondition1(Hashtable hashtable1)
                         {
-                            if (CardEffectCommons.IsTopCardInTrashOnDeletion(hashtable1))
+                            if (CardEffectCommons.CanActivateOnDeletion(card))
                             {
                                 if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                                 {

+ 1 - 9
Assets/CardEffect/BT14/Blue/KidoJou_BT14_083.cs

@@ -49,15 +49,7 @@ public class KidoJou_BT14_083 : CEntity_Effect
 
             bool CanActivateCondition(Hashtable hashtable)
             {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
-                {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                    {
-                        return true;
-                    }
-                }
-
-                return false;
+                return CardEffectCommons.IsExistOnBattleArea(card);
             }
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)

+ 3 - 29
Assets/CardEffect/BT15/Blue/Coelamon_BT15_023.cs

@@ -20,7 +20,7 @@ public class Coelamon_BT15_023 : CEntity_Effect
 
             string EffectDiscription()
             {
-                return "[On Play] Trash 2 digivolution card from the bottom of 1 of your opponent's Digimon.";
+                return "[On Play] Trash the bottom 2 digivolution cards of 1 of your opponent's Digimon. Then, if your opponent has no Digimon with digivolution cards, gain 1 memory.";
             }
 
             bool CanSelectPermanentCondition(Permanent permanent)
@@ -33,16 +33,6 @@ public class Coelamon_BT15_023 : CEntity_Effect
                 return false;
             }
 
-            bool PermanentCondition(Permanent permanent)
-            {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
-            }
-
             bool CanUseCondition(Hashtable hashtable)
             {
                 return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
@@ -50,23 +40,7 @@ public class Coelamon_BT15_023 : CEntity_Effect
 
             bool CanActivateCondition(Hashtable hashtable)
             {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
-                {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                    {
-                        return true;
-                    }
-
-                    if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
-                    {
-                        if (card.Owner.CanAddMemory(activateClass))
-                        {
-                            return true;
-                        }
-                    }
-                }
-
-                return false;
+                return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
             }
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
@@ -106,7 +80,7 @@ public class Coelamon_BT15_023 : CEntity_Effect
                     }
                 }
 
-                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
+                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(permanent => permanent.DigivolutionCards.Count > 0) == 0)
                 {
                     yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
                 }

+ 4 - 35
Assets/CardEffect/BT15/Blue/Crabmon_BT15_019.cs

@@ -22,27 +22,12 @@ public class Crabmon_BT15_019 : CEntity_Effect
 
             string EffectDiscription()
             {
-                return "[On Play] Trash 1 digivolution card from the bottom of 1 of your opponent's Digimon.";
+                return "[On Play] Trash the bottom digivolution card of 1 of your opponent's Digimon. Then, if your opponent has no Digimon with digivolution cards, <Draw 1>.";
             }
 
             bool CanSelectPermanentCondition(Permanent permanent)
             {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
-            }
-
-            bool PermanentCondition(Permanent permanent)
-            {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
             bool CanUseCondition(Hashtable hashtable)
@@ -52,23 +37,7 @@ public class Crabmon_BT15_019 : CEntity_Effect
 
             bool CanActivateCondition(Hashtable hashtable)
             {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
-                {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                    {
-                        return true;
-                    }
-
-                    if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
-                    {
-                        if (card.Owner.LibraryCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-                }
-
-                return false;
+                return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
             }
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
@@ -108,7 +77,7 @@ public class Crabmon_BT15_019 : CEntity_Effect
                     }
                 }
 
-                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
+                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(permanent => permanent.DigivolutionCards.Count > 0) == 0)
                 {
                     yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
                 }

+ 5 - 36
Assets/CardEffect/BT15/Blue/Divermon_BT15_028.cs

@@ -15,33 +15,18 @@ public class Divermon_BT15_028 : CEntity_Effect
         if (timing == EffectTiming.OnEnterFieldAnyone)
         {
             ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Trash digivolution cards and play 1 Tamre from hand", CanUseCondition, card);
+            activateClass.SetUpICardEffect("Trash digivolution cards and play 1 Tamer from hand", CanUseCondition, card);
             activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
             cardEffects.Add(activateClass);
 
             string EffectDiscription()
             {
-                return "[On Play] Trash 3 digivolution card from the bottom of 1 of your opponent's Digimon.";
+                return "[On Play] Trash the bottom 3 digivolution cards of 1 of your opponent's Digimon. Then, if your opponent has no Digimon with digivolution cards, you may play 1 blue Tamer card from your hand without paying the cost.";
             }
 
             bool CanSelectPermanentCondition(Permanent permanent)
             {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
-            }
-
-            bool PermanentCondition(Permanent permanent)
-            {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
             bool CanSelectCardCondition(CardSource cardSource)
@@ -67,23 +52,7 @@ public class Divermon_BT15_028 : CEntity_Effect
 
             bool CanActivateCondition(Hashtable hashtable)
             {
-                if (CardEffectCommons.IsExistOnBattleArea(card))
-                {
-                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                    {
-                        return true;
-                    }
-
-                    if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
-                    {
-                        if (card.Owner.HandCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-                }
-
-                return false;
+                return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
             }
 
             IEnumerator ActivateCoroutine(Hashtable _hashtable)
@@ -123,7 +92,7 @@ public class Divermon_BT15_028 : CEntity_Effect
                     }
                 }
 
-                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(PermanentCondition) == 0)
+                if (card.Owner.Enemy.GetBattleAreaDigimons().Count(permanent => permanent.DigivolutionCards.Count > 0) == 0)
                 {
                     if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                     {

+ 1 - 0
Assets/CardEffect/BT17/Yellow/Renamon_BT17_031.cs

@@ -103,6 +103,7 @@ namespace DCGO.CardEffects.BT17
                 activateClass.SetUpICardEffect("When you use an option, an opponent's Digimon gets Sec-1", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("ESS_BT17_031");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 1 - 6
Assets/CardEffect/BT2/Blue/ArcticBlizzard_BT2_094.cs

@@ -26,12 +26,7 @@ public class ArcticBlizzard_BT2_094 : CEntity_Effect
 
             bool CanSelectPermanentCondition(Permanent permanent)
             {
-                if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
-                {
-                    return true;
-                }
-
-                return false;
+                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
             }
 
             bool CanSelectCardCondition(CardSource cardSource)

+ 19 - 5
Assets/CardEffect/EX6/Purple/Ogudomon_EX6_073.cs

@@ -416,17 +416,31 @@ namespace DCGO.CardEffects.EX6
                             maxCount: deleteCount,
                             canNoSelect: false,
                             canEndNotMax: false,
-                            selectPermanentCoroutine: SelectPermanentCoroutine,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Destroy,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: SelectPermanentCoroutine,
+                            mode: SelectPermanentEffect.Mode.Custom,
                             cardEffect: activateClass);
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
 
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    IEnumerator SelectPermanentCoroutine(List<Permanent> permanents)
                     {
-                        deletedPermanents.Add(permanent);
+
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
+                                targetPermanents: permanents, 
+                                activateClass: activateClass, 
+                                successProcess: SuccessProcess, 
+                                failureProcess: null));
+
+                        yield return null;
+                    }
+
+                    IEnumerator SuccessProcess(List<Permanent> permanents)
+                    {
+                        deletedPermanents = permanents;
+
                         yield return null;
                     }
                     #endregion

+ 1 - 0
Assets/CardEffect/EX7/Black/DerBlitz_EX7_070.cs

@@ -17,6 +17,7 @@ namespace DCGO.CardEffects.EX7
                 activateClass.SetUpICardEffect("De-Digivolve 1", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetIsDigimonEffect(false);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()

+ 15 - 16
Assets/CardEffect/EX7/Blue/SummonFrost_EX7_067.cs

@@ -137,22 +137,21 @@ namespace DCGO.CardEffects.EX7
                         }
                     }
 
-                    foreach (Permanent selectedPermanent in card.Owner.Enemy.GetBattleAreaDigimons())
-                    {
-                        if (CanSelectPermanentCondition1(selectedPermanent))
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(
-                                CardEffectCommons.GainCanNotAttack(targetPermanent: selectedPermanent,
-                                    defenderCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                                    activateClass: activateClass, effectName: "Can't Attack"));
-                            
-                            yield return ContinuousController.instance.StartCoroutine(
-                                CardEffectCommons.GainCanNotBlock(targetPermanent: selectedPermanent,
-                                    attackerCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                                    activateClass: activateClass, effectName: "Can't Block"));
-                        }
-
-                    }
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.GainCanNotAttackPlayerEffect(
+                            attackerCondition: CanSelectPermanentCondition1,
+                            defenderCondition: null,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass,
+                            effectName: "Can't Attack"));
+
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.GainCanNotBlockPlayerEffect(
+                            attackerCondition: CanSelectPermanentCondition1,
+                            defenderCondition: null,
+                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                            activateClass: activateClass,
+                            effectName: "Can't Block"));
                 }
             }
             

+ 8 - 4
Assets/CardEffect/P/White/FuturePotential_P_156.cs

@@ -22,7 +22,7 @@ namespace DCGO.CardEffects.P
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return !CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsTamer);
+                    return CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsTamer);
                 }
 
                 bool CardCondition(CardSource cardSource)
@@ -61,10 +61,13 @@ namespace DCGO.CardEffects.P
                     {
                         if (CardEffectCommons.CanPlayAsNewPermanent(source, false, activateClass))
                         {
-                            foreach (CardColor color in source.CardColors)
+                            if(source.GetCostItself <= 3)
                             {
-                                if (tamerColors.Contains(color))
-                                    return true;
+                                foreach (CardColor color in source.CardColors)
+                                {
+                                    if (tamerColors.Contains(color))
+                                        return true;
+                                }
                             }
                         }
                     }
@@ -110,6 +113,7 @@ namespace DCGO.CardEffects.P
                     {
                         if(permanent != null)
                         {
+                            tamerColors = permanent.TopCard.CardColors;
                             List<CardSource> cardOptions = card.Owner.HandCards.Concat(card.Owner.TrashCards).ToList().Filter(SelectDigimonCondition);
                             
                             if (cardOptions.Count > 0)

+ 1 - 1
Assets/Scripts/CardEffectCommons/TrashDigivolutionCards.cs

@@ -21,7 +21,7 @@ public partial class CardEffectCommons
             {
                 if (permanentCondition == null || permanentCondition(permanent))
                 {
-                    if (permanent.DigivolutionCards.Some(CanSelectCardCondition))
+                    if (permanent.DigivolutionCards.Some(CanSelectCardCondition) || permanent.DigivolutionCards.Count == 0)
                     {
                         if (!permanent.TopCard.CanNotBeAffected(activateClass))
                         {