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

Gallantmon X Line

fix alternate digivolution target issues, fix activation timing for growlmon x, and fix gallantmon x end of attack not activating.
Joe Delia 1 год назад
Родитель
Сommit
80f539b759

+ 0 - 1
Assets/CardEffect/EX8/Purple/NightmareSoldiers_EX8_071.cs

@@ -47,7 +47,6 @@ namespace DCGO.CardEffects.EX8
                            permanent.TopCard.EqualsTraits("NSo");
                 }
 
-                // TODO: Apply Scapegoat to all NSo Digimon
                 cardEffects.Add(CardEffectFactory.ScapegoatStaticEffect(
                     permanentCondition: PermanentCondition,
                     isInheritedEffect: false,

+ 100 - 4
Assets/CardEffect/EX8/Red/GallantmonXAntibody_EX8_073.cs

@@ -16,10 +16,16 @@ namespace DCGO.CardEffects.EX8
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.ContainsCardName("Gallantmon");
+                    return targetPermanent.TopCard.EqualsCardName("Gallantmon");
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 1,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
             }
             #endregion
 
@@ -27,7 +33,7 @@ namespace DCGO.CardEffects.EX8
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("This Digimong gets +4000 DP and gives -4000 DP to an opponent's Digimon", CanUseCondition, card);
+                activateClass.SetUpICardEffect("This Digimon gets +4000 DP and gives -4000 DP to an opponent's Digimon", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -202,7 +208,7 @@ namespace DCGO.CardEffects.EX8
 
                 string EffectDescription()
                 {
-                    return "[When Digivolving][Once Per Turn] Delete 1 of your opponent's Digimon with 10000 DP or less. If this didn't delete, trash your opponent's top security card and this Digimon unsuspends.";
+                    return "[When Digivolving] [Once Per Turn] Delete 1 of your opponent's Digimon with 10000 DP or less. If this didn't delete, trash your opponent's top security card and this Digimon unsuspends.";
                 }
 
                 bool CanSelectOpponentPermanentCondition(Permanent permanent)
@@ -288,6 +294,96 @@ namespace DCGO.CardEffects.EX8
                 }
             }
             #endregion
+            
+            #region End of Attack - Once Per Turn
+            if (timing == EffectTiming.OnEndAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Delete 1 Digimon with 10000 DP or less, or trash the opponent's top security and unsuspend", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetHashString("Delete_EX8_073");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[End of Attack] [Once Per Turn] Delete 1 of your opponent's Digimon with 10000 DP or less. If this didn't delete, trash your opponent's top security card and this Digimon unsuspends.";
+                }
+
+                bool CanSelectOpponentPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(10000, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnEndAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    List<Permanent> deleteTargetPermanents = new List<Permanent>();
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectOpponentPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
+                        {
+                            deleteTargetPermanents = permanents.Clone();
+                            yield return null;
+                        }
+                    }
+
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: deleteTargetPermanents, activateClass: activateClass, successProcess: null, failureProcess: FailureProcess));
+
+                    IEnumerator FailureProcess()
+                    {
+                        if (card.Owner.Enemy.SecurityCards.Count >= 1)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                                player: card.Owner.Enemy,
+                                destroySecurityCount: 1,
+                                cardEffect: activateClass,
+                                fromTop: true).DestroySecurity());
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(new IUnsuspendPermanents(new List<Permanent>() { card.PermanentOfThisCard() }, activateClass).Unsuspend());
+                    }
+                }
+            }
+            #endregion
 
             #region All Turns 
             if (timing == EffectTiming.None)

+ 9 - 4
Assets/CardEffect/EX8/Red/GrowlmonXAntibody_EX8_012.cs

@@ -16,15 +16,20 @@ namespace DCGO.CardEffects.EX8
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.ContainsCardName("Growlmon");
+                    return targetPermanent.TopCard.EqualsCardName("Growlmon");
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card, condition: null)
+                );
             }
             #endregion
 
             #region When Digivolving
-            if (timing == EffectTiming.OnAllyAttack)
+            if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Draw 1 and trash 1 card from hand. Then this Digimon gains On Deletion.", CanUseCondition, card);
@@ -82,7 +87,7 @@ namespace DCGO.CardEffects.EX8
                         yield return StartCoroutine(selectHandEffect.Activate());
                     }
 
-                    if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("X Antibody"))) >= 1)
+                    if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.EqualsCardName("Growlmon") || cardSource.EqualsCardName("X Antibody"))) >= 1)
                     {
                         Permanent selectedPermanent = card.PermanentOfThisCard();
                         CardSource _topCard = selectedPermanent.TopCard;

+ 40 - 74
Assets/CardEffect/EX8/Red/GuilmonXAntibody_EX8_009.cs

@@ -14,44 +14,56 @@ namespace DCGO.CardEffects.EX8
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.ContainsCardName("Guilmon") || targetPermanent.TopCard.ContainsCardName("Gigimon");
+                    return targetPermanent.TopCard.EqualsCardName("Guilmon") || targetPermanent.TopCard.EqualsCardName("Gigimon");
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card, condition: null)
+                );
             }
             #endregion
 
-            #region On Play
-            if (timing == EffectTiming.OnEnterFieldAnyone)
+            #region On Play/When Digivolving Shared
+            
+            bool CanSelectGrowlmonGallantmonCondition(CardSource cardSource)
             {
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
-                cardEffects.Add(activateClass);
+                return cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("Gallantmon");
+            }
 
