mbunch_kascope 8 месяцев назад
Родитель
Сommit
add7efa95b

+ 19 - 10
Assets/CardEffect/BT23/Black/BT23_055.cs

@@ -226,7 +226,7 @@ namespace DCGO.CardEffects.BT23
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    Permanent selectedPermanent = card.PermanentOfThisCard();
+                    Permanent selectedPermanent = null;
 
                     SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
 
@@ -249,22 +249,31 @@ namespace DCGO.CardEffects.BT23
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
                     IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                    {
+                        selectedPermanent = permanent;
+
+                        yield return null;
+                    }
+
+                    if(selectedPermanent != null)
                     {
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(
-                                            targetPermanents: new List<Permanent>() { selectedPermanent },
-                                            activateClass: activateClass,
-                                            successProcess: permanents => SuccessProcess(),
-                                            failureProcess: null));
+                            targetPermanents: new List<Permanent>() { selectedPermanent },
+                            activateClass: activateClass,
+                            successProcess: permanents => SuccessProcess(),
+                            failureProcess: null));
                     }
 
                     IEnumerator SuccessProcess()
                     {
-                        selectedPermanent.willBeRemoveField = false;
+                        Permanent cardPermanent = card.PermanentOfThisCard();
 
-                        selectedPermanent.HideDeleteEffect();
-                        selectedPermanent.HideHandBounceEffect();
-                        selectedPermanent.HideDeckBounceEffect();
-                        selectedPermanent.HideWillRemoveFieldEffect();
+                        cardPermanent.willBeRemoveField = false;
+
+                        cardPermanent.HideDeleteEffect();
+                        cardPermanent.HideHandBounceEffect();
+                        cardPermanent.HideDeckBounceEffect();
+                        cardPermanent.HideWillRemoveFieldEffect();
 
                         yield return null;
                     }

+ 93 - 85
Assets/CardEffect/BT23/Black/BT23_057.cs

@@ -26,7 +26,7 @@ namespace DCGO.CardEffects.BT23
             }
             #endregion
 
-            bool CanSelectReductionCardCondition(CardSource cardSource)
+            bool CanSelectReturnCardCondition(CardSource cardSource)
             {
                 return cardSource.ContainsCardName("Huckmon") &&
                        cardSource.ContainsCardName("Sistermon") &&
@@ -38,9 +38,9 @@ namespace DCGO.CardEffects.BT23
             if (timing == EffectTiming.BeforePayCost)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Return 3 cards with [Huckmon], [Sistermon] or [Jesmon] in their names to get Play Cost -6", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Return 3 cards with [Huckmon], [Sistermon] or [Jesmon] in their names to get Play Cost -5", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
-                activateClass.SetHashString("PlayCost-5_BT23-057");
+                activateClass.SetHashString("PlayCost-5_BT12_057");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -50,10 +50,29 @@ namespace DCGO.CardEffects.BT23
 
                 bool CardCondition(CardSource cardSource)
                 {
-                    return cardSource == card;
+                    if (cardSource == card)
+                    {
+                        if (CardEffectCommons.IsExistOnHand(cardSource))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
                 }
 
-                bool CanNoSelect(CardSource cardSource) => CardEffectCommons.UniversalRootCanNoSelectCondition(cardSource);
+                bool CanNoSelect(CardSource cardSource)
+                {
+                    if (cardSource != null)
+                    {
+                        if (cardSource.PayingCost(SelectCardEffect.Root.Hand, null, checkAvailability: false) > cardSource.Owner.MaxMemoryCost)
+                        {
+                            return false;
+                        }
+                    }
+
+                    return true;
+                }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
@@ -62,14 +81,22 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReductionCardCondition) >= 3;
+                    if (CardEffectCommons.IsExistOnHand(card))
+                    {
+                        if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReturnCardCondition) >= 3)
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
                     List<CardSource> selectedCards = new List<CardSource>();
 
