Quellcode durchsuchen

Update CardController.cs

x89rt2 vor 6 Monaten
Ursprung
Commit
d3a68906ba
1 geänderte Dateien mit 20 neuen und 100 gelöschten Zeilen
  1. 20 100
      Assets/Scripts/Script/CardController.cs

+ 20 - 100
Assets/Scripts/Script/CardController.cs

@@ -1613,14 +1613,13 @@ public class PlayPermanentClass
                 }
             }
 
-            GManager.instance.GetComponent<SelectDNACondition>().ResetSelectDNAConditionClass();
             GManager.instance.GetComponent<SelectDigiXrosClass>().ResetSelectDigiXrosClass();
             GManager.instance.GetComponent<SelectAssemblyClass>().ResetSelectAssemblyClass();
+            GManager.instance.GetComponent<SelectDNACondition>().ResetSelectDNAConditionClass();
 
             yield return GManager.instance.photonWaitController.StartWait("EndPlayPermanent");
         }
 
-
         // except [On Play] effect
         bool CardEffectCondition(ICardEffect cardEffect)
         {
@@ -4152,18 +4151,16 @@ public class IDestroySecurity
 
 public class IBattle
 {
-    public IBattle(Permanent AttackingPermanent, Permanent DefendingPermanent, CardSource DefendingCard, bool IsWithoutAttack = false)
+    public IBattle(Permanent AttackingPermanent, Permanent DefendingPermanent, CardSource DefendingCard)
     {
         this.AttackingPermanent = AttackingPermanent;
         this.DefendingPermanent = DefendingPermanent;
         this.DefendingCard = DefendingCard;
-        this.IsWithoutAttack = IsWithoutAttack;
     }
 
     public Permanent AttackingPermanent { get; private set; } = null;
     public Permanent DefendingPermanent { get; private set; } = null;
     CardSource DefendingCard { get; set; } = null;
-    bool IsWithoutAttack { get; set; } = false;
     public Hashtable hashtable { get; set; } = new Hashtable();
 
     public Permanent enemyPermanent(Permanent permanent)
@@ -4239,7 +4236,6 @@ public class IBattle
                 List<Permanent> WinnerPermanents = new List<Permanent>();
                 List<Permanent> LoserPermanents = new List<Permanent>();
                 CardSource LoserCard = null;
-                bool WasTie = false;
 
                 //add log
                 string log = $"\nBattle:\n{AttackingPermanent.TopCard.BaseENGCardNameFromEntity}({AttackingPermanent.TopCard.CardID})";
@@ -4320,17 +4316,14 @@ public class IBattle
 
                 #endregion
 
-                if (!IsWithoutAttack)//If started by effect, do not perform processing during this battle
-                {
-                    // auto process check
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
+                // auto process check
+                yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
 
-                    GManager.instance.turnStateMachine.IsSelecting = true;
+                GManager.instance.turnStateMachine.IsSelecting = true;
 
-                    //Preemptive end battle if the attack process is ended
-                    if (GManager.instance.attackProcess.IsEndAttack )
-                        yield break;
-                }
+                //Preemptive end battle if the attack process is ended
+                if (GManager.instance.attackProcess.IsEndAttack)
+                    yield break;
 
                 #region battle with permanent
 
@@ -4346,8 +4339,6 @@ public class IBattle
                     }
                     else if (battleResults == 0)
                     {
-                        WasTie = true;
-
                         WinnerPermanents.Add(AttackingPermanent);
                         WinnerPermanents.Add(DefendingPermanent);
 
@@ -4378,8 +4369,6 @@ public class IBattle
                     }
                     else if (AttackingPermanent.DP == DefendingCard.CardDP)
                     {
-                        WasTie = true;
-
                         if (AttackingPermanent.CanBeDestroyedByBattle(AttackingPermanent, DefendingPermanent, DefendingCard))
                         {
                             LoserPermanents.Add(AttackingPermanent);
@@ -4422,7 +4411,6 @@ public class IBattle
                 hashtable.Add("LoserPermanents", _LoserPermanents);
                 hashtable.Add("LoserPermanents_real", LoserPermanents);
                 hashtable.Add("LoserCard", LoserCard);
-                hashtable.Add("WasTie", WasTie);
                 hashtable.Add("battle", this);
 
                 // battle effect
@@ -4440,7 +4428,6 @@ public class IBattle
                     hashtable["LoserPermanents_real"] = LoserPermanents;
                 }
 
-                
                 // "At the end of battle" effect
                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnEndBattle));
 
