Andrej Erdelsky 1 год назад
Родитель
Сommit
3dd7545044

+ 2 - 2
Assets/CardEffect/BT19/Blue/Gaossmon_BT19_016.cs

@@ -134,7 +134,7 @@ namespace DCGO.CardEffects.BT19
             if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Place 1 [Blue Flare] card under 1 of your Tamers to <Draw 1>", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Place 1 [Blue Flare] card from hand under 1 of your Tamers to <Draw 1>", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
                 cardEffects.Add(activateClass);
 
@@ -177,7 +177,7 @@ namespace DCGO.CardEffects.BT19
                         cardEffect: activateClass);
 
                     selectHandEffect.SetUpCustomMessage("Select 1 card to place under a tamer.",
-                        "The opponent is selecting 1 card to play.");
+                        "The opponent is selecting 1 card to place under a tamer.");
                     selectHandEffect.SetUpCustomMessage_ShowCard("Placed card");
 
                     yield return StartCoroutine(selectHandEffect.Activate());

+ 92 - 7
Assets/CardEffect/BT19/Blue/Greymon_BT19_020.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace DCGO.CardEffects.BT19
 {
@@ -9,34 +10,118 @@ namespace DCGO.CardEffects.BT19
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Rush
+
             if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RushSelfStaticEffect(
+                    isInheritedEffect: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region On Deletion
+
+            if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("Play 1 Tamer with [Kiriha Aonuma] in its name from hand, then <Save>", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "";
+                    return
+                        "[On Deletion] If you have 1 or fewer Tamers, you may play 1 [Kiriha Aonuma] from your hand without paying the cost. Then, <Save>.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
+                }
+
+                bool IsTamerCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsTamer &&
+                           cardSource.EqualsCardName("Kiriha Aonuma") &&
+                           CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
+                }
+
+                bool CanSelectSaveTamerPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
+                           && permanent.IsTamer;
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanActivateOnDeletion(card) &&
+                           ((CardEffectCommons.HasMatchConditionOwnersHand(card, IsTamerCardCondition) &&
+                             card.Owner.GetBattleAreaPermanents().Count(permanent => permanent.IsTamer) <= 1) ||
+                            CardEffectCommons.CanActivateSave(hashtable, CanSelectSaveTamerPermanentCondition));
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsTamerCardCondition) &&
+                        card.Owner.GetBattleAreaPermanents().Count(permanent => permanent.IsTamer) <= 1)
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsTamerCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectHandEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                                cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false,
+                                root: SelectCardEffect.Root.Hand, activateETB: true));
+                        }
+                    }
+
+                    if (CardEffectCommons.CanActivateSave(hashtable, CanSelectSaveTamerPermanentCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SaveProcess(hashtable, activateClass, card, CanSelectSaveTamerPermanentCondition));
+                    }
                 }
             }
 
+            #endregion
+
+            #region Reboot - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: null));
+            }
+
+            #endregion
+
             return cardEffects;
         }
     }

+ 127 - 7
Assets/CardEffect/BT19/Blue/MailBirdramon_BT19_022.cs

@@ -9,34 +9,154 @@ namespace DCGO.CardEffects.BT19
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Blocker
+
             if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
+                    isInheritedEffect: false,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
+            #region On Deletion
+
+            if (timing == EffectTiming.OnDestroyedAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetUpICardEffect("Place 1 [Blue Flare] card from trash under 1 of your Tamers, then <Save>", CanUseCondition,
+                    card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
-                string EffectDiscription()
+                string EffectDescription()
                 {
-                    return "";
+                    return
+                        "[On Deletion] You may place 1 Digimon card with the [Blue Flare] from your trash under any of your Tamers. Then, <Save>.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
+                }
+
+                bool CanSelectSaveTamerPermanentCondition(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
+                           && permanent.IsTamer;
+                }
+
+                bool CanSelectTrashCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon && cardSource.EqualsTraits("Blue Flare");
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanActivateOnDeletion(card) &&
+                           (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTrashCardCondition) ||
+                            CardEffectCommons.CanActivateSave(hashtable, CanSelectSaveTamerPermanentCondition));
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectTrashCardCondition))
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                            canTargetCondition: CanSelectTrashCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            canNoSelect: () => true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            message: "Select 1 card to place under a tamer.",
+                            maxCount: 1,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            mode: SelectCardEffect.Mode.Custom,
+                            root: SelectCardEffect.Root.Trash,
+                            customRootCardList: null,
+                            canLookReverseCard: true,
+                            selectPlayer: card.Owner,
+                            cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select 1 card to place under a tamer.",
+                            "The opponent is selecting 1 card to place under a tamer.");
+
+                        yield return StartCoroutine(selectCardEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+
+                            yield return null;
+                        }
+
+                        if (selectedCards.Count >= 1)
+                        {
+                            Permanent selectedPermanent = null;
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectSaveTamerPermanentCondition,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: 1,
+                                canNoSelect: true,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: SelectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Custom,
+                                cardEffect: activateClass);
+
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to place the chosen card under.",
+                                "The opponent is selecting 1 Tamer to place the chosen card under.");
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                            IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                            {
+                                selectedPermanent = permanent;
+
+                                yield return null;
+                            }
+
+                            if (selectedPermanent != null)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(
+                                    selectedPermanent.AddDigivolutionCardsBottom(selectedCards, activateClass));
+                            }
+                        }
+                    }
+
+                    if (CardEffectCommons.CanActivateSave(hashtable, CanSelectSaveTamerPermanentCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(
+                            CardEffectCommons.SaveProcess(hashtable, activateClass, card, CanSelectSaveTamerPermanentCondition));
+                    }
                 }
             }
 
+            #endregion
+
+            #region Blocker - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
+                    isInheritedEffect: true,
+                    card: card, condition: null));
+            }
+
+            #endregion
+
             return cardEffects;
         }
     }