mbunch_kascope 1 год назад
Родитель
Сommit
dc0c6bc136

+ 8 - 24
Assets/Scripts/CardController.cs

@@ -3165,7 +3165,7 @@ public class DestroyPermanentsClass
             }
             }
         }
         }
         #endregion
         #endregion
-
+        
         // fix delete target permanents
         // fix delete target permanents
         List<Permanent> destroyTargetPermanents_Fixed = _destroytargetPermanents.Filter(permanent =>
         List<Permanent> destroyTargetPermanents_Fixed = _destroytargetPermanents.Filter(permanent =>
             permanent != null
             permanent != null
@@ -4030,33 +4030,19 @@ public class IBattle
                 // battle effect
                 // battle effect
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().BattleEffect(WinnerPermanents, LoserPermanents, LoserCard));
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().BattleEffect(WinnerPermanents, LoserPermanents, LoserCard));
 
 
-                yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(LoserPermanents, hashtable).Destroy());
-
-                //Fix winner/loser permanents
-                int index = -1;
-                foreach (Permanent permanent in LoserPermanents)
-                {
-                    if (permanent.TopCard != null)
-                    {
-                        index = LoserPermanents.IndexOf(permanent);
-                    }
-                }
+                DestroyPermanentsClass destoryBattlePermanents = new DestroyPermanentsClass(LoserPermanents, hashtable);
+                yield return ContinuousController.instance.StartCoroutine(destoryBattlePermanents.Destroy());
 
 
-                if (index >= 0)
+                
+                //Fix Loser Permanents
+                if(LoserPermanents != destoryBattlePermanents.DestroyedPermanents)
                 {
                 {
-                    LoserPermanents.RemoveAt(index);
-                    _LoserPermanents.RemoveAt(index);
-
+                    LoserPermanents = destoryBattlePermanents.DestroyedPermanents;
+                    _LoserPermanents = destoryBattlePermanents.DestroyedPermanents;
                     hashtable["LoserPermanents"] = _LoserPermanents;
                     hashtable["LoserPermanents"] = _LoserPermanents;
                     hashtable["LoserPermanents_real"] = LoserPermanents;
                     hashtable["LoserPermanents_real"] = LoserPermanents;
                 }
                 }
 
 
-                //LoserPermanents = LoserPermanents.Filter(permanent => permanent.TopCard != null);
-                //_LoserPermanents = _LoserPermanents.Filter(permanent => permanent.TopCard != null);
-
-                //hashtable["LoserPermanents"] = _LoserPermanents;
-                //hashtable["LoserPermanents_real"] = LoserPermanents;
-
                 // "At the end of battle" effect
                 // "At the end of battle" effect
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnEndBattle));
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnEndBattle));
 
 
@@ -4653,8 +4639,6 @@ public class SuspendPermanentsClass
         {
         {
             permanent.IsSuspended = true;
             permanent.IsSuspended = true;
 
 
-            GManager.OnCardSuspendedChanged?.Invoke(true);
-
             permanent.DPWhenSuspended = permanent.DP;
             permanent.DPWhenSuspended = permanent.DP;
 
 
             if (permanent.ShowingPermanentCard != null)
             if (permanent.ShowingPermanentCard != null)

+ 0 - 1
Assets/Scripts/FieldPermanentCard.cs

@@ -174,7 +174,6 @@ public class FieldPermanentCard : MonoBehaviour
         //Events
         //Events
         GManager.OnReverseOpponentsCardsChanged += SetTransformRotation;
         GManager.OnReverseOpponentsCardsChanged += SetTransformRotation;
         GManager.OnCardFlippedChanged += SetCardIsFlipped;
         GManager.OnCardFlippedChanged += SetCardIsFlipped;
-        //GManager.OnCardSuspendedChanged += SetCardSuspended;
     }
     }
 
 
     public IEnumerator ShowAddDigivolutionCardEffect()
     public IEnumerator ShowAddDigivolutionCardEffect()

+ 0 - 1
Assets/Scripts/GManager.cs

@@ -220,7 +220,6 @@ public class GManager : MonoBehaviourPun
     //Cards flipped
     //Cards flipped
     public static Action OnReverseOpponentsCardsChanged;
     public static Action OnReverseOpponentsCardsChanged;
     public static Action OnCardFlippedChanged;
     public static Action OnCardFlippedChanged;
-    public static Action<bool> OnCardSuspendedChanged;
 
 
     public static Action<Player> OnSecurityStackChanged;
     public static Action<Player> OnSecurityStackChanged;
     
     

+ 0 - 1
Assets/Scripts/SecurityObject.cs

@@ -170,7 +170,6 @@ public class SecurityObject : MonoBehaviour
         if (player != changedPlayer)
         if (player != changedPlayer)
             return;
             return;
 
 
-        UnityEngine.Debug.Log($"CHECKING FACE UP SECURITY: you - {changedPlayer.isYou}, icon - {changedPlayer.SecurityCards.Count(cardSource => !cardSource.IsFlipped)}");
         faceupIcon.SetActive((changedPlayer.SecurityCards.Count(cardSource => !cardSource.IsFlipped) > 0));
         faceupIcon.SetActive((changedPlayer.SecurityCards.Count(cardSource => !cardSource.IsFlipped) > 0));
     }
     }