Ver código fonte

app fusion fix attempts

mbunch_kascope 1 ano atrás
pai
commit
169a5bb5ad

+ 253 - 2
Assets/Prefab/HandCard.prefab

@@ -1696,6 +1696,141 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
+--- !u!1 &1716456598818536023
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2160520773612569794}
+  - component: {fileID: 6805951310471378867}
+  - component: {fileID: 849582532726814432}
+  m_Layer: 5
+  m_Name: AppFusionPlayText
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &2160520773612569794
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1716456598818536023}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6500841927603199772}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 200, y: 50}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &6805951310471378867
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1716456598818536023}
+  m_CullTransparentMesh: 1
+--- !u!114 &849582532726814432
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1716456598818536023}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_text: App Fusion
+  m_isRightToLeft: 0
+  m_fontAsset: {fileID: 11400000, guid: 20f31d6a6009234479b15107520e4391, type: 2}
+  m_sharedMaterial: {fileID: 2100000, guid: c72258de19047bd4389769166cadc9bc, type: 2}
+  m_fontSharedMaterials: []
+  m_fontMaterial: {fileID: 0}
+  m_fontMaterials: []
+  m_fontColor32:
+    serializedVersion: 2
+    rgba: 4282720736
+  m_fontColor: {r: 0.8773585, g: 0.12829298, b: 0.2688392, a: 1}
+  m_enableVertexGradient: 0
+  m_colorMode: 3
+  m_fontColorGradient:
+    topLeft: {r: 1, g: 1, b: 1, a: 1}
+    topRight: {r: 1, g: 1, b: 1, a: 1}
+    bottomLeft: {r: 1, g: 1, b: 1, a: 1}
+    bottomRight: {r: 1, g: 1, b: 1, a: 1}
+  m_fontColorGradientPreset: {fileID: 0}
+  m_spriteAsset: {fileID: 0}
+  m_tintAllSprites: 0
+  m_StyleSheet: {fileID: 0}
+  m_TextStyleHashCode: -1183493901
+  m_overrideHtmlColors: 0
+  m_faceColor:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontSize: 13
+  m_fontSizeBase: 13
+  m_fontWeight: 400
+  m_enableAutoSizing: 0
+  m_fontSizeMin: 18
+  m_fontSizeMax: 72
+  m_fontStyle: 1
+  m_HorizontalAlignment: 2
+  m_VerticalAlignment: 512
+  m_textAlignment: 65535
+  m_characterSpacing: 0
+  m_wordSpacing: 0
+  m_lineSpacing: 0
+  m_lineSpacingMax: 0
+  m_paragraphSpacing: 0
+  m_charWidthMaxAdj: 0
+  m_enableWordWrapping: 1
+  m_wordWrappingRatios: 0.4
+  m_overflowMode: 0
+  m_linkedTextComponent: {fileID: 0}
+  parentLinkedComponent: {fileID: 0}
+  m_enableKerning: 1
+  m_enableExtraPadding: 0
+  checkPaddingRequired: 0
+  m_isRichText: 1
+  m_parseCtrlCharacters: 1
+  m_isOrthographic: 1
+  m_isCullingEnabled: 0
+  m_horizontalMapping: 0
+  m_verticalMapping: 0
+  m_uvLineOffset: 0
+  m_geometrySortingOrder: 0
+  m_IsTextObjectScaleStatic: 0
+  m_VertexBufferAutoSizeReduction: 0
+  m_useMaxVisibleDescender: 1
+  m_pageToDisplay: 1
+  m_margin: {x: 0, y: 0, z: 0, w: 0}
+  m_isUsingLegacyAnimationComponent: 0
+  m_isVolumetricText: 0
+  m_hasFontAssetChanged: 0
+  m_baseMaterial: {fileID: 0}
+  m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
 --- !u!1 &1781545219207697804
 GameObject:
   m_ObjectHideFlags: 0
@@ -4011,6 +4146,7 @@ RectTransform:
   - {fileID: 4598267087472037382}
   - {fileID: 6983807953412496237}
   - {fileID: 5896879117472972118}
