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

+ 7 - 4
Assets/CardEffect/BT12/Black/BT12_072.cs

@@ -169,13 +169,16 @@ namespace DCGO.CardEffects.BT12
                     {
                         foreach (CardSource cardSource1 in cardSource.PermanentOfThisCard().DigivolutionCards)
                         {
-                            if (cardSource1.EqualsCardName("Machinedramon") || cardSource1.EqualsCardName("Chaosdramon"))
+                            if (!cardSource1.IsFlipped)
                             {
-                                foreach (ICardEffect cardEffect in cardSource1.cEntity_EffectController.GetCardEffects_ExceptAddedEffects(_timing, card))
+                                if (cardSource1.EqualsCardName("Machinedramon") || cardSource1.EqualsCardName("Chaosdramon"))
                                 {
-                                    if (!cardEffect.IsSecurityEffect && !cardEffect.IsInheritedEffect)
+                                    foreach (ICardEffect cardEffect in cardSource1.cEntity_EffectController.GetCardEffects_ExceptAddedEffects(_timing, card))
                                     {
-                                        cardEffects.Add(cardEffect);
+                                        if (!cardEffect.IsSecurityEffect && !cardEffect.IsInheritedEffect)
+                                        {
+                                            cardEffects.Add(cardEffect);
+                                        }
                                     }
                                 }
                             }

+ 1 - 0
Assets/CardEffect/BT12/Purple/BT12_081.cs

@@ -429,6 +429,7 @@ namespace DCGO.CardEffects.BT12
                                                 IEnumerator SelectCardCoroutine(CardSource cardSource)
                                                 {
                                                     selectedCards.Add(cardSource);
+                                                    cardSource.willBeRemoveSources = true;
 
                                                     yield return null;
                                                 }

+ 1 - 1
Assets/CardEffect/BT12/Red/BT12_087.cs

@@ -145,7 +145,7 @@ namespace DCGO.CardEffects.BT12
 
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
-                    return true;
+                    return !cardSource.willBeRemoveSources;
                 }
 
                 bool CanSelectPermanentCondition(Permanent permanent)

+ 4 - 5
Assets/CardEffect/BT14/Blue/BT14_029.cs

@@ -90,10 +90,7 @@ namespace DCGO.CardEffects.BT14
                     {
                         if (CardEffectCommons.IsExistOnBattleArea(card))
                         {
-                            if (permanent.DigivolutionCards.Count >= card.PermanentOfThisCard().DigivolutionCards.Count)
-                            {
-                                return true;
-                            }
+                            return true;
                         }
                     }
 
@@ -122,7 +119,9 @@ namespace DCGO.CardEffects.BT14
                 {
                     Permanent selectedPermanent = card.PermanentOfThisCard();
 
-                    yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
+                    if (selectedPermanent.DigivolutionCards.Count >= card.PermanentOfThisCard().DigivolutionCards.Count)
+                        yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { selectedPermanent }, activateClass).Unsuspend());
+                        
                 }
             }
 

+ 1 - 13
Assets/CardEffect/BT15/Blue/BT15_026.cs

@@ -191,22 +191,10 @@ namespace DCGO.CardEffects.BT15
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        bool CardEffectCondition(ICardEffect cardEffect)
-                        {
-                            if (CardEffectCommons.IsOwnerEffect(cardEffect, card))
-                            {
-                                if (cardEffect.IsDigimonEffect)
-                                {
-                                    return true;
-                                }
-                            }
-                            return false;
-                        }
-
                         if (CardEffectCommons.CanTriggerWhenAddHand(
                             hashtable,
                             player => player == card.Owner,
-                        CardEffectCondition))
+                            cardEffect => cardEffect != null))
                         {
                             return true;
                         }

+ 20 - 23
Assets/CardEffect/BT15/Green/BT15_054.cs

@@ -241,7 +241,7 @@ namespace DCGO.CardEffects.BT15
                         {
                             if (CardEffectCommons.CanTriggerOnMove(hashtable, PermanentCondition))
                             {
-                                return true;
+                                return CardEffectCommons.HasMatchConditionPermanent(PermanentCondition);
                             }
                         }
                     }
@@ -261,29 +261,26 @@ namespace DCGO.CardEffects.BT15
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionPermanent(PermanentCondition))
+                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
+
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: PermanentCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: maxCount,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Tap,
+                        cardEffect: activateClass);
+
+                    if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Rosemon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
                     {
-                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(PermanentCondition));
-
-                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
-
-                        selectPermanentEffect.SetUp(
-                            selectPlayer: card.Owner,
-                            canTargetCondition: PermanentCondition,
-                            canTargetCondition_ByPreSelecetedList: null,
-                            canEndSelectCondition: null,
-                            maxCount: maxCount,
-                            canNoSelect: false,
-                            canEndNotMax: false,
-                            selectPermanentCoroutine: null,
-                            afterSelectPermanentCoroutine: null,
-                            mode: SelectPermanentEffect.Mode.Tap,
-                            cardEffect: activateClass);
-
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.CardNames.Contains("Rosemon") || cardSource.CardNames.Contains("X Antibody") || cardSource.CardNames.Contains("XAntibody")) >= 1)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-                        }
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
                 }
             }