-                string EffectDiscription()
-                {
-                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Growlmon]/[Gallantmon] in its name and 1 [X Antibody] among them to the hand. Return the rest to the bottom of the deck.";
-                }
+            bool CanSelectXAntibodyCondition(CardSource cardSource)
+            {
+                return cardSource.EqualsCardName("X Antibody");
+            }
 
-                bool CanSelectCardCondition(CardSource cardSource)
+            bool CanActivateOnPlayWhenDigivolvingCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                 {
-                    if (cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("Gallantmon"))
+                    if (card.Owner.LibraryCards.Count >= 1)
                     {
                         return true;
                     }
-
-                    return false;
                 }
 
-                bool CanSelectCardCondition1(CardSource cardSource)
-                {
-                    if (cardSource.ContainsCardName("X Antibody"))
-                    {
-                        return true;
-                    }
+                return false;
+            }
+            
+            #endregion
+            
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateOnPlayWhenDigivolvingCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
 
-                    return false;
+                string EffectDiscription()
+                {
+                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Growlmon]/[Gallantmon] in its name and 1 [X Antibody] among them to the hand. Return the rest to the bottom of the deck.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -59,19 +71,6 @@ namespace DCGO.CardEffects.EX8
                     return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (card.Owner.LibraryCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
@@ -80,13 +79,13 @@ namespace DCGO.CardEffects.EX8
                         new SimplifiedSelectCardConditionClass[]
                         {
                         new SimplifiedSelectCardConditionClass(
-                            canTargetCondition:CanSelectCardCondition,
+                            canTargetCondition:CanSelectGrowlmonGallantmonCondition,
                             message: "Select 1 card with [Growlmon] or [Gallantmon] in its name.",
                             mode: SelectCardEffect.Mode.AddHand,
                             maxCount: 1,
                             selectCardCoroutine: null),
                         new SimplifiedSelectCardConditionClass(
-                            canTargetCondition:CanSelectCardCondition1,
+                            canTargetCondition:CanSelectXAntibodyCondition,
                             message:"Select 1 [X Antibody].",
                             mode: SelectCardEffect.Mode.AddHand,
                             maxCount: 1,
@@ -104,7 +103,7 @@ namespace DCGO.CardEffects.EX8
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateOnPlayWhenDigivolvingCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -112,26 +111,6 @@ namespace DCGO.CardEffects.EX8
                     return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Growlmon]/[Gallantmon] in its name and 1 [X Antibody] among them to the hand. Return the rest to the bottom of the deck.";
                 }
 
-                bool CanSelectCardCondition(CardSource cardSource)
-                {
-                    if (cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("Gallantmon"))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
-                bool CanSelectCardCondition1(CardSource cardSource)
-                {
-                    if (cardSource.ContainsCardName("X Antibody"))
-                    {
-                        return true;
-                    }
-
-                    return false;
-                }
-
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
@@ -145,19 +124,6 @@ namespace DCGO.CardEffects.EX8
                     return false;
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (card.Owner.LibraryCards.Count >= 1)
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
-                }
-
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
@@ -166,13 +132,13 @@ namespace DCGO.CardEffects.EX8
                         new SimplifiedSelectCardConditionClass[]
                         {
                         new SimplifiedSelectCardConditionClass(
-                            canTargetCondition:CanSelectCardCondition,
+                            canTargetCondition:CanSelectGrowlmonGallantmonCondition,
                             message: "Select 1 card with [Growlmon] or [Gallantmon] in its name.",
                             mode: SelectCardEffect.Mode.AddHand,
                             maxCount: 1,
                             selectCardCoroutine: null),
                         new SimplifiedSelectCardConditionClass(
-                            canTargetCondition:CanSelectCardCondition1,
+                            canTargetCondition:CanSelectXAntibodyCondition,
                             message:"Select 1 [X Antibody].",
                             mode: SelectCardEffect.Mode.AddHand,
                             maxCount: 1,

+ 10 - 5
Assets/CardEffect/EX8/Red/WarGrowlmonXAntibody_EX8_015.cs

@@ -16,10 +16,15 @@ namespace DCGO.CardEffects.EX8
             {
                 bool PermanentCondition(Permanent targetPermanent)
                 {
-                    return targetPermanent.TopCard.ContainsCardName("WarGrowlmon");
+                    return targetPermanent.TopCard.EqualsCardName("WarGrowlmon");
                 }
 
-                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false, card: card, condition: null));
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 1,
+                    ignoreDigivolutionRequirement: false,
+                    card: card, condition: null)
+                );
             }
             #endregion
 
@@ -27,7 +32,7 @@ namespace DCGO.CardEffects.EX8
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Can't be returned to the hand or deck", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Can't be returned to the hand or deck and delete 1 Digimon with 10000 DP or less.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
                 cardEffects.Add(activateClass);
 
@@ -66,7 +71,7 @@ namespace DCGO.CardEffects.EX8
                 {
                     if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
-                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("X Antibody"))) >= 1)
+                        if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => (cardSource.EqualsCardName("WarGrowlmon") || cardSource.EqualsCardName("X Antibody"))) >= 1)
                         {
                             return true;
                         }
@@ -112,7 +117,7 @@ namespace DCGO.CardEffects.EX8
                             effectDuration: EffectDuration.UntilOpponentTurnEnd,
                             activateClass: activateClass));
 
-                    if(CanActivateEffect(hashtable))
+                    if (CanActivateEffect(hashtable))
                     {
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));