mbunch_kascope 1 rok pred
rodič
commit
0febbb1e90

+ 3 - 1
Assets/CardEffect/BT21/Red/BT21_084.cs

@@ -161,8 +161,10 @@ namespace DCGO.CardEffects.BT21
 
                             if (selectedCard != null && selectedCard.CanAppFusionFromTargetPermanent(selectedPermanent, true))
                             {
+                                CardSource linkCard = selectedPermanent.LinkedCards.Where(x => selectedCard.appFusionCondition.linkedCondition(selectedPermanent, x)).First();
+
                                 PlayCardClass playCardClass = new PlayCardClass(new List<CardSource> { selectedCard }, hashtable, true, selectedPermanent, false, SelectCardEffect.Root.Hand, true);
-                                playCardClass.SetAppFusion(new int[] { selectedPermanent.PermanentFrame.FrameID, selectedPermanent.LinkedCards.IndexOf(selectedCard) });
+                                playCardClass.SetAppFusion(new int[] { selectedPermanent.PermanentFrame.FrameID, selectedPermanent.LinkedCards.IndexOf(linkCard) });
 
                                 yield return ContinuousController.instance.StartCoroutine(playCardClass.PlayCard());
                             }

+ 1 - 0
Assets/Scripts/CardController.cs

@@ -276,6 +276,7 @@ public class PlayCardClass
     {
         if (_appFusionFrameIDs != null && _appFusionFrameIDs.Length == 2)
         {
+            UnityEngine.Debug.Log($"GETTING LINKED CARD: {_appFusionFrameIDs[0]}, {_appFusionFrameIDs[1]}");
             if (0 <= _appFusionFrameIDs[0] && _appFusionFrameIDs[0] <= card.Owner.fieldCardFrames.Count - 1)
             {
                 Permanent targetPermanent = card.Owner.fieldCardFrames[_appFusionFrameIDs[0]].GetFramePermanent();

+ 0 - 9
Assets/Scripts/CardSource.cs

@@ -2602,35 +2602,26 @@ public class CardSource : MonoBehaviour
     #region whether target permanent can App Fusion into this card
     public bool CanAppFusionFromTargetPermanent(Permanent targetPermanent, bool PayCost)
     {
-        UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {targetPermanent}");
         if (targetPermanent != null)
         {
-            UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {targetPermanent.TopCard}");
             if (targetPermanent.TopCard != null)
             {
-                UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {appFusionCondition}");
                 if (appFusionCondition != null)
                 {
-                    UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {this.CanNotEvolve(targetPermanent)}");
                     if (!this.CanNotEvolve(targetPermanent))
                     {
-                        UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {appFusionCondition.digimonCondition(targetPermanent)}");
                         if (appFusionCondition.digimonCondition(targetPermanent))
                         {
-                            UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {targetPermanent.LinkedCards.Count}");
                             foreach (CardSource linkedCard in targetPermanent.LinkedCards)
                             {
-                                UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {appFusionCondition.linkedCondition(targetPermanent, linkedCard)}");
                                 if (appFusionCondition.linkedCondition(targetPermanent, linkedCard))
                                 {
-                                    UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {PayCost}");
                                     if (PayCost)
                                     {
                                         int cost = appFusionCondition.cost;
 
                                         cost = GetChangedCostItselef(cost, SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: true);
 
-                                        UnityEngine.Debug.Log($"CAN APP FUSE ON TARGET: {Owner.MaxMemoryCost} < {cost}");
                                         if (Owner.MaxMemoryCost < cost)
                                         {
                                             return false;

+ 3 - 2
Assets/Scripts/SelectAppFusionEffect.cs

@@ -229,8 +229,9 @@ public class SelectAppFusionEffect : MonoBehaviour
 
                 if (link.Owner.GetBattleAreaDigimons().Contains(linkPermanent))
                 {
-                    yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().RemoveLinkedCard(selectedLink));
-                    yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsTop(new List<CardSource> { selectedLink, EvoRoot }, null));
+                    UnityEngine.Debug.Log($"ADD SOURCES: {linkPermanent}, {link}");
+                    yield return ContinuousController.instance.StartCoroutine(linkPermanent.RemoveLinkedCard(link));
+                    yield return ContinuousController.instance.StartCoroutine(linkPermanent.AddDigivolutionCardsTop(new List<CardSource> { link, linkPermanent.TopCard }, null));
 
                     LinkAdded = true;
                 }

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:544198dc8d27b0d414cd68dd54cbe860af68385314ee115264af69a57aac58f3
-size 20168
+oid sha256:ef18a9093b188f1982ab02ba819e35d75af5c626eb56d2d741e541871c1b284b
+size 20169