+ 22 - 41
Assets/CardEffect/BT16/Red/BT16_012.cs

@@ -164,7 +164,7 @@ namespace DCGO.CardEffects.BT16
                 {
                     if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
-                        return true;
+                        return CardEffectCommons.IsJogress(hashtable);
                     }
 
                     return false;
@@ -172,53 +172,34 @@ namespace DCGO.CardEffects.BT16
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    bool isJogress = false;
-
-                    if (_hashtable != null)
+                    if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
                     {
-                        if (_hashtable.ContainsKey("isJogress"))
+                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                         {
-                            if (_hashtable["isJogress"] is bool)
-                            {
-                                isJogress = (bool)_hashtable["isJogress"];
-                            }
-                        }
-                    }
+                            int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
 
-                    if (isJogress)
-                    {
-                        if (isExistOnField(card))
-                        {
-                            if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
-                            {
-                                if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                                {
-                                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: false,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
 
-                                    selectPermanentEffect.SetUp(
-                                        selectPlayer: card.Owner,
-                                        canTargetCondition: CanSelectPermanentCondition,
-                                        canTargetCondition_ByPreSelecetedList: null,
-                                        canEndSelectCondition: null,
-                                        maxCount: maxCount,
-                                        canNoSelect: false,
-                                        canEndNotMax: false,
-                                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                                        afterSelectPermanentCoroutine: null,
-                                        mode: SelectPermanentEffect.Mode.Custom,
-                                        cardEffect: activateClass);
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -7000.", "The opponent is selecting 1 Digimon that will get DP -7000.");
 
-                                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -7000.", "The opponent is selecting 1 Digimon that will get DP -7000.");
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
-
-                                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -7000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
-                                    }
-                                }
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -7000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
                             }
                         }
                     }

+ 1 - 0
Assets/CardEffect/BT16/Red/BT16_015.cs

@@ -85,6 +85,7 @@ namespace DCGO.CardEffects.BT16
                         activateEndofAttack.SetHashString($"EndOfAttack_{endOfAttackEffect.EffectSourceCard.CardID}");
                         activateEndofAttack.SetEffectSourceCard(endOfAttackEffect.EffectSourceCard);
                         activateEndofAttack.SetEffectSourcePermanent(card.PermanentOfThisCard());
+                        activateEndofAttack.SetIsDigimonEffect(true);
 
                         bool CanUseEndOfAttackCondition(Hashtable hashtable1)
                         {

+ 15 - 1
Assets/CardEffect/BT17/Blue/BT17_026.cs

@@ -383,7 +383,21 @@ namespace DCGO.CardEffects.BT17
                                                 ignoreDigivolutionRequirementFixedCost: -1,
                                                 isHand: true,
                                                 activateClass: activateClass,
-                                                successProcess: null));
+                                                successProcess: null,
+                                                failedProcess: DigivolvedFailed(),
+                                                isOptional: false));
+                                        }
+                                        else
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                        }
+
+                                        IEnumerator DigivolvedFailed()
+                                        {
+                                            IDiscardHand discard = new IDiscardHand(card, hashtable);
+
+                                            discard.Discard();
+                                            yield return null;
                                         }
 
                                         foreach (Func<EffectTiming, ICardEffect> getCardEffect in getCardEffects)

+ 15 - 1
Assets/CardEffect/BT17/Red/BT17_014.cs

@@ -382,7 +382,21 @@ namespace DCGO.CardEffects.BT17
                                                 ignoreDigivolutionRequirementFixedCost: -1,
                                                 isHand: true,
                                                 activateClass: activateClass,
-                                                successProcess: null));
+                                                successProcess:null,
+                                                failedProcess: DigivolvedFailed(),
+                                                isOptional: false));
+                                        }
+                                        else
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                        }
+
+                                        IEnumerator DigivolvedFailed()
+                                        {
+                                            IDiscardHand discard = new IDiscardHand(card, hashtable);
+
+                                            discard.Discard();
+                                            yield return null;
                                         }
 
                                         foreach (Func<EffectTiming, ICardEffect> getCardEffect in getCardEffects)

+ 19 - 2
Assets/CardEffect/BT18/Black/BT18_070.cs

@@ -218,7 +218,9 @@ namespace DCGO.CardEffects.BT18
 
                             if (digivolve)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(
+                                if (!card.CanNotEvolve(selectedPermanent))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(
                                     CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                         targetPermanent: selectedPermanent,
                                         cardCondition: source => source == card,
@@ -229,7 +231,22 @@ namespace DCGO.CardEffects.BT18
                                         isHand: true,
                                         activateClass: activateClass,
                                         successProcess: null,
-                                        isOptional:false));
+                                        failedProcess: DigivolvedFailed(),
+                                        isOptional: false));
+                                }
+                                else
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                }
+
+                            }
+
+                            IEnumerator DigivolvedFailed()
+                            {
+                                IDiscardHand discard = new IDiscardHand(card, hashtable);
+
+                                discard.Discard();
+                                yield return null;
                             }
                         }
                     }

