Przeglądaj źródła

updating link, pay cost, DP boost, adding possible conditions

mbunch_kascope 1 rok temu
rodzic
commit
6d76061f03

+ 2 - 2
Assets/CardBaseEntity/BT1/Blue/Digimon/BT1_027.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
 version https://git-lfs.github.com/spec/v1
-oid sha256:1b554a09474fb1f0e3099ab2d19cf6e0c765923f1700b6040eba70aa2639f20f
-size 1134
+oid sha256:6d72763a95c3bdedc652d59b638091130975660c0e138d4dcd7998c4db5d7abb
+size 1141

+ 1 - 1
Assets/CardEffect/BT21/BT1_027.cs

@@ -11,7 +11,7 @@ namespace DCGO.CardEffects.BT1
 
 
             if (timing == EffectTiming.OnDeclaration)
             if (timing == EffectTiming.OnDeclaration)
             {
             {
-                cardEffects.Add(CardEffectFactory.LinkEffect(card, null, null));
+                cardEffects.Add(CardEffectFactory.LinkEffect(card, 1, 2000));
             }
             }
 
 
             return cardEffects;
             return cardEffects;

+ 3 - 1
Assets/Scripts/CardController.cs

@@ -2529,6 +2529,7 @@ public class ILinkPermanentToPermanent
 {
 {
     public ILinkPermanentToPermanent(
     public ILinkPermanentToPermanent(
         List<Permanent[]> permanentArrays,
         List<Permanent[]> permanentArrays,
+        int DP,
         ICardEffect cardEffect)
         ICardEffect cardEffect)
     {
     {
         permanentArrays.Clone().ForEach(permanentArray => _permanentArrays.Add(permanentArray.CloneArray()));
         permanentArrays.Clone().ForEach(permanentArray => _permanentArrays.Add(permanentArray.CloneArray()));
@@ -2541,6 +2542,7 @@ public class ILinkPermanentToPermanent
     }
     }
 
 
     List<Permanent[]> _permanentArrays = new List<Permanent[]>();
     List<Permanent[]> _permanentArrays = new List<Permanent[]>();
+    int _DP = 0;
     ICardEffect _cardEffect = null;
     ICardEffect _cardEffect = null;
     bool _notShowCards = false;
     bool _notShowCards = false;
     public bool Linked { get; private set; } = false;
     public bool Linked { get; private set; } = false;
@@ -2743,7 +2745,7 @@ public class ILinkPermanentToPermanent
                         LinkPermanent,
                         LinkPermanent,
                         ignoreOverflow: true));
                         ignoreOverflow: true));
 
 
-                    yield return ContinuousController.instance.StartCoroutine(LinkedPermanent.AddLinkedCard(cardSource, _cardEffect));
+                    yield return ContinuousController.instance.StartCoroutine(LinkedPermanent.AddLinkedCard(cardSource, _DP, _cardEffect));
 
 
                     cardSource.cEntity_EffectController.InitUseCountThisTurn();
                     cardSource.cEntity_EffectController.InitUseCountThisTurn();
 
 

+ 17 - 3
Assets/Scripts/CardEffectFactory/KeyWordEffects/Link.cs

