Pārlūkot izejas kodu

Fix BT7-091 inherited effect not counted as digimon effect

hooperk 5 mēneši atpakaļ
vecāks
revīzija
85b580fb7c

+ 27 - 19
Assets/Scripts/Script/AutoProcessing.cs

@@ -64,36 +64,44 @@ public class AutoProcessing : MonoBehaviourPunCallbacks
         CardSource card = skillInfo.CardEffect.EffectSourceCard;
         Permanent permanent = card.PermanentOfThisCard();
 
-        #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
         ((ActivateICardEffect)skillInfo.CardEffect).PermanentWhenTriggered = permanent;
 

+ 9 - 2
Assets/Scripts/Script/ICardEffect.cs

@@ -40,8 +40,15 @@ public abstract class ICardEffect
 
         if (!(this is ActivateICardEffect))
         {
-            SetIsDigimonEffect(card != null && CardEffectCommons.IsExistOnBattleArea(card) && card.PermanentOfThisCard().IsDigimon);
-            SetIsTamerEffect(card != null && CardEffectCommons.IsExistOnBattleArea(card) && card.PermanentOfThisCard().IsTamer);
+            if (IsInheritedEffect || IsLinkedEffect)
+            {
+                SetIsDigimonEffect(true);
+            }
+            else if (card != null && CardEffectCommons.IsExistOnBattleArea(card))
+            {
+                SetIsDigimonEffect(card.PermanentOfThisCard().IsDigimon);
+                SetIsTamerEffect(card.PermanentOfThisCard().IsTamer);
+            }
         }
     }
 

+ 16 - 9
Assets/Scripts/Script/MultipleSkills.cs

@@ -92,20 +92,27 @@ public class MultipleSkills : MonoBehaviourPunCallbacks
 
                         if (card != null)
                         {
-                            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);
+                                }
                             }
                         }
                     }