Просмотр исходного кода

Merge branch 'BT21' of https://github.com/DCGO2/DCGO into BT21

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

+ 2 - 2
Assets/CardBaseEntity/BT1/Green/Digimon/BT1_083.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:1de2bfa74c314f5f2dc67293fee545acbd25f543ef6a6da602f4b177a601e455
-size 1861
+oid sha256:3c1f5dd3bba9e504f16e7f10008b0872ba02d1e8be6e2c5662e5000395d64040
+size 1853

+ 2 - 2
Assets/CardBaseEntity/BT1/Green/Digimon/BT1_083_P1.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:f8c6cf1ff62f37687ffa3a935f508cc3c29cbf5f01bfa4042f9e2f63301928c6
-size 1867
+oid sha256:e0ccd30f618bb46d17612c668e1406aac52f9c6b7725287dc7cc2a188f81c188
+size 1859

+ 10 - 13
Assets/CardEffect/ST20/Black/ST20_14.cs

@@ -13,6 +13,7 @@ namespace DCGO.CardEffects.ST20
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
             #region ignoring colours
+
             if (timing == EffectTiming.None)
             {
                 IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
@@ -22,21 +23,16 @@ namespace DCGO.CardEffects.ST20
                 cardEffects.Add(ignoreColorConditionClass);
 
                 bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.HasMatchConditionPermanent(permanent => 
-                        CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
-                        && permanent.TopCard.HasAdventureTraits
-                        && (permanent.IsTamer || permanent.IsDigimon), true);
-                }
+                    => CardEffectCommons.HasMatchConditionPermanent((permanent) => (permanent.IsTamer || permanent.IsDigimon) && permanent.TopCard.HasAdventureTraits, true);
 
                 bool CardCondition(CardSource cardSource)
-                {
-                    return (cardSource == card);
-                }
+                    => cardSource == card;
             }
+
             #endregion
 
             #region Main effect
+
             if (timing == EffectTiming.OptionSkill)
             {
                 ActivateClass activateClass = new ActivateClass();
@@ -56,12 +52,11 @@ namespace DCGO.CardEffects.ST20
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (card.Owner.LibraryCards.Count <= 1) yield break;
-                    yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
-
+                    if (card.Owner.LibraryCards.Count >= 2) yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
                 }
             }
+
             #endregion
 
             #region delay
@@ -114,7 +109,6 @@ namespace DCGO.CardEffects.ST20
 
                         bool CanPlayAdventureCondition(CardSource cardSource)
                         {
-                            
                             if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
                             {
                                 return cardSource.IsDigimon &&
@@ -172,13 +166,16 @@ namespace DCGO.CardEffects.ST20
                     }
                 }
             }
+
             #endregion
 
             #region Security
+
             if (timing == EffectTiming.SecuritySkill)
             {
                 cardEffects.Add(CardEffectFactory.PlaceSelfDelayOptionSecurityEffect(card));
             }
+
             #endregion
 
             return cardEffects;

+ 51 - 71
Assets/CardEffect/ST21/Blue/ST21_03.cs

@@ -35,31 +35,25 @@ namespace DCGO.CardEffects.ST21
             #region On Play/When Digivolving shared
 
             bool CanActivateConditonShared(Hashtable hashtable)
-            {
-                return CardEffectCommons.HasMatchConditionPermanent(CanTargetStrip);
-            }
+                => CardEffectCommons.IsExistOnBattleAreaDigimon(card);
 
-            bool CanTargetStrip(Permanent permanent)
+            IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
             {
-                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
-            }
+                bool CanSelectPermanentCondition(Permanent permanent)
+                => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
+                && permanent.DigivolutionCards.Count >= 2;
 
-            bool OpponentsDigimonWithoutSources(Permanent permanent)
-            {
-                return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
-                       permanent.DigivolutionCards.Count == 0;
-            }
+                bool CanSelectPermanentCondition2(Permanent permanent)
+                    => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
+                    && permanent.HasNoDigivolutionCards;
 
