Ver Fonte

Card Updates for 1.8.2.10

mbunch_kascope há 1 ano atrás
pai
commit
34d0c45067

+ 16 - 15
Assets/CardEffect/BT21/Purple/BT21_074.cs

@@ -75,24 +75,25 @@ namespace DCGO.CardEffects.BT21
                 return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && !permanent.IsToken;
             }
 
-            void ActivateDeDigivolveProtection()
+            void ActivateDeDigivolveProtection(Permanent selectedPermanent)
             {
+                bool CanUseImmunityCondition(Hashtable hashtable1)
+                {
+                    return selectedPermanent.TopCard != null;
+                }
+
+                bool PermanentImmunityCondition(Permanent permanent)
+                {
+                    return permanent == selectedPermanent;
+                }
+
                 ImmuneFromDeDigivolveClass immuneFromDeDigivolveClass = new ImmuneFromDeDigivolveClass();
                 immuneFromDeDigivolveClass.SetUpICardEffect("Isn't affected by <De-Digivolve>", CanUseImmunityCondition,
-                    card.PermanentOfThisCard().TopCard);
+                    selectedPermanent.TopCard);
                 immuneFromDeDigivolveClass.SetUpImmuneFromDeDigivolveClass(PermanentCondition: PermanentImmunityCondition);
-                card.PermanentOfThisCard().UntilOpponentTurnEndEffects.Add(_ => immuneFromDeDigivolveClass);
-            }
-
-            bool CanUseImmunityCondition(Hashtable hashtable1)
-            {
-                return card.PermanentOfThisCard().TopCard != null;
-            }
-
-            bool PermanentImmunityCondition(Permanent permanent)
-            {
-                return permanent == card.PermanentOfThisCard();
+                selectedPermanent.UntilOpponentTurnEndEffects.Add(_ => immuneFromDeDigivolveClass);
             }
+            
             #endregion
 
             #region On Play
@@ -264,7 +265,7 @@ namespace DCGO.CardEffects.BT21
                                     activateClass: activateClass,
                                     effectName: "Can't return to deck by opponent's effects"));
 
-                                ActivateDeDigivolveProtection();
+                                ActivateDeDigivolveProtection(selectedPermanent);
                                 #endregion
                             }
                         }
@@ -443,7 +444,7 @@ namespace DCGO.CardEffects.BT21
                                     activateClass: activateClass,
                                     effectName: "Can't return to deck by opponent's effects"));
 
-                                ActivateDeDigivolveProtection();
+                                ActivateDeDigivolveProtection(selectedPermanent);
                                 #endregion
                             }
                         }

+ 12 - 8
Assets/CardEffect/BT21/Red/BT21_013.cs

@@ -112,15 +112,18 @@ namespace DCGO.CardEffects.BT21
 
                 bool CanSelectPermanent(Permanent permanent)
                 {
-                    if (permanent == card.PermanentOfThisCard())
+                    if(CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
                     {
-                        return true;
-                    }
+                        if (permanent == card.PermanentOfThisCard())
+                        {
+                            return true;
+                        }
 
-                    if (permanent.TopCard.CardColors.Contains(CardColor.Red) && permanent.IsTamer && permanent.TopCard.HasInheritedEffect)
-                    {
-                        return true;
-                    }
+                        if (permanent.TopCard.CardColors.Contains(CardColor.Red) && permanent.IsTamer && permanent.TopCard.HasInheritedEffect)
+                        {
+                            return true;
+                        }
+                    }                    
 
                     return false;
                 }
@@ -128,6 +131,8 @@ namespace DCGO.CardEffects.BT21
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     Permanent selectedPermanent = null;
+                    CardSource selectedCard = null;
+
                     int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanent));
 
                     SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
@@ -237,7 +242,6 @@ namespace DCGO.CardEffects.BT21
                                 yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
                             }
 
-                            CardSource selectedCard = null;
 
                             IEnumerator SelectCardCoroutine(CardSource cardSource)
                             {

+ 5 - 2
Assets/CardEffect/BT21/Red/BT21_014.cs

@@ -164,9 +164,12 @@ namespace DCGO.CardEffects.BT21
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, PlayerCondition))
+                        if (CardEffectCommons.IsOwnerTurn(card))
                         {
-                            return true;
+                            if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, PlayerCondition))
+                            {
+                                return true;
+                            }
                         }
                     }
                     return false;

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

@@ -12,12 +12,12 @@ namespace DCGO.CardEffects.BT21
 
             #region Static effects
 
-            #region Alternative Digivolution Condition - Stand.
+            #region Alternative Digivolution Condition - Stnd.
             if (timing == EffectTiming.None)
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.EqualsTraits("Stand.");
+                    return targetPermanent.TopCard.EqualsTraits("Stnd.");
                 }
 
                 cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false, card: card, condition: null));

