Ver Fonte

Made work with multiple counts, testing ess works

mbunch_kascope há 1 ano atrás
pai
commit
5f39bfde51

+ 10 - 0
Assets/CardEffect/BT21/BT1_027.cs

@@ -14,6 +14,16 @@ namespace DCGO.CardEffects.BT1
                 cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000));
             }
 
+            if(timing == EffectTiming.None)
+            {
+                bool CanUseCondition()
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.BlockerStaticEffect(permanentCondition: null, isInheritedEffect: true, card: card, condition: CanUseCondition));
+            }
+
             return cardEffects;
         }
     }

+ 3 - 3
Assets/Scripts/FieldPermanentCard.cs

@@ -523,12 +523,12 @@ public class FieldPermanentCard : MonoBehaviour
 
             if (LinkedDPText != null)
             {
-                if (ThisPermanent.LinkedCard != null)
+                if (ThisPermanent.LinkedCards.Count > 0)
                 {
                     LinkedDPText.transform.parent.gameObject.SetActive(true);
 
-                    if (LinkedDPText.text != $"+{2000}")
-                        LinkedDPText.text = $"+{2000}";
+                    if (LinkedDPText.text != $"+{ThisPermanent.LinkedDP}")
+                        LinkedDPText.text = $"+{ThisPermanent.LinkedDP}";
                 }
 
                 else

+ 25 - 8
Assets/Scripts/Permanent.cs

@@ -631,11 +631,24 @@ public class Permanent
     #endregion
 
     #region Digivolution Cards
-    public List<CardSource> DigivolutionCards => cardSources.Filter(cardSource => cardSource != TopCard);
+    public List<CardSource> DigivolutionCards => cardSources.Filter(cardSource => cardSource != TopCard || LinkedCards.Any(linked => linked.Source == cardSource));
     #endregion
 
-    #region Linked Card
-    public CardSource LinkedCard = null;
+    #region Linked Cards
+    public int LinkedMax { get; set; } = 1;
+    public struct LinkCard
+    {
+        public LinkCard(int dp, CardSource source)
+        {
+            DP = dp;
+            Source = source;
+        }
+
+        public int DP { get; }
+        public CardSource Source { get; }
+    }
+
+    public List<LinkCard> LinkedCards = new List<LinkCard>();
     #endregion
 
     #region Add Card Source
@@ -812,7 +825,7 @@ public class Permanent
     {
         yield return null;
 
-        if (LinkedCard != null)
+        if(LinkedCards.Count >= LinkedMax)
             RemoveLinkedCard(null);
 
         yield return ContinuousController.instance.StartCoroutine(CardObjectController.RemoveFromAllArea(cardSource));
@@ -822,8 +835,11 @@ public class Permanent
             yield return ContinuousController.instance.StartCoroutine(ShowingPermanentCard.ShowAddDigivolutionCardEffect());
         }
 
-        LinkedCard = cardSource;
-        LinkedDP = DP;
+        LinkedCards.Insert(0, new LinkCard(0,cardSource));
+        LinkedDP += DP;
+
+        cardSources.Insert(1, cardSource);
+        cardSource.SetFace();
     }
     #endregion
 
@@ -833,7 +849,6 @@ public class Permanent
         yield return null;
 
         cardSources.Remove(cardSource);
-        LinkedDP = 0;
     }
     #endregion
 
@@ -843,7 +858,9 @@ public class Permanent
         //TODO: Add event call if something was removed
         yield return null;
 
-        LinkedCard = null;
+        LinkedDP -= LinkedCards[0].DP;
+        RemoveCardSource(LinkedCards[0].Source);
+        LinkedCards.RemoveAt(0);
     }
     #endregion