mbunch_kascope преди 1 година
родител
ревизия
248b14022a

+ 65 - 60
Assets/CardEffect/BT20/Black/BT20_060.cs

@@ -84,8 +84,7 @@ namespace DCGO.CardEffects.BT20
 
             bool CanActivateConditionShared(Hashtable hashtable)
             {
-                return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
-                       CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
+                return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
             }
 
             #endregion
@@ -112,42 +111,45 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    Permanent selectedPermanent = null;
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
+                    {
+                        Permanent selectedPermanent = null;
 
-                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                    selectPermanentEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectPermanentConditionShared,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: false,
-                        canEndNotMax: false,
-                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                        afterSelectPermanentCoroutine: null,
-                        mode: SelectPermanentEffect.Mode.Custom,
-                        cardEffect: activateClass);
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentConditionShared,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -15000.",
-                        "The opponent is selecting 1 Digimon that will get DP -15000.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -15000.",
+                            "The opponent is selecting 1 Digimon that will get DP -15000.");
 
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                    {
-                        selectedPermanent = permanent;
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
 
-                        yield return null;
-                    }
+                            yield return null;
+                        }
 
-                    if (selectedPermanent != null)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
-                            targetPermanent: selectedPermanent,
-                            changeValue: -15000,
-                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                            activateClass: activateClass));
+                        if (selectedPermanent != null)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                                targetPermanent: selectedPermanent,
+                                changeValue: -15000,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass));
+                        }
                     }
 
                     if (CardEffectCommons.IsJogress(hashtable))
@@ -190,42 +192,45 @@ namespace DCGO.CardEffects.BT20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    Permanent selectedPermanent = null;
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
+                    {
+                        Permanent selectedPermanent = null;
 
-                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
-                    selectPermanentEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectPermanentConditionShared,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: 1,
-                        canNoSelect: false,
-                        canEndNotMax: false,
-                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                        afterSelectPermanentCoroutine: null,
-                        mode: SelectPermanentEffect.Mode.Custom,
-                        cardEffect: activateClass);
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentConditionShared,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
 
-                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -15000.",
-                        "The opponent is selecting 1 Digimon that will get DP -15000.");
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -15000.",
+                            "The opponent is selecting 1 Digimon that will get DP -15000.");
 
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                    {
-                        selectedPermanent = permanent;
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            selectedPermanent = permanent;
 
-                        yield return null;
-                    }
+                            yield return null;
+                        }
 
-                    if (selectedPermanent != null)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
-                            targetPermanent: selectedPermanent,
-                            changeValue: -15000,
-                            effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                            activateClass: activateClass));
+                        if (selectedPermanent != null)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
+                                targetPermanent: selectedPermanent,
+                                changeValue: -15000,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass));
+                        }
                     }
 
                     if (CardEffectCommons.IsJogress(hashtable))

+ 4 - 4
Assets/CardEffect/BT20/Purple/BT20_066.cs

@@ -111,7 +111,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (card.Owner.HandCards.Count >= 1)
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                             {
                                 List<CardSource> selectedCards = new List<CardSource>();
 
@@ -165,7 +165,7 @@ namespace DCGO.CardEffects.BT20
                                                     endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
                                                     noSelectCoroutine: null);
 
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
+                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
 
                                                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
 
@@ -336,7 +336,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (card.Owner.HandCards.Count >= 1)
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                             {
                                 List<CardSource> selectedCards = new List<CardSource>();
 
@@ -390,7 +390,7 @@ namespace DCGO.CardEffects.BT20
                                                     endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
                                                     noSelectCoroutine: null);
 
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
+                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
 
                                                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
 

+ 6 - 1
Assets/CardEffect/BT20/Purple/BT20_098.cs

@@ -136,11 +136,16 @@ namespace DCGO.CardEffects.BT20
                                                cardEffect: activateClass);
                                 }
 
