Kaynağa Gözat

Double DNA allowed

mbunch_kascope 1 yıl önce
ebeveyn
işleme
b62cdb41d0

+ 1 - 1
Assets/CardEffect/BT17/Red/BT17_095.cs

@@ -294,7 +294,7 @@ namespace DCGO.CardEffects.BT17
                             if(selectedLevel7.jogressCondition.Count > 1)
                             {
                                 #region select DNA condition
-                                SelectDNACondition selectDNACondition = new SelectDNACondition();
+                                SelectDNACondition selectDNACondition = GManager.instance.GetComponent<SelectDNACondition>();
                                 selectDNACondition.SetUp(selectedLevel7.Owner, selectedLevel7, SelectDNA);
 
                                 yield return ContinuousController.instance.StartCoroutine(selectDNACondition.Activate());

+ 1 - 1
Assets/CardEffect/EX6/White/EX6_072.cs

@@ -178,7 +178,7 @@ namespace DCGO.CardEffects.EX6
                         if (selectedLevel7.jogressCondition.Count > 1)
                         {
                             #region select DNA condition
-                            SelectDNACondition selectDNACondition = new SelectDNACondition();
+                            SelectDNACondition selectDNACondition = GManager.instance.GetComponent<SelectDNACondition>();
                             selectDNACondition.SetUp(selectedLevel7.Owner, selectedLevel7, SelectDNA);
 
                             yield return ContinuousController.instance.StartCoroutine(selectDNACondition.Activate());

+ 2 - 2
Assets/Photon/PhotonUnityNetworking/Resources/PhotonServerSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ce5f9a4853a700c4f82ee1cb21870a1921fb3f7aa777cfa038ca59c18eb146f7
-size 2593
+oid sha256:666fc81ed31984bb4df482ea1a1fd10b3c4e4de7143e8099e17f287adf23c470
+size 2613

+ 16 - 0
Assets/Scenes/BattleScene.unity

@@ -18183,6 +18183,7 @@ GameObject:
   - component: {fileID: 198236660}
   - component: {fileID: 198236662}
   - component: {fileID: 198236661}
+  - component: {fileID: 198236663}
   m_Layer: 0
   m_Name: GManager
   m_TagString: Untagged
@@ -18566,6 +18567,20 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 9ed437182e0b5594f8bbbad4a80241be, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  EvoRoot: {fileID: 0}
+  selectedLink: {fileID: 0}
+--- !u!114 &198236663
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 198236640}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0322d74dbfb937a4f818327110776d51, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &208123383
 GameObject:
   m_ObjectHideFlags: 0
@@ -197837,6 +197852,7 @@ MonoBehaviour:
   PlayText: {fileID: 0}
   JogressPlayText: {fileID: 0}
   BurstPlayText: {fileID: 0}
+  AppFusionPlayText: {fileID: 0}
   titleText: {fileID: 0}
   singleDigivolutionArrow: {fileID: 0}
   jogressDigivolutionArrow: {fileID: 0}

+ 5 - 11
Assets/Scripts/CardController.cs

@@ -573,19 +573,13 @@ public class PlayCardClass
             #endregion
 
             #region select DNA condition
-            int baseDNA = -1;
+            int baseDNA = 0;
 
-            SelectDNACondition selectDNACondition = new SelectDNACondition();
-            selectDNACondition.SetUp(card.Owner, card, SelectDNA);
-
-            yield return ContinuousController.instance.StartCoroutine(selectDNACondition.Activate());
-
-            IEnumerator SelectDNA(int dnaSelection)
+            if (isJogress)
             {
-                baseDNA = dnaSelection;
-
-                yield return null;
+                baseDNA = GManager.instance.GetComponent<SelectDNACondition>()._selectedCount;
             }
+            
             #endregion
 
             #region HashTable Setting
@@ -698,7 +692,6 @@ public class PlayCardClass
                     if (card.jogressCondition != null)
                     {
                         int cost = card.GetPayingCostWithBaseCost(card.jogressCondition[baseDNA].cost, Root, targetPermanents, checkAvailability: false, FixedCost: _fixedCost);
-
                         GManager.instance.memoryObject.ShowMemoryPredictionLine(card.Owner.ExpectedMemory(cost));
                     }
                 }