-                    if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReductionCardCondition) >= 3)
+                    if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReturnCardCondition) >= 3)
                     {
                         bool noSelect = CanNoSelect(CardEffectCommons.GetCardFromHashtable(_hashtable));
 
@@ -78,13 +105,13 @@ namespace DCGO.CardEffects.BT23
                         SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
 
                         selectCardEffect.SetUp(
-                            canTargetCondition: CanSelectReductionCardCondition,
+                            canTargetCondition: CanSelectReturnCardCondition,
                             canTargetCondition_ByPreSelecetedList: null,
                             canEndSelectCondition: null,
                             canNoSelect: () => noSelect,
                             selectCardCoroutine: SelectCardCoroutine,
                             afterSelectCardCoroutine: null,
-                            message: "Select cards to add to your deck\n(cards will be placed back to your deck so that cards with lower numbers are on top).",
+                            message: "Select cards to add to the top your deck\n(cards will be placed back to the top of the deck so that cards with lower numbers are on top).",
                             maxCount: maxCount,
                             canEndNotMax: false,
                             isShowOpponent: true,
@@ -106,98 +133,79 @@ namespace DCGO.CardEffects.BT23
                         if (selectedCards.Count == 3)
                         {
                             selectedCards.Reverse();
+                            yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryTopCards(selectedCards));
+                        }
+                    }
 
+                    if (card.Owner.CanReduceCost(null, card))
+                    {
+                        ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
+                    }
 
-                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
-                            {
-                                new SelectionElement<bool>(message: $"Top of deck", value : true, spriteIndex: 0),
-                                new SelectionElement<bool>(message: $"Bottom of deck", value : false, spriteIndex: 1),
-                            };
-
-                            string selectPlayerMessage = "Return cards to top or bottom of deck?";
-                            string notSelectPlayerMessage = "The opponent is choosing to return cards to top or bottom of deck.";
-
-                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-
-                            bool topOfDeck = GManager.instance.userSelectionManager.SelectedBoolValue;
-                            if (topOfDeck)
-                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryTopCards(selectedCards));
-                            else
-                                yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(selectedCards));
-
-                            if (card.Owner.CanReduceCost(null, card))
-                            {
-                                ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
-                            }
-
-                            ChangeCostClass changeCostClass = new ChangeCostClass();
-                            changeCostClass.SetUpICardEffect("Play Cost -1", CanUseCondition1, card);
-                            changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
-                            card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
+                    ChangeCostClass changeCostClass = new ChangeCostClass();
+                    changeCostClass.SetUpICardEffect("Play Cost -1", CanUseCondition1, card);
+                    changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                    card.Owner.UntilCalculateFixedCostEffect.Add((_timing) => changeCostClass);
 
-                            bool CanUseCondition1(Hashtable hashtable)
-                            {
-                                return true;
-                            }
+                    bool CanUseCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
 
-                            int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                    int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                    {
+                        if (CardSourceCondition(cardSource))
+                        {
+                            if (RootCondition(root))
                             {
-                                if (CardSourceCondition(cardSource))
+                                if (PermanentsCondition(targetPermanents))
                                 {
-                                    if (RootCondition(root))
-                                    {
-                                        if (PermanentsCondition(targetPermanents))
-                                        {
-                                            int targetCost = 0;
-
-                                            if (selectedCards.Count >= 3)
-                                                targetCost += 5;
-
-                                            Cost -= targetCost;
-                                        }
-                                    }
-                                }
+                                    int targetCost = 0;
 
-                                return Cost;
-                            }
+                                    if (selectedCards.Count >= 3)
+                                        targetCost += 5;
 
-                            bool PermanentsCondition(List<Permanent> targetPermanents)
-                            {
-                                if (targetPermanents == null)
-                                {
-                                    return true;
+                                    Cost -= targetCost;
                                 }
-                                else
-                                {
-                                    if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
-                                    {
-                                        return true;
-                                    }
-                                }
-
-                                return false;
                             }
+                        }
 
-                            bool CardSourceCondition(CardSource cardSource)
-                            {
-                                return cardSource == card;
-                            }
+                        return Cost;
+                    }
 
-                            bool RootCondition(SelectCardEffect.Root root)
+                    bool PermanentsCondition(List<Permanent> targetPermanents)
+                    {
+                        if (targetPermanents == null)
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            if (targetPermanents.Count((targetPermanent) => targetPermanent != null) == 0)
                             {
                                 return true;
                             }
+                        }
 
-                            bool isUpDown()
-                            {
-                                return true;
-                            }
+                        return false;
+                    }
 