+ 1 - 1
Assets/CardEffect/BT21/Red/BT21_083.cs

@@ -94,7 +94,7 @@ namespace DCGO.CardEffects.BT21
 
                         if (selectedCard != null)
                         {
-                            card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass);
+                            yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass));
 
                             yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
 

+ 2 - 1
Assets/CardEffect/BT21/Yellow/BT21_086.cs

@@ -81,7 +81,8 @@ namespace DCGO.CardEffects.BT21
 
                 bool CanSelectMarcus(Permanent permanent)
                 {
-                    return permanent.TopCard.EqualsCardName("Marcus Damon");
+                    return CardEffectCommons.IsOwnerPermanent(permanent, card) && 
+                           permanent.TopCard.EqualsCardName("Marcus Damon");
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 12 - 6
Assets/CardEffect/LM/Blue/LM_041.cs

@@ -263,9 +263,12 @@ namespace DCGO.CardEffects.LM
                             yield return null;
                         }
 
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
-                                targetPermanent: selectedPermanent,
-                                activateClass: activateClass
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotSuspendPlayerEffect(
+                                permanentCondition: (permanent) => permanent == selectedPermanent,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass,
+                                isOnlyActivePhase: false,
+                                effectName: "Can't Suspend"
                             ));
                     }
                 }
@@ -359,9 +362,12 @@ namespace DCGO.CardEffects.LM
                             yield return null;
                         }
 
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
-                                targetPermanent: selectedPermanent,
-                                activateClass: activateClass
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotSuspendPlayerEffect(
+                                permanentCondition: (permanent) => permanent == selectedPermanent,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass,
+                                isOnlyActivePhase: false,
+                                effectName: "Can't Suspend"
                             ));
                     }
                 }

+ 1 - 1
Assets/CardEffect/LM/Green/LM_042.cs

@@ -208,7 +208,7 @@ namespace DCGO.CardEffects.LM
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Suspend 1 digimon", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 9 - 9
Assets/CardEffect/LM/Red/LM_039.cs

@@ -156,12 +156,12 @@ namespace DCGO.CardEffects.LM
                                 bottomdecked = true;
                                 yield return null;
                             }
-                        }
+                        }                        
+                    }
 
-                        if (!bottomdecked)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
-                        }
+                    if (!bottomdecked)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
                     }
                 }
             }
@@ -255,11 +255,11 @@ namespace DCGO.CardEffects.LM
                                 yield return null;
                             }
                         }
+                    }
 
-                        if (!bottomdecked)
-                        {
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
-                        }
+                    if (!bottomdecked)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonSAttack(targetPermanent: card.PermanentOfThisCard(), changeValue: 1, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
                     }
                 }
             }

+ 1 - 1
Assets/CardEffect/P/Red/P_182.cs

@@ -146,7 +146,7 @@ namespace DCGO.CardEffects.P
 
             #region All Turns
 
-            if (timing == EffectTiming.OnEnterFieldAnyone || timing == EffectTiming.WhenRemoveField)
+            if (timing == EffectTiming.OnEnterFieldAnyone || timing == EffectTiming.AfterEffectsActivate)
             {
                 if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                 {

+ 8 - 2
Assets/Scripts/CardController.cs

@@ -272,7 +272,7 @@ public class PlayCardClass
         return false;
     }
 
-    CardSource LinkedCard(CardSource card)
+    public CardSource LinkedCard(CardSource card)
     {
         if (_appFusionFrameIDs != null && _appFusionFrameIDs.Length == 2)
         {
@@ -308,6 +308,7 @@ public class PlayCardClass
                 continue;
             }
 
+            #region Set Root
             ICardEffect CardEffect = null;
 
             CardEffect = CardEffectCommons.GetCardEffectFromHashtable(this._hashtable);
@@ -340,7 +341,9 @@ public class PlayCardClass
             {
                 Root = SelectCardEffect.Root.Execution;
             }
+            #endregion
 
+            #region Set target(s)
             List<Permanent> targetPermanents = new List<Permanent>();
 
             if (card.IsPermanent)
@@ -372,7 +375,9 @@ public class PlayCardClass
                     }
                 }
             }
+            #endregion
 
+            #region Determine if Evolution
             bool isEvolution = false;
 
             if (targetPermanents.Count >= 1)
@@ -410,6 +415,7 @@ public class PlayCardClass
                     }
                 }
             }
+            #endregion
 
             List<CardSource> oldTrashCards = new List<CardSource>();
 
@@ -741,7 +747,7 @@ public class PlayCardClass
             #endregion
 
             #region Add Link Card of App Fusion
-
+            UnityEngine.Debug.Log($"PLAYING CARD: {IsAppFusion(card)}");
             if (IsAppFusion(card))
             {
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectAppFusionEffect.AddToSources(LinkedCard(card)));