@@ -1549,6 +1542,7 @@ public class PlayPermanentClass
             }
 
             GManager.instance.GetComponent<SelectDigiXrosClass>().ResetSelectDigiXrosClass();
+            GManager.instance.GetComponent<SelectDNACondition>().ResetSelectDNAConditionClass();
 
             yield return GManager.instance.photonWaitController.StartWait("EndPlayPermanent");
         }

+ 1 - 0
Assets/Scripts/GManager.cs

@@ -100,6 +100,7 @@ public class GManager : MonoBehaviourPun
 
     [Header("ジョグレス選択")]
     public SelectJogressEffect selectJogressEffect;
+    public SelectDNACondition selectDNACondition;
 
     [Header("burst evolution selection")]
     public SelectBurstDigivolutionEffect selectBurstDigivolutionEffect;

+ 10 - 6
Assets/Scripts/SelectDNACondition.cs

@@ -24,11 +24,17 @@ public class SelectDNACondition : MonoBehaviourPunCallbacks
     CardSource _targetDNA = null;
     Func<int, IEnumerator> _selectDNACoroutine = null;
     List<int> _candidates = new List<int>();
-    int _selectedCount = 0;
-    bool _endSelect = false;
+    public int _selectedCount = 0;
+    public bool _endSelect = false;
     bool _notDoSync = false;
     bool _isDigivolutionCost = false;
 
+    public void ResetSelectDNAConditionClass()
+    {
+        _selectedCount = 0;
+        _endSelect = false;
+    }
+
     public IEnumerator Activate()
     {
         if (!_notDoSync)
@@ -64,13 +70,11 @@ public class SelectDNACondition : MonoBehaviourPunCallbacks
                 string selectPlayerMessage = "Which DNA do you want?";
                 string notSelectPlayerMessage = "The opponent is choosing from which DNA to do.";
 
-                GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements,
-                    selectPlayer: _targetDNA.Owner, selectPlayerMessage: selectPlayerMessage,
-                    notSelectPlayerMessage: notSelectPlayerMessage);
+                GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: _targetDNA.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                photonView.RPC("SetCount", RpcTarget.All, GManager.instance.userSelectionManager.SelectedIntValue);
+                GManager.instance.photonView.RPC("SetDNACondition", RpcTarget.All, GManager.instance.userSelectionManager.SelectedIntValue);
             }
         }
 

+ 3 - 4
Assets/Scripts/SelectJogressEffect.cs

@@ -147,7 +147,7 @@ public class SelectJogressEffect : MonoBehaviour
             {
                 if (_card.jogressCondition != null)
                 {
-                    foreach(JogressCondition dnaCondition in _card.jogressCondition)
+                    foreach (JogressCondition dnaCondition in _card.jogressCondition)
                     {
                         if(dnaCondition != null)
                         {
@@ -183,10 +183,10 @@ public class SelectJogressEffect : MonoBehaviour
             List<Permanent> selectedEvoRoots = new List<Permanent>();
             JogressCondition selectedDNA = _card.jogressCondition[0];
 
-            if(_card.jogressCondition.Count > 1)
+            if (_card.jogressCondition.Count > 1)
             {
                 #region select DNA condition
-                SelectDNACondition selectDNACondition = new SelectDNACondition();
+                SelectDNACondition selectDNACondition = GManager.instance.GetComponent<SelectDNACondition>();
                 selectDNACondition.SetUp(_card.Owner, _card, SelectDNA);
 
                 yield return ContinuousController.instance.StartCoroutine(selectDNACondition.Activate());
@@ -201,7 +201,6 @@ public class SelectJogressEffect : MonoBehaviour
             }
 
             
-
             for (int i = 0; i < selectedDNA.elements.Length; i++)
             {
                 JogressConditionElement element = selectedDNA.elements[i];

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:d4eb5604315111c65e41cee21adb903595aa595758fb04e1757109d2f61899e0
-size 20166
+oid sha256:d6dfb0303206fc3aaba0411d14dc771f16401369ee567656935caedc2cc71c8f
+size 20169