-                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
-                        }
+                    bool CardSourceCondition(CardSource cardSource)
+                    {
+                        return cardSource == card;
+                    }
+
+                    bool RootCondition(SelectCardEffect.Root root)
+                    {
+                        return true;
+                    }
+
+                    bool isUpDown()
+                    {
+                        return true;
                     }
 
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ShowReducedCost(_hashtable));
                 }
             }
 
@@ -217,11 +225,11 @@ namespace DCGO.CardEffects.BT23
                 {
                     if (card.Owner.HandCards.Contains(card))
                     {
-                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Return 3 cards with [Huckmon], [Sistermon] or [Jesmon] in their names to get Play Cost -5");
+                        ICardEffect activateClass = card.EffectList(EffectTiming.BeforePayCost).Find(cardEffect => cardEffect.EffectName == "Return 6 [D-Brigade] to get Play Cost -6");
 
                         if (activateClass != null)
                         {
-                            if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReductionCardCondition) >= 3)
+                            if (CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReturnCardCondition) >= 3)
                             {
                                 return true;
                             }
@@ -239,7 +247,7 @@ namespace DCGO.CardEffects.BT23
                         {
                             if (PermanentsCondition(targetPermanents))
                             {
-                                int trashCount = CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReductionCardCondition);
+                                int trashCount = CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, CanSelectReturnCardCondition);
                                 int targetCount = 0;
 
                                 if (trashCount >= 3)

+ 1 - 1
Assets/CardEffect/BT23/Black/BT23_059.cs

@@ -274,7 +274,7 @@ namespace DCGO.CardEffects.BT23
                                 {
                                     if (cardEffect.EffectSourceCard.Owner == card.Owner.Enemy)
                                     {
-                                        return true;
+                                        return cardEffect.EffectSourceCard.IsDigimon;
                                     }
                                 }
                             }

+ 4 - 3
Assets/CardEffect/BT23/Black/BT23_060.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics;
 
 //Machinedramon
 namespace DCGO.CardEffects.BT23
@@ -264,7 +265,7 @@ namespace DCGO.CardEffects.BT23
                 {
                     List<ICardEffect> effects = cardSource.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, cardSource)
                             .Clone()
-                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
+                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.EffectDiscription.StartsWith("[On Play]"));
 
                     if (effects.Count > 0)
                         return true;
@@ -335,7 +336,7 @@ namespace DCGO.CardEffects.BT23
                     {
                         List<ICardEffect> candidateEffects = selectedCard.EffectList_ForCard(EffectTiming.OnEnterFieldAnyone, card)
                             .Clone()
-                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.IsOnPlay);
+                            .Filter(cardEffect => cardEffect != null && cardEffect is ActivateICardEffect && !cardEffect.IsSecurityEffect && cardEffect.EffectDiscription.StartsWith("[On Play]"));
 
                         if (candidateEffects.Count >= 1)
                         {
@@ -391,7 +392,7 @@ namespace DCGO.CardEffects.BT23
 
                             if (selectedEffect != null)
                             {
-                                Hashtable effectHashtable = CardEffectCommons.WhenDigivolvingCheckHashtableOfCard(card);
+                                Hashtable effectHashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(card);
 
                                 if (selectedEffect.CanUse(effectHashtable))
                                 {

+ 2 - 2
Assets/CardEffect/BT23/Green/BT23_043.cs

@@ -155,8 +155,6 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    removedPermanents = CardEffectCommons.GetPermanentsFromHashtable(hashtable).Filter(CanSelectPermanentCondition);
-
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
                         && CardEffectCommons.HasMatchConditionOwnersSecurity(card, null, false);
                 }
@@ -174,6 +172,8 @@ namespace DCGO.CardEffects.BT23
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
+                    removedPermanents = CardEffectCommons.GetPermanentsFromHashtable(hashtable).Filter(CanSelectPermanentCondition);
+
                     var flippedSecurity = false;
                     foreach (CardSource source in card.Owner.SecurityCards)
                     {

+ 1 - 20
Assets/CardEffect/BT23/Purple/BT23_068.cs

@@ -98,25 +98,7 @@ namespace DCGO.CardEffects.BT23
 
                 if (canSelectTrash)
                 {
-                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
-                            {
-                                new(message: "Digivolve", value: true, spriteIndex: 0),
-                                new(message: "Do not digivolve", value: false, spriteIndex: 1),
-                            };
-
-                    string selectPlayerMessage = "Digivolve?";
-                    string notSelectPlayerMessage = "The opponent is choosing whether to digivolve.";
-
-                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
-                        selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
-                        notSelectPlayerMessage: notSelectPlayerMessage);
-
-                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
-                        .WaitForEndSelect());
-
-                    if (GManager.instance.userSelectionManager.SelectedBoolValue)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(
+                    yield return ContinuousController.instance.StartCoroutine(
                             CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                 targetPermanent: selectedPermanent,
                                 cardCondition: SharedCanSelectDigiCardCondition,
@@ -127,7 +109,6 @@ namespace DCGO.CardEffects.BT23
                                 isHand: false,
                                 activateClass: activateClass,
                                 successProcess: null));
-                    }
                 }
             }
 