+  - {fileID: 6500841927603199772}
   m_Father: {fileID: 7114728606150196611}
   m_RootOrder: 18
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -4591,7 +4727,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 50, y: -38.176666}
+  m_AnchoredPosition: {x: 50, y: -50}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!1 &4067118514026342296
@@ -6738,6 +6874,7 @@ MonoBehaviour:
   PlayText: {fileID: 6420205755296561497}
   JogressPlayText: {fileID: 8979911281596542659}
   BurstPlayText: {fileID: 8517564899320748421}
+  AppFusionPlayText: {fileID: 849582532726814432}
   titleText: {fileID: 538943448957496463}
   singleDigivolutionArrow: {fileID: 7173131196233213350}
   jogressDigivolutionArrow: {fileID: 4067118514026342296}
@@ -7454,9 +7591,85 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 50, y: -32.265}
+  m_AnchoredPosition: {x: 50, y: -50}
   m_SizeDelta: {x: 100, y: 100}
   m_Pivot: {x: 0.5, y: 0.5}
+--- !u!1 &6655236291875027076
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 7360399188663713335}
+  - component: {fileID: 1769854968078592442}
+  - component: {fileID: 2990395409370102214}
+  m_Layer: 5
+  m_Name: background
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &7360399188663713335
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6655236291875027076}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6500841927603199772}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 124.3, y: 17.43}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &1769854968078592442
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6655236291875027076}
+  m_CullTransparentMesh: 1
+--- !u!114 &2990395409370102214
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6655236291875027076}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_Sprite: {fileID: 21300000, guid: d50e7cc4e4b5f9e4aa7524c536405aaa, type: 3}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!1 &6673528562667702473
 GameObject:
   m_ObjectHideFlags: 0
@@ -10559,6 +10772,44 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_ShowMaskGraphic: 1
+--- !u!1 &8979442066499330881
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6500841927603199772}
+  m_Layer: 5
+  m_Name: AppFusionTextDigivolution
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!224 &6500841927603199772
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8979442066499330881}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 7360399188663713335}
+  - {fileID: 2160520773612569794}
+  m_Father: {fileID: 6672166927212128146}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 50, y: -50}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
 --- !u!1 &9058500054419157707
 GameObject:
   m_ObjectHideFlags: 0

+ 23 - 3
Assets/Scripts/CardController.cs

@@ -142,7 +142,7 @@ public class PlayCardClass
 
     public void SetAppFusion(int AppFusionFrameID, CardSource card)
     {
-        if (0 >= AppFusionFrameID && AppFusionFrameID <= card.Owner.fieldCardFrames.Count - 1)
+        if (0 <= AppFusionFrameID && AppFusionFrameID <= card.Owner.fieldCardFrames.Count - 1)
         {
             _appFusionFrameID = AppFusionFrameID;
         }
@@ -592,6 +592,10 @@ public class PlayCardClass
                 {
                     return true;
                 }
+                else if (IsAppFusion(card))
+                {
+                    return true;
+                }
 
                 return false;
             }
@@ -721,7 +725,6 @@ public class PlayCardClass
 
             if (IsAppFusion(card))
             {
-                UnityEngine.Debug.Log($"PLAYING: {card}");
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectAppFusionEffect.AddToSources());
 
                 if (!GManager.instance.selectAppFusionEffect.LinkAdded)
@@ -939,6 +942,9 @@ public class PlayCardClass
             playPermanent.SetBurstDigivolved();
         }
 
+        if (appFusion)
+            playPermanent.SetAppFusion();
+
         if (_isBreedingArea)
         {
             playPermanent.SetIsBreedingArea();
@@ -1078,6 +1084,11 @@ public class PlayPermanentClass
         _burstDigivolved = true;
     }
 
+    public void SetAppFusion()
+    {
+        _appFusion = true;
+    }
+
     public void SetIsBreedingArea()
     {
         _isBreedingArea = true;
@@ -1096,6 +1107,7 @@ public class PlayPermanentClass
     int[] _jogressEvoRootsFrameIDs = null;
     int _digiXrosCount = 0;
     bool _burstDigivolved = false;
+    bool _appFusion = false;
     bool _isBreedingArea = false;
     bool _isPlayOption = false;
 
@@ -1269,7 +1281,7 @@ public class PlayPermanentClass
                             {
                                 bool isBlast = CardEffect != null && CardEffect.EffectName != null && CardEffect.EffectName.Contains("Blast");
                                 //effect
-                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().DigivolveFieldPermanentCardEffect(permanent.ShowingPermanentCard, _burstDigivolved, isBlast));
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().DigivolveFieldPermanentCardEffect(permanent.ShowingPermanentCard, _burstDigivolved, isBlast, _appFusion));
                             }
                         }
                     }