-            IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
-            {
-                Permanent selectedPermanent = null;
-                if (CardEffectCommons.HasMatchConditionPermanent(CanTargetStrip))
+                if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => CanSelectPermanentCondition(permanent)))
                 {
                     SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
                     selectPermanentEffect.SetUp(
                         selectPlayer: card.Owner,
-                        canTargetCondition: CanTargetStrip,
+                        canTargetCondition: (permanent) => CanSelectPermanentCondition(permanent),
                         canTargetCondition_ByPreSelecetedList: null,
                         canEndSelectCondition: null,
                         maxCount: 1,
@@ -70,59 +64,49 @@ namespace DCGO.CardEffects.ST21
                         mode: SelectPermanentEffect.Mode.Custom,
                         cardEffect: activateClass);
 
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                    {
-                        selectedPermanent = permanent;
-
-                        yield return null;
-                    }
-
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will trash digivolution cards.", "The opponent is selecting 1 Digimon that will trash digivolution cards.");
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                    if (selectedPermanent != null)
+                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
                     {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(selectedPermanent, 2, true, activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(targetPermanent: permanent, trashCount: 2, isFromTop: true, activateClass: activateClass));
                     }
                 }
 
-                selectedPermanent = null;
-                SelectPermanentEffect selectPermanentEffect2 = GManager.instance.GetComponent<SelectPermanentEffect>();
-                selectPermanentEffect2.SetUp(
-                    selectPlayer: card.Owner,
-                    canTargetCondition: OpponentsDigimonWithoutSources,
-                    canTargetCondition_ByPreSelecetedList: null,
-                    canEndSelectCondition: null,
-                    maxCount: 1,
-                    canNoSelect: false,
-                    canEndNotMax: false,
-                    selectPermanentCoroutine: SelectPermanentCoroutine2,
-                    afterSelectPermanentCoroutine: null,
-                    mode: SelectPermanentEffect.Mode.Custom,
-                    cardEffect: activateClass);
-
-                IEnumerator SelectPermanentCoroutine2(Permanent permanent)
+                if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, permanent => CanSelectPermanentCondition2(permanent)))
                 {
-                    selectedPermanent = permanent;
-
-                    yield return null;
-                }
-                yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect2.Activate());
+                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                    selectPermanentEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: (permanent) => CanSelectPermanentCondition2(permanent),
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        maxCount: 1,
+                        canNoSelect: false,
+                        canEndNotMax: false,
+                        selectPermanentCoroutine: SelectPermanentCoroutine2,
+                        afterSelectPermanentCoroutine: null,
+                        mode: SelectPermanentEffect.Mode.Custom,
+                        cardEffect: activateClass);
 
-                if (selectedPermanent != null)
-                {
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
-                            targetPermanent: selectedPermanent,
-                            defenderCondition: null,
+                    selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that cant attack or block.", "The opponent is selecting 1 Digimon that cant attack or block");
+                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    IEnumerator SelectPermanentCoroutine2(Permanent permanent)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
+                                targetPermanent: permanent,
+                                defenderCondition: null,
+                                effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                                activateClass: activateClass,
+                                effectName: "Can't Attack"));
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(
+                            targetPermanent: permanent,
+                            attackerCondition: null,
                             effectDuration: EffectDuration.UntilOpponentTurnEnd,
                             activateClass: activateClass,
-                            effectName: "Can't Attack"));
-
-                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(
-                        targetPermanent: selectedPermanent,
-                        attackerCondition: null,
-                        effectDuration: EffectDuration.UntilOpponentTurnEnd,
-                        activateClass: activateClass,
-                        effectName: "Can't Block"));
+                            effectName: "Can't Block"));
+                    }
                 }
             }
 
@@ -135,16 +119,14 @@ namespace DCGO.CardEffects.ST21
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Strip top 2, then freeze", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateConditonShared, (hashtable) => SharedActivateCoroutine(hashtable, activateClass), -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
 
                 string EffectDescription()
-                {
-                    return "[On Play] Trash the top 2 digivolution cards of 1 of your opponent's Digimon. Then, 1 of their Digimon with no digivolution cards can't attack or block until their turn ends.";
-                }
+                    => "[On Play] Trash the top 2 digivolution cards of 1 of your opponent's Digimon. Then, 1 of their Digimon with no digivolution cards can't attack or block until their turn ends.";
 
                 bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
-                }
+                => CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
             }
 
             #endregion
@@ -156,16 +138,14 @@ namespace DCGO.CardEffects.ST21
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Strip top 2, then freeze", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateConditonShared, (hashtable) => SharedActivateCoroutine(hashtable, activateClass), -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
 
                 string EffectDescription()
-                {
-                    return "[When Digivolving] Trash the top 2 digivolution cards of 1 of your opponent's Digimon. Then, 1 of their Digimon with no digivolution cards can't attack or block until their turn ends.";
-                }
+                    => "[When Digivolving] Trash the top 2 digivolution cards of 1 of your opponent's Digimon. Then, 1 of their Digimon with no digivolution cards can't attack or block until their turn ends.";
 
                 bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
-                }
+                => CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
             }
 
             #endregion