Przeglądaj źródła

weregarurumon, lampmon, megaseadramon, shuffle algorithm

mbunch_kascope 1 rok temu
rodzic
commit
38782a0532

+ 3 - 3
Assets/CardEffect/BT1/Blue/WereGarurumon_BT1_040.cs

@@ -2,12 +2,12 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace CardEffect.BT1.Blue
+namespace DCGO.CardEffects.BT1
 {
 {
     public class WereGarurumon_BT1_040 : CEntity_Effect
     public class WereGarurumon_BT1_040 : CEntity_Effect
     {
     {
-         public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
-    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
         List<ICardEffect> cardEffects = new List<ICardEffect>();
         List<ICardEffect> cardEffects = new List<ICardEffect>();
 
 
         if (timing == EffectTiming.OnAllyAttack)
         if (timing == EffectTiming.OnAllyAttack)

+ 1 - 1
Assets/CardEffect/BT12/Yellow/Lampmon_BT12_044.cs

@@ -115,7 +115,7 @@ public class Lampmon_BT12_044 : CEntity_Effect
         #endregion
         #endregion
 
 
         #region Your Turn
         #region Your Turn
-        if (timing == EffectTiming.AfterEffectsActivate || timing == EffectTiming.OnStartTurn || timing == EffectTiming.OnEnterFieldAnyone || timing == EffectTiming.OnUseOption || timing == EffectTiming.OptionSkill || timing == EffectTiming.SecuritySkill || timing == EffectTiming.OnDestroyedAnyone)
+        if (timing == EffectTiming.AfterEffectsActivate || timing == EffectTiming.OnStartTurn || timing == EffectTiming.OnEnterFieldAnyone || timing == EffectTiming.OnUseOption || timing == EffectTiming.OptionSkill || timing == EffectTiming.SecuritySkill || timing == EffectTiming.WhenRemoveField)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
             activateClass.SetUpICardEffect("Gain Security Attack", CanUseCondition, card);
             activateClass.SetUpICardEffect("Gain Security Attack", CanUseCondition, card);

+ 3 - 3
Assets/CardEffect/BT15/Blue/MegaSeadramon_BT15_029.cs

@@ -241,8 +241,8 @@ public class MegaSeadramon_BT15_029 : CEntity_Effect
         if (timing == EffectTiming.OnAllyAttack)
         if (timing == EffectTiming.OnAllyAttack)
         {
         {
             ActivateClass activateClass = new ActivateClass();
             ActivateClass activateClass = new ActivateClass();
-            activateClass.SetUpICardEffect("Unsuspend this Digimon", CanUseCondition, card);
-            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+            activateClass.SetUpICardEffect("Unsuspend this Digimon, by placing 1 blue Digimon as bottom source", CanUseCondition, card);
+            activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
             activateClass.SetIsInheritedEffect(true);
             activateClass.SetIsInheritedEffect(true);
             activateClass.SetHashString("Unsuspend_BT15_020");
             activateClass.SetHashString("Unsuspend_BT15_020");
             cardEffects.Add(activateClass);
             cardEffects.Add(activateClass);
@@ -300,7 +300,7 @@ public class MegaSeadramon_BT15_029 : CEntity_Effect
                         canTargetCondition_ByPreSelecetedList: null,
                         canTargetCondition_ByPreSelecetedList: null,
                         canEndSelectCondition: null,
                         canEndSelectCondition: null,
                         maxCount: maxCount,
                         maxCount: maxCount,
-                        canNoSelect: true,
+                        canNoSelect: false,
                         canEndNotMax: false,
                         canEndNotMax: false,
                         selectPermanentCoroutine: SelectPermanentSourceCoroutine,
                         selectPermanentCoroutine: SelectPermanentSourceCoroutine,
                         afterSelectPermanentCoroutine: null,
                         afterSelectPermanentCoroutine: null,

+ 11 - 0
Assets/Scripts/AttackProcess.cs

@@ -53,6 +53,17 @@ public class AttackProcess : MonoBehaviourPunCallbacks
 
 
         IsAttacking = true;
         IsAttacking = true;
 
 
+        // check timing
+        yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
+
+        GManager.instance.turnStateMachine.IsSelecting = true;
+
+        // force to end attack
+        if (IsEndAttack)
+        {
+            goto EndAttack;
+        }
+
         #region Attack Process
         #region Attack Process
         if (AttackingPermanent != null)
         if (AttackingPermanent != null)
         {
         {

+ 2 - 2
Assets/Scripts/CardEffectCommons/MinMax_DP_Cost_Level/Cost/IsMinCost.cs

@@ -22,14 +22,14 @@ public partial class CardEffectCommons
 
 
         if (IsDigimonOnly)
         if (IsDigimonOnly)
         {
         {
-            costs = permanent.TopCard.Owner.GetBattleAreaPermanents()
+            costs = permanents
                 .Filter(permanent1 => condition == null || (condition != null && condition(permanent1)))
                 .Filter(permanent1 => condition == null || (condition != null && condition(permanent1)))
                 .Filter(permanent1 => permanent1.IsDigimon && permanent1.TopCard.HasPlayCost)
                 .Filter(permanent1 => permanent1.IsDigimon && permanent1.TopCard.HasPlayCost)
                 .Map(permanent1 => permanent1.TopCard.GetCostItself);
                 .Map(permanent1 => permanent1.TopCard.GetCostItself);
         }
         }
         else
         else
         {
         {
-            costs = permanent.TopCard.Owner.GetBattleAreaPermanents()
+            costs = permanents
                 .Filter(permanent1 => condition == null || (condition != null && condition(permanent1)))
                 .Filter(permanent1 => condition == null || (condition != null && condition(permanent1)))
                 .Filter(permanent1 => (permanent1.IsDigimon || permanent1.IsTamer) && permanent1.TopCard.HasPlayCost)
                 .Filter(permanent1 => (permanent1.IsDigimon || permanent1.IsTamer) && permanent1.TopCard.HasPlayCost)
                 .Map(permanent1 => permanent1.TopCard.GetCostItself);
                 .Map(permanent1 => permanent1.TopCard.GetCostItself);

+ 20 - 36
Assets/Scripts/ContinuousController.cs

@@ -1145,30 +1145,22 @@ public static class RandomUtility
     public static List<CEntity_Base> ShuffledDeckCards(List<CEntity_Base> DeckCards)
     public static List<CEntity_Base> ShuffledDeckCards(List<CEntity_Base> DeckCards)
     {
     {
         List<CEntity_Base> CardDatas = new List<CEntity_Base>();
         List<CEntity_Base> CardDatas = new List<CEntity_Base>();
+        CardDatas.AddRange(DeckCards);
 
 
-        foreach (CEntity_Base cEntity_Base in DeckCards)
-        {
-            CardDatas.Add(cEntity_Base);
-        }
-
-        // The initial value of integer n is the number of cards in the deck
+        // The initial value of the integer n is the number of cards in the deck
         int n = CardDatas.Count;
         int n = CardDatas.Count;
 
 
-        for (int i = 0; i < 20; i++)
+        while (n > 0)
         {
         {
-            // Repeat until n is less than 1
-            while (n > 1)
-            {
-                n--;
+            n--;
 
 
-                // k is a random value between 0 and n+1
-                int k = UnityEngine.Random.Range(0, n + 1);
+            // Random index from 0 to i (inclusive)
+            int k = UnityEngine.Random.Range(0, n + 1);
 
 
-                // Assign the kth card to temp
-                CEntity_Base temp = CardDatas[k];
-                CardDatas[k] = CardDatas[n];
-                CardDatas[n] = temp;
-            }
+            // Swap elements at indices i and k
+            CEntity_Base temp = CardDatas[n];
+            CardDatas[n] = CardDatas[k];
+            CardDatas[k] = temp;
         }
         }
 
 
 
 
@@ -1178,30 +1170,22 @@ public static class RandomUtility
     public static List<CardSource> ShuffledDeckCards(List<CardSource> DeckCards)
     public static List<CardSource> ShuffledDeckCards(List<CardSource> DeckCards)
     {
     {
         List<CardSource> CardDatas = new List<CardSource>();
         List<CardSource> CardDatas = new List<CardSource>();
+        CardDatas.AddRange(DeckCards);
 
 
-        foreach (CardSource cardSource in DeckCards)
-        {
-            CardDatas.Add(cardSource);
-        }
-
-        // 整数 n の初期値はデッキの枚数
+        // The initial value of the integer n is the number of cards in the deck
         int n = CardDatas.Count;
         int n = CardDatas.Count;
 
 
-        for (int i = 0; i < 20; i++)
+        while (n > 0)
         {
         {
-            // nが1より小さくなるまで繰り返す
-            while (n > 1)
-            {
-                n--;
+            n--;
 
 
-                // kは 0 ~ n+1 の間のランダムな値
-                int k = UnityEngine.Random.Range(0, n + 1);
+            // Random index from 0 to i (inclusive)
+            int k = UnityEngine.Random.Range(0, n + 1);
 
 
-                // k番目のカードをtempに代入
-                CardSource temp = CardDatas[k];
-                CardDatas[k] = CardDatas[n];
-                CardDatas[n] = temp;
-            }
+            // Swap elements at indices i and k
+            CardSource temp = CardDatas[n];
+            CardDatas[n] = CardDatas[k];
+            CardDatas[k] = temp;
         }
         }