فهرست منبع

Add EngageSelfEffect

hooperk 2 ماه پیش
والد
کامیت
df2f64924f

+ 1 - 1
Assets/Scripts/Script/CardEffectCommons/KeyWordEffects/Engage.cs

@@ -51,7 +51,7 @@ public partial class CardEffectCommons
             isInheritedEffect: false,
             condition: CanUseCondition,
             rootCardEffect: activateClass,
-            card: targetPermanent.TopCard);
+            card: card);
 
         AddEffectToPermanent(
             targetPermanent: targetPermanent,

+ 18 - 2
Assets/Scripts/Script/CardEffectFactory/KeyWordEffects/Engage.cs

@@ -4,14 +4,30 @@ using System.Collections.Generic;
 
 public partial class CardEffectFactory
 {
-    #region Trigger effect of [Engage]
+    #region [Engage] self effect
+    public static ActivateClass EngageSelfStaticEffect(bool isInheritedEffect, CardSource card, Func<bool> condition, bool isLinkedEffect = false)
+    {
+        return EngageEffect(
+            targetPermanent: card.PermanentOfThisCard(),
+            isInheritedEffect,
+            condition,
+            rootCardEffect: null,
+            card,
+            beforeOnAttackCoroutine: null,
+            isLinkedEffect
+        );
+    }
+    #endregion
+
+    #region [Engage] effect
     public static ActivateClass EngageEffect(
         Permanent targetPermanent,
         bool isInheritedEffect,
         Func<bool> condition,
         ICardEffect rootCardEffect,
         CardSource card,
-        Func<IEnumerator> beforeOnAttackCoroutine = null)
+        Func<IEnumerator> beforeOnAttackCoroutine = null,
+        bool isLinkedEffect = false)
     {
         if (targetPermanent == null) return null;
         if (targetPermanent.TopCard == null) return null;