@@ -1376,6 +1388,14 @@ public class PlayPermanentClass
                         }
                     }
 
+                    if (_appFusion)
+                    {
+                        if (permanent.TopCard != null)
+                        {
+                            permanent.IsAppFusion = true;
+                        }
+                    }
+
                     permanent.CardNamesJustAfterDigivolved = permanent.TopCard.CardNames.Clone();
 
                     permanent.DigivolvingEffect = CardEffect;

+ 5 - 2
Assets/Scripts/Effects.cs

@@ -604,7 +604,7 @@ public class Effects : MonoBehaviour
 
     [Header("画面振動")]
     public CinemachineImpulseSource impulseSource;
-    public IEnumerator DigivolveFieldPermanentCardEffect(FieldPermanentCard targetFieldPermanentCard, bool isBurst, bool isBlast)
+    public IEnumerator DigivolveFieldPermanentCardEffect(FieldPermanentCard targetFieldPermanentCard, bool isBurst, bool isBlast, bool isAppFusion)
     {
         if (targetFieldPermanentCard != null)
         {
@@ -614,7 +614,10 @@ public class Effects : MonoBehaviour
             {
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.burstEffectObject.EvolutionEffectAnimation(targetFieldPermanentCard.ThisPermanent.TopCard));
             }
-
+            else if (isAppFusion)
+            {
+                yield return ContinuousController.instance.StartCoroutine(GManager.instance.burstEffectObject.EvolutionEffectAnimation(targetFieldPermanentCard.ThisPermanent.TopCard));
+            }
             else if (isBlast)
             {
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.EvolutionEffectObject.EvolutionEffectAnimation(targetFieldPermanentCard.ThisPermanent.TopCard, message: "Blast Digivolution"));

+ 41 - 0
Assets/Scripts/HandCard.cs

@@ -57,6 +57,9 @@ public class HandCard : MonoBehaviour
     [Header("バーストプレイテキスト")]
     public TextMeshProUGUI BurstPlayText;
 
+    [Header("App Fusion play text")]
+    public TextMeshProUGUI AppFusionPlayText;
+
     [Header("タイトルテキスト")]
     public TextMeshProUGUI titleText;
 
@@ -150,6 +153,8 @@ public class HandCard : MonoBehaviour
 
         OffBurstPlayText();
 
+        OffAppFusionPlayText();
+
         OffDP();
 
         OffEvoRootCardImage();
@@ -598,6 +603,12 @@ public class HandCard : MonoBehaviour
             BurstPlayText.transform.parent.gameObject.SetActive(false);
             BurstPlayText.transform.parent.parent.gameObject.SetActive(true);
         }
+
+        if (AppFusionPlayText != null)
+        {
+            AppFusionPlayText.transform.parent.gameObject.SetActive(false);
+            AppFusionPlayText.transform.parent.parent.gameObject.SetActive(true);
+        }
     }
 
     public void SetBurstPlayText()
@@ -616,6 +627,36 @@ public class HandCard : MonoBehaviour
             JogressPlayText.transform.parent.gameObject.SetActive(false);
             JogressPlayText.transform.parent.parent.gameObject.SetActive(true);
         }
+
+        if (AppFusionPlayText != null)
+        {
+            AppFusionPlayText.transform.parent.gameObject.SetActive(false);
+            AppFusionPlayText.transform.parent.parent.gameObject.SetActive(true);
+        }
+    }
+
+    public void SetAppFusionPlayText()
+    {
+        if (AppFusionPlayText != null)
+        {
+            AppFusionPlayText.transform.parent.gameObject.SetActive(true);
+            AppFusionPlayText.transform.parent.parent.gameObject.SetActive(true);
+        }
+    }
+
+    public void OffAppFusionPlayText()
+    {
+        if (JogressPlayText != null)
+        {
+            JogressPlayText.transform.parent.gameObject.SetActive(false);
+            JogressPlayText.transform.parent.parent.gameObject.SetActive(true);
+        }
+
+        if (BurstPlayText != null)
+        {
+            BurstPlayText.transform.parent.gameObject.SetActive(false);
+            BurstPlayText.transform.parent.parent.gameObject.SetActive(true);
+        }
     }
 
     public void PointerDown(BaseEventData eventData)