+ 3 - 2
Assets/Scripts/CardEffectCommons/KeyWordEffects/Execute.cs

@@ -65,18 +65,19 @@ public partial class CardEffectCommons
                 defenderCondition: _ => true,
                 cardEffect: activateClass);
 
+            selectAttackEffect.SetAfterOnAttackCoroutine(AfterAttackCoroutine);
+
             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
 
             #endregion
 
             #region Delete this Digimon
 
-            if(GManager.instance.attackProcess.IsAttacking && GManager.instance.attackProcess.AttackingPermanent.Equals(selectedPermanent))
+            IEnumerator AfterAttackCoroutine()
             {
                 yield return ContinuousController.instance.StartCoroutine(
                     new DestroyPermanentsClass(new List<Permanent>() { selectedPermanent }, CardEffectHashtable(activateClass)).Destroy());
             }
-                
 
             #endregion
         }

+ 1 - 0
Assets/Scripts/CardEffectFactory/KeyWordEffects/Progress.cs

@@ -47,6 +47,7 @@ public partial class CardEffectFactory
         activateClass.SetUpICardEffect("Progress", CanUseCondition, card);
         activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
         activateClass.SetIsInheritedEffect(isInheritedEffect);
+        activateClass.SetIsBackgroundProcess(true);
 
         string EffectDiscription()
         {

+ 1 - 1
Assets/Scripts/CardEffectFactory/KeyWordEffects/Scapegoat.cs

@@ -62,7 +62,7 @@ public partial class CardEffectFactory
 
         bool CanUseCondition(Hashtable hashtable)
         {
-            bool CardEffectCondition(ICardEffect cardEffect) => CardEffectCommons.IsOwnerEffect(cardEffect,cardEffect.EffectSourceCard);
+            bool CardEffectCondition(ICardEffect cardEffect) => CardEffectCommons.IsOwnerEffect(cardEffect,card);
 
             if (CardEffectCommons.IsPermanentExistsOnBattleArea(targetPermanent))
             {

+ 0 - 2
Assets/Scripts/Permanent.cs

@@ -1087,14 +1087,12 @@ public class Permanent
     #region Remove Linked Card
     public IEnumerator RemoveLinkedCard(CardSource cardSource, int removeCount = 0)
     {
-        Debug.Log($"REMOVE LINK CARD: {LinkedCards.Count} >= {LinkedCards.Contains(cardSource)}");
         if (LinkedCards.Contains(cardSource))
         {
             LinkedDP -= cardSource.LinkDP;
             yield return ContinuousController.instance.StartCoroutine(RemoveCardSource(cardSource));
             yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddTrashCard(cardSource));
             LinkedCards.Remove(cardSource);
-            Debug.Log($"REMOVE LINK CARD: {cardSource}");
         }
 
         if(removeCount > 0)

+ 10 - 0
Assets/Scripts/SelectAttackEffect.cs

@@ -25,6 +25,7 @@ public class SelectAttackEffect : MonoBehaviourPunCallbacks
         _customMessage = null;
         _customMessage_Enemy = null;
         _beforeOnAttackCoroutine = null;
+        _afterOnAttackCoroutine = null;
     }
 
     public void SetUpCustomMessage(string customMessage, string customMessage_Enemy)
@@ -53,6 +54,11 @@ public class SelectAttackEffect : MonoBehaviourPunCallbacks
         _beforeOnAttackCoroutine = beforeOnAttackCoroutine;
     }
 
+    public void SetAfterOnAttackCoroutine(Func<IEnumerator> afterOnAttackCoroutine)
+    {
+        _afterOnAttackCoroutine = afterOnAttackCoroutine;
+    }
+
     Permanent _attacker = null;
     Func<bool> _canAttackPlayerCondition = null;
     Func<Permanent, bool> _defenderCondition = null;
@@ -69,6 +75,7 @@ public class SelectAttackEffect : MonoBehaviourPunCallbacks
     Permanent _defender = null;
     ICardEffect _cardEffect = null;
     Func<IEnumerator> _beforeOnAttackCoroutine = null;
+    Func<IEnumerator> _afterOnAttackCoroutine = null;
 
     #region ƒp[ƒ}ƒlƒ“ƒg‚ð‘I‘ð‚Å‚«‚é‚©
     bool CanTarget(Permanent permanent)
@@ -495,6 +502,9 @@ public class SelectAttackEffect : MonoBehaviourPunCallbacks
                 if (CanEndSelect(_defender))
                 {
                     yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.Attack(_attacker, _defender, _cardEffect, _withoutTap, _beforeOnAttackCoroutine));
+
+                    if(_afterOnAttackCoroutine != null)
+                        yield return ContinuousController.instance.StartCoroutine(_afterOnAttackCoroutine());
                 }
             }
         }