Преглед изворни кода

Add IsPermanentExistsOnBattleAreaDigimon function

Andrej Erdelsky пре 2 година
родитељ
комит
14d94d4ffc

+ 1 - 2
Assets/CardEffect/EX7/Black/Tortomon_EX7_041.cs

@@ -1,4 +1,3 @@
-using System.Collections;
 using System.Collections.Generic;
 
 namespace DCGO.CardEffects.EX7
@@ -57,7 +56,7 @@ namespace DCGO.CardEffects.EX7
 
                 bool CanUseCondition()
                 {
-                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
                            CardEffectCommons.IsOpponentTurn(card);
                 }
 

+ 1 - 2
Assets/CardEffect/EX7/Green/Zephagamon_EX7_036.cs

@@ -33,8 +33,7 @@ namespace DCGO.CardEffects.EX7
 
             bool CanSelectPermanentSharedCondition(Permanent permanent)
             {
-                return CardEffectCommons.IsPermanentExistsOnBattleArea(permanent) &&
-                       permanent.IsDigimon;
+                return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent);
             }
 
             bool CanSelectSuspendedPermanentSharedCondition(Permanent permanent)

+ 15 - 0
Assets/Scripts/CardEffectCommons/GameContextDeterminarion.cs

@@ -271,6 +271,21 @@ public partial class CardEffectCommons
         return false;
     }
     #endregion
+    
+    #region Whether the permanent is Digimon and in the card's owner's Battle Area
+    public static bool IsPermanentExistsOnBattleAreaDigimon(Permanent permanent)
+    {
+        if (IsPermanentExistsOnBattleArea(permanent))
+        {
+            if (permanent.IsDigimon)
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+    #endregion
 
     #region Whether the permanent is Digimon and in the card's owner's Battle Area
     public static bool IsPermanentExistsOnOwnerBattleAreaDigimon(Permanent permanent, CardSource card)