+ 5 - 1
Assets/Scripts/Permanent.cs

@@ -998,7 +998,7 @@ public class Permanent
         if (LinkedCards.Count >= LinkedMax)
         {
             if(LinkedMax > 1)
-                yield return ContinuousController.instance.StartCoroutine(RemoveLinkedCard(null,(LinkedCards.Count - LinkedMax)));
+                yield return ContinuousController.instance.StartCoroutine(RemoveLinkedCard(null,((LinkedCards.Count + 1) - LinkedMax)));
             else
                 yield return ContinuousController.instance.StartCoroutine(RemoveLinkedCard(LinkedCards[0]));
         }
@@ -3447,6 +3447,10 @@ public class Permanent
     public bool IsBurstDigivolved { get; set; } = false;
     #endregion
 
+    #region Did it App Fusion?
+    public bool IsAppFusion { get; set; } = false;
+    #endregion
+
     #region 効果で場に出たオプションか
     public bool IsPlayedOptionPermanent { get; set; } = false;
     #endregion

+ 8 - 3
Assets/Scripts/SelectAppFusionEffect.cs

@@ -39,7 +39,6 @@ public class SelectAppFusionEffect : MonoBehaviour
     }
 
     CardSource _card = null;
-    
     public CardSource EvoRoot = null;
     bool _isLocal = false;
 
@@ -183,6 +182,11 @@ public class SelectAppFusionEffect : MonoBehaviour
                 selectPlayer: _card.Owner,
                 cardEffect: null);
 
+                if (this._isLocal)
+                {
+                    selectCardEffect.SetIsLocal();
+                }
+
                 yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
                 IEnumerator SelectCardCoroutine(CardSource source)
@@ -220,8 +224,9 @@ public class SelectAppFusionEffect : MonoBehaviour
         if (selectedLink != null)
         {
             yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().RemoveLinkedCard(selectedLink));
-            yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { selectedLink }, null, true));
-            yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { EvoRoot }, null, true));
+            yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsTop(new List<CardSource> { selectedLink, EvoRoot }, null));
+            //yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { selectedLink }, null, true));
+            //yield return ContinuousController.instance.StartCoroutine(EvoRoot.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource> { EvoRoot }, null, true));
             
             LinkAdded = true;
         }

+ 15 - 4
Assets/Scripts/SelectCardEffect.cs

@@ -42,6 +42,7 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
         _selectPlayer = selectPlayer;
         _cardEffect = cardEffect;
 
+        _isLocal = false;
         _customMessage = null;
         _customMessage_Enemy = null;
         _customMessage_ShowCard = null;
@@ -59,6 +60,11 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
         _afterSelectIndexCoroutine = null;
     }
 
+    public void SetIsLocal()
+    {
+        _isLocal = true;
+    }
+
     public void SetIsDeckBottom()
     {
         _isDeckBottom = true;
@@ -140,6 +146,8 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
 
     Player _selectPlayer = null;
     ICardEffect _cardEffect = null;
+
+    bool _isLocal = false;
     bool _showReverseCard = true;
     bool _showCard = true;
     bool _notAddLog = false;
@@ -266,7 +274,10 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
 
         _slectedInexesInList = new List<int>();
 
-        yield return GManager.instance.photonWaitController.StartWait("SelectCardEffect");
+        if (!_isLocal)
+        {
+            yield return GManager.instance.photonWaitController.StartWait("SelectCardEffect");
+        }
 
         bool oldIsActiveOutline_AttackingPermanent = false;
 
@@ -362,7 +373,7 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
                         RootCards.Add(cardSource);
                     }
 
