Explorar o código

Update BT25_083.cs

Lewisaaronwelch hai 3 meses
pai
achega
71f0e948a1
Modificáronse 1 ficheiros con 89 adicións e 86 borrados
  1. 89 86
      Assets/Scripts/CardEffect/BT25/Purple/BT25_083.cs

+ 89 - 86
Assets/Scripts/CardEffect/BT25/Purple/BT25_083.cs

@@ -193,7 +193,7 @@ namespace DCGO.CardEffects.BT25
             IEnumerator SharedActivateCoroutine1(Hashtable hashtable, ActivateClass activateClass)
             {
                 bool hasUsed = false;
-                bool CanSelect3MOptionCard(CardSource cardSource) => cardSource.IsOption && cardSource.HasThreeMusketeersTraits && CardEffectCommons.CanPlayAsNewPermanent(cardSource, true, activateClass);
+                bool CanSelect3MOptionCard(CardSource cardSource) => cardSource.IsOption && cardSource.HasThreeMusketeersTraits && cardSource.Owner.MaxMemoryCost < cardSource.BasePlayCostFromEntity;
                 if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectDigimonCondition))
                 {
                     #region Select digimon to trash option card from digivolution source
@@ -265,123 +265,126 @@ namespace DCGO.CardEffects.BT25
                         if (selectedCard != null)
                         {
                             yield return ContinuousController.instance.StartCoroutine(new ITrashDigivolutionCards(selectedPermanent, new List<CardSource>() { selectedCard }, activateClass).TrashDigivolutionCards());
-                            #region Select 3M option card in trash to use with reduced cost
-                            CardSource selectedOption = null;
-                            SelectCardEffect selectCardEffect1 = GManager.instance.GetComponent<SelectCardEffect>();
+                            if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelect3MOptionCard))
+                            {
+                                #region Select 3M option card in trash to use with reduced cost
+                                CardSource selectedOption = null;
+                                SelectCardEffect selectCardEffect1 = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect1.SetUp(
+                                    canTargetCondition: CanSelect3MOptionCard,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine1,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 [Three Musketeers] option to use.",
+                                    maxCount: 1,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Trash,
+                                    customRootCardList: null,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                                IEnumerator SelectCardCoroutine1(CardSource cardSource)
+                                {
+                                    selectedOption = cardSource;
+                                    yield return null;
+                                }
 
-                            selectCardEffect1.SetUp(
-                                canTargetCondition: CanSelect3MOptionCard,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: SelectCardCoroutine1,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 [Three Musketeers] option to use.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Trash,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
+                                selectCardEffect1.SetUpCustomMessage("Select 1 [Three Musketeers] option to use.", "The opponent is selecting 1 [Three Musketeers] option to use.");
+                                selectCardEffect1.SetUpCustomMessage_ShowCard("Selected Card");
 
-                            IEnumerator SelectCardCoroutine1(CardSource cardSource)
-                            {
-                                selectedOption = cardSource;
-                                yield return null;
-                            }
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect1.Activate());
 
-                            selectCardEffect1.SetUpCustomMessage("Select 1 [Three Musketeers] option to use.", "The opponent is selecting 1 [Three Musketeers] option to use.");
-                            selectCardEffect1.SetUpCustomMessage_ShowCard("Selected Card");
+                                if (selectedOption != null)
+                                {
+                                    hasUsed = true;
 
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect1.Activate());
+                                    #region reduce play cost
+                                    ChangeCostClass changeCostClass = new ChangeCostClass();
+                                    changeCostClass.SetUpICardEffect($"Play Cost -3", CanUseCondition1, card);
+                                    changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CanSelect3MOptionCard, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                                    Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
+                                    card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
 
-                            if (selectedOption != null)
-                            {
-                                hasUsed = true;
+                                    ICardEffect GetCardEffect(EffectTiming _timing)
+                                    {
+                                        if (_timing == EffectTiming.None)
+                                        {
+                                            return changeCostClass;
+                                        }
 
-                                #region reduce play cost
-                                ChangeCostClass changeCostClass = new ChangeCostClass();
-                                changeCostClass.SetUpICardEffect($"Play Cost -3", CanUseCondition1, card);
-                                changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CanSelect3MOptionCard, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                                Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
-                                card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
+                                        return null;
+                                    }
 
-                                ICardEffect GetCardEffect(EffectTiming _timing)
-                                {
-                                    if (_timing == EffectTiming.None)
+                                    bool CanUseCondition1(Hashtable hashtable)
                                     {
-                                        return changeCostClass;
+                                        return true;
                                     }
 
-                                    return null;
-                                }
+                                    int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                                    {
+                                        if (CanSelect3MOptionCard(cardSource))
+                                        {
+                                            if (RootCondition(root))
+                                            {
+                                                if (PermanentsCondition(targetPermanents))
+                                                {
+                                                    Cost -= 3;
+                                                }
+                                            }
+                                        }
 
-                                bool CanUseCondition1(Hashtable hashtable)
-                                {
-                                    return true;
-                                }
+                                        return Cost;
+                                    }
 
-                                int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
-                                {
-                                    if (CanSelect3MOptionCard(cardSource))
+                                    bool PermanentsCondition(List<Permanent> targetPermanents)
                                     {
-                                        if (RootCondition(root))
+                                        if (targetPermanents == null)
                                         {
-                                            if (PermanentsCondition(targetPermanents))
+                                            return true;
+                                        }
+
+                                        else
+                                        {
+                                            if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
                                             {
-                                                Cost -= 3;
+                                                return true;
                                             }
                                         }
-                                    }
 
-                                    return Cost;
-                                }
+                                        return false;
+                                    }
 
-                                bool PermanentsCondition(List<Permanent> targetPermanents)
-                                {
-                                    if (targetPermanents == null)
+                                    bool RootCondition(SelectCardEffect.Root root)
                                     {
                                         return true;
                                     }
 
-                                    else
+                                    bool isUpDown()
                                     {
-                                        if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                                        {
-                                            return true;
-                                        }
+                                        return true;
                                     }
+                                    #endregion
 
-                                    return false;
-                                }
-
-                                bool RootCondition(SelectCardEffect.Root root)
-                                {
-                                    return true;
-                                }
+                                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayOptionCards(
+                                        cardSources: new List<CardSource>() { selectedOption },
+                                        activateClass: activateClass,
+                                        payCost: true,
+                                        root: SelectCardEffect.Root.Trash));
 
-                                bool isUpDown()
-                                {
-                                    return true;
+                                    #region release effect
+                                    card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
+                                    #endregion
                                 }
-                                #endregion
 
-                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayOptionCards(
-                                    cardSources: new List<CardSource>() { selectedOption },
-                                    activateClass: activateClass,
-                                    payCost: true,
-                                    root: SelectCardEffect.Root.Trash));
-
-                                #region release effect
-                                card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
                                 #endregion
                             }
 
-                            #endregion
-
                         }
                     }
                 }