+                                bool CanNoSelect()
+                                {
+                                    return selectedCardsToPlay.Count == 0;
+                                }
+
                                 selectCardEffect.SetUp(
                                     canTargetCondition: CanSelectPlayCardCondition,
                                     canTargetCondition_ByPreSelecetedList: null,
                                     canEndSelectCondition: null,
-                                    canNoSelect: () => true,
+                                    canNoSelect: CanNoSelect,
                                     selectCardCoroutine: SelectCardCoroutine2,
                                     afterSelectCardCoroutine: null,
                                     message: "Select 1 card to play.",

+ 13 - 23
Assets/CardEffect/BT20/Red/BT20_011.cs

@@ -52,43 +52,33 @@ namespace DCGO.CardEffects.BT20
                 }
                 return false;
                 }
-                
+
                 bool CanSelectCardCondition(CardSource cardSource)
                 {
                     if (cardSource != null)
                     {
-                    if (cardSource.IsDigimon)
-                    {
-                        if (cardSource.Owner == card.Owner)
+                        if (cardSource.IsDigimon)
                         {
-                            if(cardSource.CardTraits.Contains("Free") || cardSource.ContainsCardName("Imperialdramon"))
-                            {        
-                                                
-                                if (cardSource.CanPlayJogress(true))
+                            if (cardSource.Owner == card.Owner)
+                            {
+                                if (cardSource.CardTraits.Contains("Free") || cardSource.ContainsCardName("Imperialdramon"))
                                 {
-                                    if (isExistOnField(card))
+                                    if (cardSource.CanPlayJogress(true))
                                     {
-                                        if (cardSource.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
-                                        {
-                                            return true;
-                                        }
+                                        return true;
                                     }
                                 }
                             }
-                        
                         }
                     }
-                    }
 
-                    return false;                
+                    return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {                   
-                        
-
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
                         int maxCount = 1;
 
@@ -114,7 +104,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (card.Owner.HandCards.Count >= 1)
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                             {
                                 List<CardSource> selectedCards = new List<CardSource>();
 
@@ -168,7 +158,7 @@ namespace DCGO.CardEffects.BT20
                                                     endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
                                                     noSelectCoroutine: null);
 
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
+                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
 
                                                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
 
@@ -336,7 +326,7 @@ namespace DCGO.CardEffects.BT20
                     {
                         if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(card.PermanentOfThisCard(), card))
                         {
-                            if (card.Owner.HandCards.Count >= 1)
+                            if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                             {
                                 List<CardSource> selectedCards = new List<CardSource>();
 
@@ -390,7 +380,7 @@ namespace DCGO.CardEffects.BT20
                                                     endSelectCoroutine_SelectDigivolutionRoots: EndSelectCoroutine_SelectDigivolutionRoots,
                                                     noSelectCoroutine: null);
 
-                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() });
+                                                GManager.instance.selectJogressEffect.SetUpCustomPermanentConditions(new Func<Permanent, bool>[] { (permanent) => permanent.TopCard.Owner == card.Owner });
 
                                                 yield return ContinuousController.instance.StartCoroutine(GManager.instance.selectJogressEffect.SelectDigivolutionRoots());
 
@@ -455,7 +445,7 @@ namespace DCGO.CardEffects.BT20
                                 }
                             }
                         }
-                    }                              
+                    }
                 }
             }
             #endregion

+ 1 - 6
Assets/Scripts/AttackProcess.cs

@@ -69,8 +69,6 @@ public class AttackProcess : MonoBehaviourPunCallbacks
             goto EndAttack;
         }
 
-        UnityEngine.Debug.Log($"ATTACK PROCESS: {AttackingPermanent}");
-        UnityEngine.Debug.Log($"ATTACK PROCESS: {CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent)}");
         #region Attack Process
         if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent))
         {
@@ -214,9 +212,6 @@ public class AttackProcess : MonoBehaviourPunCallbacks
             // check timing
             yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.AutoProcessCheck());
 
-            //End Turn Check
-            yield return ContinuousController.instance.StartCoroutine(GManager.instance.autoProcessing.EndTurnCheck());
-
             GManager.instance.turnStateMachine.IsSelecting = true;
 
             // force to end attack
@@ -402,7 +397,7 @@ public class AttackProcess : MonoBehaviourPunCallbacks
             #region there is Defending Permanent
             else
             {
-                if (CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent) || CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent))
+                if (!CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(DefendingPermanent) || !CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(AttackingPermanent))
                 {
                     goto EndAttack;
                 }