-                    #region 並び替え
+                    #region Sort
 
                     if (_root == Root.Library || _root == Root.Trash)
                     {
@@ -401,7 +412,7 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
 
                     #endregion
 
-                    #region 効果発動中・発動待機中表示
+                    #region Effect in progress/waiting to be activated
 
                     if (_cardEffect != null)
                     {
@@ -583,7 +594,7 @@ public class SelectCardEffect : MonoBehaviourPunCallbacks
             GManager.instance.commandText.CloseCommandText();
             yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
 
-            #region 選択されたカードを表示
+            #region Show selected card
 
             if (_targetCards.Count > 0 && _showCard)
             {

+ 21 - 51
Assets/Scripts/TurnStateMachine.cs

@@ -47,6 +47,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
         _canDigivolves = new bool[GManager.instance.You.fieldCardFrames.Count];
         _canJogresses = new bool[GManager.instance.You.fieldCardFrames.Count];
         _canBursts = new bool[GManager.instance.You.fieldCardFrames.Count];
+        _canAppFusions = new bool[GManager.instance.You.fieldCardFrames.Count];
         _payingCosts = new int[GManager.instance.You.fieldCardFrames.Count];
         #endregion
 
@@ -837,6 +838,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
     bool[] _canDigivolves = new bool[GManager.instance.You.fieldCardFrames.Count];
     bool[] _canJogresses = new bool[GManager.instance.You.fieldCardFrames.Count];
     bool[] _canBursts = new bool[GManager.instance.You.fieldCardFrames.Count];
+    bool[] _canAppFusions = new bool[GManager.instance.You.fieldCardFrames.Count];
     int[] _payingCosts = new int[GManager.instance.You.fieldCardFrames.Count];
     IEnumerator MainPhase()
     {
@@ -1210,7 +1212,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                     playCard.SetBurst(BurstTamerFrameID, PlayCard);
                 }
 
-                if (0 >= AppFusionFrameID && AppFusionFrameID <= gameContext.TurnPlayer.fieldCardFrames.Count - 1)
+                if (0 <= AppFusionFrameID && AppFusionFrameID <= gameContext.TurnPlayer.fieldCardFrames.Count - 1)
                 {
                     playCard.SetAppFusion(AppFusionFrameID, PlayCard);
                 }
@@ -1319,6 +1321,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
             TargetFrameID = -1;
             JogressEvoRootsFrameIDs = new int[0];
             BurstTamerFrameID = -1;
+            AppFusionFrameID = -1;
             UseCardEffect = null;
             AttackingPermanent = null;
             DefendingPermanent = null;
@@ -2042,6 +2045,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                             handCard1.OffPlayText();
                             handCard1.OffJogressPlayText();
                             handCard1.OffBurstPlayText();
+                            handCard1.OffAppFusionPlayText();
                             handCard1.OffClickText();
 
                             #region デジモン・テイマー
@@ -2124,6 +2128,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                             handCard.OffPlayText();
                             handCard.OffJogressPlayText();
                             handCard.OffBurstPlayText();
+                            handCard.OffAppFusionPlayText();
 
                             #region play cards
 
@@ -2425,6 +2430,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                                                                 endSelectCoroutine_SelectTamer: EndSelectCoroutine_SelectTamer,
                                                                 noSelectCoroutine: _NoSelectCoroutine);
 
+
                                                             yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectBurstDigivolutionEffect.SelectTamer());
 
                                                             IEnumerator EndSelectCoroutine_SelectTamer(Permanent permanent)
@@ -2631,11 +2637,12 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                             handCard.OffPlayText();
                             handCard.OffJogressPlayText();
                             handCard.OffBurstPlayText();
+                            handCard.OffAppFusionPlayText();
 
-                            #region デジモン・テイマー
+                            #region Digimon/Tamer
                             if (handCard.cardSource.IsPermanent)
                             {
-                                #region 枠の上にあるかチェック
+                                #region Check if it is on the frame
                                 bool isOnPermanentFrameAndCanEvolve = false;
 
                                 foreach (FieldCardFrame fieldCardFrame in GManager.instance.You.fieldCardFrames)
@@ -2667,6 +2674,9 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                                                         handCard.SetBurstPlayText();
                                                     }
 
+                                                    if (_canAppFusions[frameIndex])
+                                                        handCard.SetAppFusionPlayText();
+
                                                     handCard.SetOrangeOutline();
 
                                                     fieldCardFrame.GetFramePermanent().ShowingPermanentCard.OnSelectEffect(1.1f);
@@ -2715,7 +2725,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                             }
                             #endregion
 
