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

+ 2 - 4
Assets/CardEffect/ST20/Black/ST20_11.cs

@@ -85,8 +85,7 @@ namespace DCGO.CardEffects.ST20
                     List<Permanent> selectedPermanents = new List<Permanent>();
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectProtectCondition))
                     {
-                        //Probably could get away with just 1 min and don't check against min 1, but I'm not going to change what I don't understand for no reason
-                        int maxCount = Math.Min(Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectProtectCondition)), TamerTwoColourCount());
+                        int maxCount = Math.Min(Math.Max(1, TamerTwoColourCount()), CardEffectCommons.MatchConditionPermanentCount(CanSelectProtectCondition));
 
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
@@ -201,8 +200,7 @@ namespace DCGO.CardEffects.ST20
                     List<Permanent> selectedPermanents = new List<Permanent>();
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectProtectCondition) && TamerTwoColourCount() > 0)
                     {
-                        //Probably could get away with just 1 min and don't check against min 1, but I'm not going to change what I don't understand for no reason
-                        int maxCount = Math.Min(Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectProtectCondition)), TamerTwoColourCount());
+                        int maxCount = Math.Min(Math.Max(1, TamerTwoColourCount()), CardEffectCommons.MatchConditionPermanentCount(CanSelectProtectCondition));
 
                         SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 

+ 37 - 4
Assets/CardEffect/ST20/Green/ST20_09.cs

@@ -44,6 +44,11 @@ namespace DCGO.CardEffects.ST20
                 return Combinations.GetDifferenetColorCardCount(tamerCards) / 2;
             }
 
+            bool CanSelectYourDigimonCondition(Permanent permanent)
+            {
+                return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+            }
+
             bool CanSelectPermanentCondition(Permanent permanent)
             {
                 return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
@@ -70,8 +75,22 @@ namespace DCGO.CardEffects.ST20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(
-                        new IUnsuspendPermanents(new List<Permanent>() { card.PermanentOfThisCard() }, activateClass).Unsuspend());
+                    SelectPermanentEffect selectUnsuspendEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectUnsuspendEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectYourDigimonCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.UnTap,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectUnsuspendEffect.Activate());
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) && TamerTwoColourCount() > 0)
                     {
@@ -121,8 +140,22 @@ namespace DCGO.CardEffects.ST20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return ContinuousController.instance.StartCoroutine(
-                        new IUnsuspendPermanents(new List<Permanent>() { card.PermanentOfThisCard() }, activateClass).Unsuspend());
+                    SelectPermanentEffect selectUnsuspendEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                    selectUnsuspendEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: CanSelectYourDigimonCondition,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: null,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.UnTap,
+                        cardEffect: activateClass);
+
+                    yield return ContinuousController.instance.StartCoroutine(selectUnsuspendEffect.Activate());
 
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition) && TamerTwoColourCount() > 0)
                     {

+ 4 - 2
Assets/CardEffect/ST20/Red/ST20_04.cs

@@ -186,7 +186,7 @@ namespace DCGO.CardEffects.ST20
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain alliance then attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST20-004");
                 cardEffects.Add(activateClass);
 
@@ -282,7 +282,7 @@ namespace DCGO.CardEffects.ST20
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,
@@ -310,6 +310,8 @@ namespace DCGO.CardEffects.ST20
                                 defenderCondition: _ => true,
                                 cardEffect: activateClass);
 
+                            selectAttackEffect.SetCanNotSelectNotAttack();
+
                             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }

+ 4 - 2
Assets/CardEffect/ST20/Yellow/ST20_06.cs

@@ -245,7 +245,7 @@ namespace DCGO.CardEffects.ST20
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain alliance then attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST20-006");
                 cardEffects.Add(activateClass);
 
@@ -341,7 +341,7 @@ namespace DCGO.CardEffects.ST20
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,
@@ -369,6 +369,8 @@ namespace DCGO.CardEffects.ST20
                                 defenderCondition: _ => true,
                                 cardEffect: activateClass);
 
+                            selectAttackEffect.SetCanNotSelectNotAttack();
+
                             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }

+ 6 - 3
Assets/CardEffect/ST21/Blue/ST21_04.cs

@@ -133,7 +133,8 @@ namespace DCGO.CardEffects.ST21
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -184,7 +185,7 @@ namespace DCGO.CardEffects.ST21
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain alliance then attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST21-09");
                 cardEffects.Add(activateClass);
 
@@ -280,7 +281,7 @@ namespace DCGO.CardEffects.ST21
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,
@@ -308,6 +309,8 @@ namespace DCGO.CardEffects.ST21
                                 defenderCondition: _ => true,
                                 cardEffect: activateClass);
 
+                            selectAttackEffect.SetCanNotSelectNotAttack();
+
                             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }

+ 4 - 2
Assets/CardEffect/ST21/Green/ST21_09.cs

@@ -160,7 +160,7 @@ namespace DCGO.CardEffects.ST21
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain alliance then attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST21-09");
                 cardEffects.Add(activateClass);
 
@@ -256,7 +256,7 @@ namespace DCGO.CardEffects.ST21
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,
@@ -284,6 +284,8 @@ namespace DCGO.CardEffects.ST21
                                 defenderCondition: _ => true,
                                 cardEffect: activateClass);
 
+                            selectAttackEffect.SetCanNotSelectNotAttack();
+
                             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }

+ 8 - 5
Assets/CardEffect/ST21/Yellow/ST21_06.cs

@@ -44,6 +44,7 @@ namespace DCGO.CardEffects.ST21
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place into security", canUseCondition, card);
                 activateClass.SetUpActivateClass(canActivateCondition, activateCoroutine, -1, false, effectDescription());
+                cardEffects.Add(activateClass);
 
                 string effectDescription()
                 {
@@ -52,9 +53,8 @@ namespace DCGO.CardEffects.ST21
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) 
-                        && permanent.TopCard.Owner.CanAddSecurity(activateClass)
-                        && permanent.HasDP && permanent.DP <= 6000 + 2000 * TamerTwoColourCount();
+                    return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) && 
+                           permanent.HasDP && permanent.DP <= 6000 + (2000 * TamerTwoColourCount());
                 }
 
                 bool canActivateCondition(Hashtable hashtable)
@@ -111,6 +111,7 @@ namespace DCGO.CardEffects.ST21
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place into security", canUseCondition, card);
                 activateClass.SetUpActivateClass(canActivateCondition, activateCoroutine, -1, false, effectDescription());
+                cardEffects.Add(activateClass);
 
                 string effectDescription()
                 {
@@ -177,7 +178,7 @@ namespace DCGO.CardEffects.ST21
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain Alliance then attack", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
                 activateClass.SetHashString("alliance-attack-ST21-006");
                 cardEffects.Add(activateClass);
 
@@ -273,7 +274,7 @@ namespace DCGO.CardEffects.ST21
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             maxCount: 1,
-                            canNoSelect: false,
+                            canNoSelect: true,
                             canEndNotMax: false,
                             selectPermanentCoroutine: SelectPermanentCoroutine,
                             afterSelectPermanentCoroutine: null,
@@ -301,6 +302,8 @@ namespace DCGO.CardEffects.ST21
                                 defenderCondition: _ => true,
                                 cardEffect: activateClass);
 
+                            selectAttackEffect.SetCanNotSelectNotAttack();
+
                             yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
                         }
                     }