@@ -4454,7 +4441,7 @@ public class IBattle
                 #endregion
 
                 #region effect when determine whether to do security check
-                
+
                 List<SkillInfo> skillInfos_Pierce = AutoProcessing.GetSkillInfos(hashtable, EffectTiming.OnDetermineDoSecurityCheck)
                     .Filter(skillInfo => skillInfo.CardEffect != null && skillInfo.CardEffect.CanActivate(skillInfo.Hashtable));
 
@@ -4467,26 +4454,23 @@ public class IBattle
             }
         }
 
-        if (!IsWithoutAttack)//If started by effect, do not perform processing & don't reset effects relevant to the actual attack process
-        {
-            // auto process check
-            yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
+        // auto process check
+        yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
 
-            #region reset effect until the end of battle
+        #region reset effect until the end of battle
 
-            foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
+        foreach (Player player in GManager.instance.turnStateMachine.gameContext.Players_ForTurnPlayer)
+        {
+            foreach (Permanent permanent in player.GetFieldPermanents())
             {
-                foreach (Permanent permanent in player.GetFieldPermanents())
-                {
-                    permanent.UntilEndBattleEffects = new List<Func<EffectTiming, ICardEffect>>();
-                }
-
-                player.UntilEndBattleEffects = new List<Func<EffectTiming, ICardEffect>>();
+                permanent.UntilEndBattleEffects = new List<Func<EffectTiming, ICardEffect>>();
             }
 
-            #endregion
+            player.UntilEndBattleEffects = new List<Func<EffectTiming, ICardEffect>>();
         }
 
+        #endregion
+
         if (AttackingPermanent != null)
         {
             AttackingPermanent.battle = null;
@@ -5036,65 +5020,6 @@ public class IAddSecurity
         yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnAddSecurity));
 
         #endregion
-
-        #region "When face up cards are added"
-        if (!_cardSource.IsFlipped)
-        {
-            #region Hashtable setting
-
-            Hashtable faceUpHashtable = new Hashtable()
-            {
-                {"Player", _player},
-                {"CardSources", new List<CardSource> { _cardSource } }
-            };
-
-            #endregion
-
-            yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(faceUpHashtable, EffectTiming.OnFaceUpSecurityIncreased));
-        }
-        #endregion
-    }
-}
-
-#endregion
-
-#region Flip Security Face Up
-
-public class IFlipSecurity
-{
-    public IFlipSecurity(CardSource source)
-    {
-        _player = source.Owner;
-        _cardSource = source;
-    }
-
-    Player _player { get; set; }
-    CardSource _cardSource {  get; set; }
-
-    public IEnumerator FlipFaceUp()
-    {
-        if (!_player.SecurityCards.Contains(_cardSource) || !_cardSource.IsFlipped)
-            yield break;
-
-        _cardSource.SetFace();
-
-        #region "When face up cards are added"
-
-        #region Hashtable setting
-
-        Hashtable hashtable = new Hashtable()
-        {
-            {"Player", _player},
-            {"CardSources", new List<CardSource> { _cardSource } }
-        };
-
-        #endregion
-
-        if (!_cardSource.IsFlipped)
-        {
-            yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.StackSkillInfos(hashtable, EffectTiming.OnFaceUpSecurityIncreased));
-        }
-        #endregion
     }
 }
 
@@ -5299,11 +5224,6 @@ public class IUnsuspendPermanents
 
             yield return new WaitForSeconds(0.3f);
         }
-
-        foreach (Permanent permanent in untappedPermanets)
-        {
-            permanent.UntilNextUntapEffects = new List<Func<EffectTiming, ICardEffect>>();
-        }
     }
 }
 
@@ -5530,4 +5450,4 @@ public class ITrashStack
     }
 }
 
-#endregion
+#endregion