+ 1 - 1
Assets/CardEffect/BT23/Purple/BT23_070.cs

@@ -81,7 +81,7 @@ namespace DCGO.CardEffects.BT23
 
                 bool HasBelphemonInName(CardSource cardSource)
                 {
-                    return card.ContainsCardName("Belphemon");
+                    return cardSource.ContainsCardName("Belphemon");
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 2 - 2
Assets/CardEffect/BT23/White/BT23_073.cs

@@ -182,7 +182,7 @@ namespace DCGO.CardEffects.BT23
 
                         IEnumerator SuccessProcess()
                         {
-                            Permanent selectedPermanent = null;
+                            Permanent selectedPermanent = wouldBeRemovedPermaments[0];
                             SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
                             int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(perm => wouldBeRemovedPermaments.Contains(perm)));
 
@@ -209,7 +209,7 @@ namespace DCGO.CardEffects.BT23
                             selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will not be removed from battle area.", "The opponent is selecting 1 Digimon that will not be removed from battle area.");
                             yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
-                            if (selectedPermanent == null)
+                            if (selectedPermanent != null)
                             {
                                 selectedPermanent.willBeRemoveField = false;
 

+ 2 - 2
Assets/CardEffect/BT23/White/BT23_076.cs

@@ -16,13 +16,13 @@ namespace DCGO.CardEffects.BT23
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Add your top security, <Recovery +1 (Deck)>", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Add your top security, <Recovery +1 (Deck)>", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 cardEffects.Add(activateClass);
 
                 string EffectDescription()
                 {
-                    return "[On Play] Add your top security card to the hand. Then, Recovery +1 (Deck)>";
+                    return "[On Play] Add your top security card to the hand. Then, <Recovery +1 (Deck)>";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 8 - 1
Assets/CardEffect/BT23/Yellow/BT23_102.cs

@@ -388,9 +388,16 @@ namespace DCGO.CardEffects.BT23
                         {
                             if (!selectedPermament.TopCard.CanNotBeAffected(activateClass))
                             {
+                                #region hashtable
+                                Hashtable _hashtable = new Hashtable()
+                                {
+                                    {"CardEffect", activateClass}
+                                };
+                                #endregion
+
                                 yield return ContinuousController.instance.StartCoroutine(new IPutSecurityPermanent(
                                     permanent: selectedPermament,
-                                    hashtable: hashtable,
+                                    hashtable: _hashtable,
                                     toTop: false).PutSecurity()
                                 );
                             }

+ 2 - 1
Assets/Scripts/ICardEffect.cs

@@ -658,10 +658,11 @@ public abstract class ICardEffect
             {
                 if (!string.IsNullOrEmpty(EffectDiscription))
                 {
+                    Debug.Log($"Effect Description: {EffectDiscription.Contains("[On Play]")}");
                     if (EffectDiscription.Contains("[On Play]"))
                     {
                         Hashtable hashtable = CardEffectCommons.OnPlayCheckHashtableOfCard(EffectSourceCard);
-
+                        Debug.Log($"Can Trigger: {CanTrigger(hashtable)}");
                         if (CanTrigger(hashtable))
                         {
                             return true;

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:11cba1c1a2434f03f6df8c1c2dc7510165540b92366455599bea7383fd9584fc
+oid sha256:22caebf712b88cb4aebbfee8a4ad8f2d34d28802c105060604f4f6e7de28efe2
 size 20167