@@ -7,10 +7,21 @@ using UnityEngine;
 public partial class CardEffectFactory
 public partial class CardEffectFactory
 {
 {
     #region Trigger effect of Link
     #region Trigger effect of Link
-    public static ActivateClass LinkEffect(CardSource card, Func<bool> condition, Func<Permanent, bool> digimonCondition)
+    /// <summary>
+    /// Linking 1 digimon in hand/field to another digimon
+    /// </summary>
+    /// <param name="CardSource">card being linked</param>
+    /// <param name="int">cost for link</param>
+    /// <param name="int">DP buff</param>
+    /// <param name="Func(bool)">condition for you to be able to link</param>
+    /// <param name="Func(Permanent,bool)">Any permaent condtion for you to link to</param>
+    /// <author>Mike Bunch</author>
+    public static ActivateClass LinkEffect(CardSource card, int cost, int dp, Func<bool> condition = null, Func<Permanent, bool> digimonCondition = null)
     {
     {
         if (card == null) return null;
         if (card == null) return null;
+        if (!CardEffectCommons.IsOwnerTurn(card)) return null;
         if (!CardEffectCommons.IsExistOnHand(card) && !CardEffectCommons.IsExistOnBattleAreaDigimon(card)) return null;
         if (!CardEffectCommons.IsExistOnHand(card) && !CardEffectCommons.IsExistOnBattleAreaDigimon(card)) return null;
+        if (!CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition)) return null;
 
 
         ActivateClass activateClass = new ActivateClass();
         ActivateClass activateClass = new ActivateClass();
         activateClass.SetUpICardEffect("Link", CanUseCondition, card);
         activateClass.SetUpICardEffect("Link", CanUseCondition, card);
@@ -47,6 +58,9 @@ public partial class CardEffectFactory
 
 
         IEnumerator ActivateCoroutine(Hashtable _hashtable)
         IEnumerator ActivateCoroutine(Hashtable _hashtable)
         {
         {
+
+            yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-cost, activateClass));
+
             Permanent selectedPermanent = null;
             Permanent selectedPermanent = null;
 
 
             int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
             int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
@@ -80,9 +94,9 @@ public partial class CardEffectFactory
             if (selectedPermanent != null)
             if (selectedPermanent != null)
             {
             {
                 if (CardEffectCommons.IsExistOnHand(card))
                 if (CardEffectCommons.IsExistOnHand(card))
-                    yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddLinkedCard(card, activateClass));
+                    yield return ContinuousController.instance.StartCoroutine(selectedPermanent.AddLinkedCard(card, dp, activateClass));
                 else
                 else
-                    yield return ContinuousController.instance.StartCoroutine(new ILinkPermanentToPermanent(new List<Permanent[]>() { new Permanent[] { card.PermanentOfThisCard(), selectedPermanent } }, activateClass).LinkPermanent());
+                    yield return ContinuousController.instance.StartCoroutine(new ILinkPermanentToPermanent(new List<Permanent[]>() { new Permanent[] { card.PermanentOfThisCard(), selectedPermanent } }, dp, activateClass).LinkPermanent());
             }
             }
         }
         }
 
 

+ 10 - 2
Assets/Scripts/Permanent.cs

@@ -317,7 +317,7 @@ public class Permanent
             {
             {
                 DP = BaseDP;
                 DP = BaseDP;
 
 
-                #region DPを変更する効果
+                #region DP By Effect
 
 
                 List<ICardEffect> cardEffects_ChangeDP = new List<ICardEffect>();
                 List<ICardEffect> cardEffects_ChangeDP = new List<ICardEffect>();
 
 
@@ -459,6 +459,8 @@ public class Permanent
                 }
                 }
                 #endregion
                 #endregion
 
 
+                DP += LinkedDP;
+
                 if (DP < 0)
                 if (DP < 0)
                 {
                 {
                     DP = 0;
                     DP = 0;
@@ -468,6 +470,10 @@ public class Permanent
             return DP;
             return DP;
         }
         }
     }
     }
+
+    public int LinkedDP { get; set; }
+
+    public int DPBoost { get; set; }
     #endregion
     #endregion
 
 
     #region Will it not receive negative DP effect?
     #region Will it not receive negative DP effect?
@@ -802,7 +808,7 @@ public class Permanent
     #endregion
     #endregion
 
 
     #region Add Card Source
     #region Add Card Source
-    public IEnumerator AddLinkedCard(CardSource cardSource, ICardEffect cardEffect)
+    public IEnumerator AddLinkedCard(CardSource cardSource, int DP, ICardEffect cardEffect)
     {
     {
         yield return null;
         yield return null;
 
 
@@ -817,6 +823,7 @@ public class Permanent
         }
         }
 
 
         LinkedCard = cardSource;
         LinkedCard = cardSource;
+        LinkedDP = DP;
     }
     }
     #endregion
     #endregion
 
 
@@ -826,6 +833,7 @@ public class Permanent
         yield return null;
         yield return null;
 
 
         cardSources.Remove(cardSource);
         cardSources.Remove(cardSource);
+        LinkedDP = 0;
     }
     }
     #endregion
     #endregion