Kaynağa Gözat

Display Guard and Engage in permanent Details

hooperk 1 ay önce
ebeveyn
işleme
04d5fb898a

+ 45 - 0
Assets/Scripts/Script/Permanent.cs

@@ -2849,6 +2849,51 @@ public class Permanent
     }
     #endregion
 
+    #region Has Guard
+    public bool HasGuard
+    {
+        get
+        {
+            foreach (ICardEffect cardEffect in EffectList(EffectTiming.WhenRemoveField))
+            {
+                if (cardEffect is ActivateICardEffect)
+                {
+                    if (cardEffect.EffectName == "Guard")
+                    {
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        }
+    }
+    #endregion
+
+    #region Has Engage
+    public bool HasEngage
+    {
+        get
+        {
+            foreach (ICardEffect cardEffect in EffectList(EffectTiming.OnEndTurn))
+            {
+                if (cardEffect is ActivateICardEffect)
+                {
+                    if (cardEffect.EffectName == "Engage")
+                    {
+                        if (cardEffect.CanTrigger(null))
+                        {
+                            return true;
+                        }
+                    }
+                }
+            }
+
+            return false;
+        }
+    }
+    #endregion
+
     #region Has Fortitude
     public bool HasFortitude
     {

+ 14 - 0
Assets/Scripts/Script/PermanentDetail.cs

@@ -235,6 +235,20 @@ public class PermanentDetail : MonoBehaviour
         }
         #endregion
 
+        #region Guard
+        if (permanent.HasGuard)
+        {
+            effectString += $"- Guard\n";
+        }
+        #endregion
+
+        #region Engage
+        if (permanent.HasEngage)
+        {
+            effectString += $"- Engage\n";
+        }
+        #endregion
+
         #region Security Attack Changes
         if (permanent.HasSecurityAttackChanges)
         {