Pārlūkot izejas kodu

Fix 3M trashed effects treated as Digimon Effects

hooperk 5 mēneši atpakaļ
vecāks
revīzija
166820d3c5

+ 1 - 1
Assets/Scripts/CardEffect/EX7/Black/EX7_070.cs

@@ -17,7 +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);
+                activateClass.SetIsOptionEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()

+ 1 - 0
Assets/Scripts/CardEffect/EX7/Purple/EX7_071.cs

@@ -18,6 +18,7 @@ namespace DCGO.CardEffects.EX7
                 activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetIsOptionEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 1 - 0
Assets/Scripts/CardEffect/EX7/Red/EX7_066.cs

@@ -20,6 +20,7 @@ namespace DCGO.CardEffects.EX7
                 activateClass.SetUpICardEffect("+3000DP", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetIsOptionEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 1 - 0
Assets/Scripts/CardEffect/P/Red/P_180.cs

@@ -46,6 +46,7 @@ namespace DCGO.CardEffects.P
                 activateClass.SetUpICardEffect("Delete 1 digimon with 7k DP or lower", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 activateClass.SetIsInheritedEffect(true);
+                activateClass.SetIsOptionEffect(true);
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()

+ 28 - 25
Assets/Scripts/Script/AutoProcessing.cs

@@ -64,42 +64,45 @@ public class AutoProcessing : MonoBehaviourPunCallbacks
         CardSource card = skillInfo.CardEffect.EffectSourceCard;
         Permanent permanent = card.PermanentOfThisCard();
 
-        //Inherited and Link effects can only ever be digimon effects
-        if (skillInfo.CardEffect.IsInheritedEffect || skillInfo.CardEffect.IsLinkedEffect)
+        if (!skillInfo.CardEffect.IsOptionEffect) //If explicitly set to be an option effect, override setting it to any other kind
         {
-            skillInfo.CardEffect.SetIsDigimonEffect(true);
-        }
-        else
-        {
-            #region set the flag whether it is Digimon's effect
-            if (permanent != null)
+            //Inherited and Link effects can only ever be digimon effects
+            if (skillInfo.CardEffect.IsInheritedEffect || skillInfo.CardEffect.IsLinkedEffect)
+            {
+                skillInfo.CardEffect.SetIsDigimonEffect(true);
+            }
+            else
             {
-                if (permanent.IsDigimon)
+                #region set the flag whether it is Digimon's effect
+                if (permanent != null)
+                {
+                    if (permanent.IsDigimon)
+                    {
+                        skillInfo.CardEffect.SetIsDigimonEffect(true);
+                    }
+                }
+
+                if (card == GManager.instance.attackProcess.SecurityDigimon)
                 {
                     skillInfo.CardEffect.SetIsDigimonEffect(true);
                 }
-            }
+                #endregion
 
-            if (card == GManager.instance.attackProcess.SecurityDigimon)
-            {
-                skillInfo.CardEffect.SetIsDigimonEffect(true);
-            }
-            #endregion
+                #region set the flag whether it is Tamer's effect
+                if (permanent != null)
+                {
+                    if (permanent.IsTamer)
+                    {
+                        skillInfo.CardEffect.SetIsTamerEffect(true);
+                    }
+                }
 
-            #region set the flag whether it is Tamer's effect
-            if (permanent != null)
-            {
-                if (permanent.IsTamer)
+                else if (card.IsTamer)
                 {
                     skillInfo.CardEffect.SetIsTamerEffect(true);
                 }
+                #endregion
             }
-
-            else if (card.IsTamer)
-            {
-                skillInfo.CardEffect.SetIsTamerEffect(true);
-            }
-            #endregion
         }
 
         #region set permanent and topCard when triggered

+ 18 - 13
Assets/Scripts/Script/ICardEffect.cs

@@ -35,22 +35,10 @@ public abstract class ICardEffect
         SetIsCounterEffect(false);
         SetIsDigimonEffect(false);
         SetIsTamerEffect(false);
+        SetIsOptionEffect(false);
         SetChainActivationCount(-1);
         SetIsBackgroundProcess(false);
         SetNotShowUI(false);
-
-        if (!(this is ActivateICardEffect))
-        {
-            if (IsInheritedEffect || IsLinkedEffect)
-            {
-                SetIsDigimonEffect(true);
-            }
-            else if (card != null && CardEffectCommons.IsExistOnBattleArea(card))
-            {
-                SetIsDigimonEffect(card.PermanentOfThisCard().IsDigimon);
-                SetIsTamerEffect(card.PermanentOfThisCard().IsTamer);
-            }
-        }
     }
 
     #endregion
@@ -633,6 +621,23 @@ public abstract class ICardEffect
 
     #endregion
 
+    #region Whether this is specifically an Option Card effect, overriding anything settign it as a Digimon or Tamer effect
+
+    bool _isOptionEffect = false;
+
+    public bool IsOptionEffect
+    {
+        get { return _isOptionEffect; }
+        private set { _isOptionEffect = value; }
+    }
+
+    public void SetIsOptionEffect(bool isOptionEffect)
+    {
+        IsOptionEffect = isOptionEffect;
+    }
+
+    #endregion
+
     #region How many times this effect can activate per chain
 
     int _chainActivations = -1;

+ 17 - 14
Assets/Scripts/Script/MultipleSkills.cs

@@ -92,26 +92,29 @@ public class MultipleSkills : MonoBehaviourPunCallbacks
 
                         if (card != null)
                         {
-                            if (skillInfo.CardEffect.IsInheritedEffect || skillInfo.CardEffect.IsLinkedEffect)
+                            if (!skillInfo.CardEffect.IsDigimonEffect)
                             {
-                                skillInfo.CardEffect.SetIsDigimonEffect(true);
-                            }
-                            else
-                            {
-                                if (card.PermanentOfThisCard() != null)
+                                if (skillInfo.CardEffect.IsInheritedEffect || skillInfo.CardEffect.IsLinkedEffect)
                                 {
-                                    skillInfo.CardEffect.SetIsDigimonEffect(card.PermanentOfThisCard().IsDigimon);
-                                    skillInfo.CardEffect.SetIsTamerEffect(card.PermanentOfThisCard().IsTamer);
+                                    skillInfo.CardEffect.SetIsDigimonEffect(true);
                                 }
-
                                 else
                                 {
-                                    skillInfo.CardEffect.SetIsTamerEffect(card.IsTamer);
-                                }
+                                    if (card.PermanentOfThisCard() != null)
+                                    {
+                                        skillInfo.CardEffect.SetIsDigimonEffect(card.PermanentOfThisCard().IsDigimon);
+                                        skillInfo.CardEffect.SetIsTamerEffect(card.PermanentOfThisCard().IsTamer);
+                                    }
 
-                                if (card == GManager.instance.attackProcess.SecurityDigimon)
-                                {
-                                    skillInfo.CardEffect.SetIsDigimonEffect(true);
+                                    else
+                                    {
+                                        skillInfo.CardEffect.SetIsTamerEffect(card.IsTamer);
+                                    }
+
+                                    if (card == GManager.instance.attackProcess.SecurityDigimon)
+                                    {
+                                        skillInfo.CardEffect.SetIsDigimonEffect(true);
+                                    }
                                 }
                             }
                         }