-                            #region オプション
+                            #region option
                             else if (handCard.cardSource.IsOption)
                             {
                                 #region プレイマットの上にあるかチェック
@@ -2919,6 +2929,7 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
         _canDigivolves = new bool[GManager.instance.You.fieldCardFrames.Count];
         _canJogresses = new bool[GManager.instance.You.fieldCardFrames.Count];
         _canBursts = new bool[GManager.instance.You.fieldCardFrames.Count];
+        _canAppFusions = new bool[GManager.instance.You.fieldCardFrames.Count];
         _payingCosts = new int[GManager.instance.You.fieldCardFrames.Count];
 
         if (cardSource.IsDigimon)
@@ -2936,11 +2947,13 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                 bool canDigivolve = targetPermanent != null && cardSource.CanEvolve(targetPermanent, true);
                 bool canJogress = targetPermanent != null && cardSource.CanJogressFromTargetPermanent(targetPermanent, true);
                 bool canBurst = targetPermanent != null && cardSource.CanBurstDigivolutionFromTargetPermanent(targetPermanent, true);
+                bool canAppFusion = targetPermanent != null && cardSource.CanAppFusionFromTargetPermanent(targetPermanent, true);
 
-                _canPlayTargetFrames[frameIndex] = canPlay || canJogress || canBurst;
+                _canPlayTargetFrames[frameIndex] = canPlay || canJogress || canBurst || canAppFusion;
                 _canDigivolves[frameIndex] = canDigivolve;
                 _canJogresses[frameIndex] = canJogress;
                 _canBursts[frameIndex] = canBurst;
+                _canAppFusions[frameIndex] = canAppFusion;
 
                 List<int> payingCosts = new List<int>(); ;
 
@@ -2958,51 +2971,9 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                     payingCosts.Add(cardSource.GetPayingCostWithBaseCost(cardSource.burstDigivolutionCondition.cost, SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: false));
                 }
 
-                if (payingCosts.Count > 1)
-                {
-                    minPayingCost = payingCosts.Min();
-                }
-
-                else if (payingCosts.Count == 1)
-                {
-                    minPayingCost = payingCosts[0];
-                }
-
-                _payingCosts[frameIndex] = minPayingCost;
-
-                yield return null;
-            }
-
-            /*
-            for (int i = 0; i < GManager.instance.You.fieldCardFrames.Count; i++)
-            {
-                FieldCardFrame fieldCardFrame = GManager.instance.You.fieldCardFrames[i];
-                Permanent targetPermanent = fieldCardFrame.GetFramePermanent();
-
-                bool canPlay = targetPermanent == null ? canPlayEmpty : cardSource.CanPlayCardTargetFrame(fieldCardFrame, true, null);
-                bool canDigivolve = targetPermanent != null && cardSource.CanEvolve(targetPermanent, true);
-                bool canJogress = targetPermanent != null && cardSource.CanJogressFromTargetPermanent(targetPermanent, true);
-                bool canBurst = targetPermanent != null && cardSource.CanBurstDigivolutionFromTargetPermanent(targetPermanent, true);
-
-                _canPlayTargetFrames[i] = canPlay || canJogress || canBurst;
-                _canDigivolves[i] = canDigivolve;
-                _canJogresses[i] = canJogress;
-                _canBursts[i] = canBurst;
-
-                List<int> payingCosts = new List<int>(); ;
-
-                int minPayingCost = 0;
-
-                payingCosts.Add(cardSource.PayingCost(SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: false));
-
-                if (canJogress)
-                {
-                    payingCosts.Add(cardSource.GetPayingCost(cardSource.jogressCondition.cost, SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: false));
-                }
-
-                if (canBurst)
+                if (canAppFusion)
                 {
-                    payingCosts.Add(cardSource.GetPayingCost(cardSource.burstDigivolutionCondition.cost, SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: false));
+                    payingCosts.Add(cardSource.GetPayingCostWithBaseCost(cardSource.appFusionCondition.cost, SelectCardEffect.Root.Hand, new List<Permanent>() { targetPermanent }, checkAvailability: false));
                 }
 
                 if (payingCosts.Count > 1)
@@ -3015,11 +2986,10 @@ public class TurnStateMachine : MonoBehaviourPunCallbacks
                     minPayingCost = payingCosts[0];
                 }
 
-                _payingCosts[i] = minPayingCost;
+                _payingCosts[frameIndex] = minPayingCost;
 
                 yield return null;
             }
-            */
         }
 
         else