+ 20 - 2
Assets/CardEffect/BT18/Blue/BT18_026.cs

@@ -217,7 +217,9 @@ namespace DCGO.CardEffects.BT18
 
                             if (digivolve)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(
+                                if (!card.CanNotEvolve(selectedPermanent))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(
                                     CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                         targetPermanent: selectedPermanent,
                                         cardCondition: source => source == card,
@@ -227,7 +229,23 @@ namespace DCGO.CardEffects.BT18
                                         ignoreDigivolutionRequirementFixedCost: 3,
                                         isHand: true,
                                         activateClass: activateClass,
-                                        successProcess: null));
+                                        successProcess: null,
+                                        failedProcess: DigivolvedFailed(),
+                                        isOptional: false));
+                                }
+                                else
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                }
+
+                            }
+
+                            IEnumerator DigivolvedFailed()
+                            {
+                                IDiscardHand discard = new IDiscardHand(card, hashtable);
+
+                                discard.Discard();
+                                yield return null;
                             }
                         }
                     }

+ 21 - 3
Assets/CardEffect/BT18/Green/BT18_053.cs

@@ -217,7 +217,9 @@ namespace DCGO.CardEffects.BT18
 
                             if (digivolve)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(
+                                if (!card.CanNotEvolve(selectedPermanent))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(
                                     CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                         targetPermanent: selectedPermanent,
                                         cardCondition: source => source == card,
@@ -227,7 +229,23 @@ namespace DCGO.CardEffects.BT18
                                         ignoreDigivolutionRequirementFixedCost: 3,
                                         isHand: true,
                                         activateClass: activateClass,
-                                        successProcess: null));
+                                        successProcess: null,
+                                        failedProcess: DigivolvedFailed(),
+                                        isOptional: false));
+                                }
+                                else
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                }
+
+                            }
+
+                            IEnumerator DigivolvedFailed()
+                            {
+                                IDiscardHand discard = new IDiscardHand(card, hashtable);
+
+                                discard.Discard();
+                                yield return null;
                             }
                         }
                     }
@@ -261,7 +279,7 @@ namespace DCGO.CardEffects.BT18
                 string EffectDescription()
                 {
                     return
-                        "[On Play] Suspend 1 of your opponent's Digimon or Tamers. It can't unsuspend until the end of their turn.";
+                        "[When Digivolving] Suspend 1 of your opponent's Digimon or Tamers. It can't unsuspend until the end of their turn.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 10 - 2
Assets/CardEffect/BT18/Purple/BT18_081.cs

@@ -218,7 +218,9 @@ namespace DCGO.CardEffects.BT18
 
                             if (digivolve)
                             {
-                                yield return ContinuousController.instance.StartCoroutine(
+                                if (!card.CanNotEvolve(selectedPermanent))
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine(
                                     CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                         targetPermanent: selectedPermanent,
                                         cardCondition: source => source == card,
@@ -230,7 +232,13 @@ namespace DCGO.CardEffects.BT18
                                         activateClass: activateClass,
                                         successProcess: null,
                                         failedProcess: DigivolvedFailed(),
-                                        isOptional:false));
+                                        isOptional: false));
+                                }
+                                else
+                                {
+                                    yield return ContinuousController.instance.StartCoroutine("DigivolvedFailed");
+                                }
+                                
                             }
 
                             IEnumerator DigivolvedFailed()

+ 1 - 0
Assets/CardEffect/BT7/Purple/BT7_091.cs

@@ -92,6 +92,7 @@ public class BT7_091 : CEntity_Effect
             activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
             activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
             activateClass.SetIsInheritedEffect(true);
+            activateClass.SetIsDigimonEffect(true);
             cardEffects.Add(activateClass);
 
             string EffectDiscription()

+ 2 - 5
Assets/CardEffect/EX6/White/EX6_072.cs

@@ -105,11 +105,8 @@ namespace DCGO.CardEffects.EX6
 
                             if (elements[i].EvoRootCondition(permanent))
                             {
-                                if(selectedLevel7.CanEvolve(permanent, true))
-                                {
-                                    allowedPermanents.Add(permanent);
-                                    added = true;
-                                }
+                                allowedPermanents.Add(permanent);
+                                added = true;
                             }
                         }
 

+ 1 - 1
Assets/Scripts/CardController.cs

@@ -1201,7 +1201,7 @@ public class PlayPermanentClass
                 _assemblyCount = GManager.instance.GetComponent<SelectAssemblyClass>().selectedAssemblyCards.Count;
             }
 
-            bool isFromDigimonDigivolutionCards = card.Owner.GetBattleAreaDigimons().Some((permanent) => permanent.DigivolutionCards.Contains(card));
+            bool isFromDigimonDigivolutionCards = card.Owner.GetFieldPermanents().Some((permanent) => permanent.DigivolutionCards.Contains(card));
 
             bool isFromSecurity = card.Owner.SecurityCards.Contains(card);