Quellcode durchsuchen

updates for 1.8.2.9

mbunch_kascope vor 1 Jahr
Ursprung
Commit
daa5e6e4e0

+ 2 - 1
Assets/CardEffect/BT21/Purple/BT21_073.cs

@@ -398,7 +398,8 @@ namespace DCGO.CardEffects.BT21
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.CanTriggerWhenLinked(hashtable, LinkedPermanentCondition, null);
+                    return CardEffectCommons.IsOwnerTurn(card) &&
+                           CardEffectCommons.CanTriggerWhenLinked(hashtable, LinkedPermanentCondition, null);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)

+ 6 - 11
Assets/CardEffect/BT21/Red/BT21_001.cs

@@ -45,21 +45,16 @@ namespace DCGO.CardEffects.BT21
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
-                        return true;
+                        return card.Owner.HandCards.Any(source => 
+                               CanSelectCardCondition(source) &&
+                               source.CanPlayCardTargetFrame(permanent.PermanentFrame, true, activateClass));
                     }
                     return false;
                 }
 
-                bool CanSelectCardCondition(CardSource digivolveTarget, Permanent digivolvingTarget)
+                bool CanSelectCardCondition(CardSource digivolveTarget)
                 {
-                    if (digivolveTarget.CardTraits.FirstOrDefault(x => x.Equals("Reptile")) != null || digivolveTarget.CardTraits.FirstOrDefault(x => x.Equals("Dragonkin")) != null)
-                    {
-                        if (digivolveTarget.CanPlayCardTargetFrame(digivolvingTarget.PermanentFrame, true, activateClass))
-                        {
-                            return true;
-                        }
-                    }
-                    return false;
+                    return digivolveTarget.EqualsTraits("Reptile") || digivolveTarget.EqualsTraits("Dragonkin");
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
@@ -99,7 +94,7 @@ namespace DCGO.CardEffects.BT21
                     {
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
                                 targetPermanent: selectedPermanent,
-                                cardCondition: (cardSource) => CanSelectCardCondition(cardSource, selectedPermanent),
+                                cardCondition: CanSelectCardCondition,
                                 payCost: true,
                                 reduceCostTuple: (reduceCost: 1, reduceCostCardCondition: null),
                                 fixedCostTuple: null,

+ 73 - 39
Assets/CardEffect/BT21/Red/BT21_013.cs

@@ -155,55 +155,89 @@ namespace DCGO.CardEffects.BT21
 
                     if (selectedPermanent != null)
                     {
-                        SelectCardEffect.Root? rootmode = null!;
                         bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectSourceCard);
                         bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectSourceCard);
 
-                        if (canSelectHand && !canSelectTrash) rootmode = SelectCardEffect.Root.Hand;
-
-                        if (!canSelectHand && canSelectTrash) rootmode = SelectCardEffect.Root.Trash;
-
-                        if (canSelectHand && canSelectTrash)
+                        if (canSelectHand || canSelectTrash)
                         {
-                            List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                            if (canSelectHand && canSelectTrash)
                             {
-                                new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
-                                new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
-                            };
+                                List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                                {
+                                    new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
+                                    new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
+                                };
 
-                            string selectPlayerMessage = "From which area do you select a card?";
-                            string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
+                                string selectPlayerMessage = "From which area do you select a card?";
+                                string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
+
+                                GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                            }
+                            else
+                            {
+                                GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                            }
 
-                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
                             yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
-                            rootmode = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
-                        }
 
-                        if (rootmode != null)
-                        {
+                            bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                            if (fromHand)
+                            {
+                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                selectHandEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectSourceCard,
+                                    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 add as source.",
+                                    "The opponent is selecting 1 card to add as source.");
+                                selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return StartCoroutine(selectHandEffect.Activate());
+                            }
+                            else
+                            {
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectSourceCard,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 card to add as source.",
+                                    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 add as source.",
+                                    "The opponent is selecting 1 card to add as source.");
+                                selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
+
+                                yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                            }
+
                             CardSource selectedCard = null;
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: CanSelectSourceCard,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 card to add as source.",
-                                maxCount: 1,
-                                canEndNotMax: false,
-                                isShowOpponent: true,
-                                mode: SelectCardEffect.Mode.Custom,
-                                root: (SelectCardEffect.Root)rootmode!,
-                                customRootCardList: null,
-                                canLookReverseCard: true,
-                                selectPlayer: card.Owner,
-                                cardEffect: activateClass);
-
-                            selectCardEffect.SetUpCustomMessage("Select 1 card to add as source.", "The opponent is selecting 1 card to add as source.");
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
 
                             IEnumerator SelectCardCoroutine(CardSource cardSource)
                             {

+ 4 - 4
Assets/CardEffect/BT21/Red/BT21_020.cs

@@ -24,7 +24,7 @@ namespace DCGO.CardEffects.BT21
                 string EffectDiscription()
                     => "When any of your Digimon with [Agunimon]/[BurningGreymon] in their digivolution cards would digivolve into this card in the hand, reduce the digivolution cost by 1.";
 
-                bool PermanentCondition(Permanent permanent)
+                bool PermanentEvoCondition(Permanent permanent)
                 {
                     if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
                     {
@@ -47,9 +47,9 @@ namespace DCGO.CardEffects.BT21
                 {
                     if (CardEffectCommons.IsExistOnHand(card))
                     {
-                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, PermanentCondition))
+                        if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, PermanentEvoCondition))
                         {
-                            if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentCondition, CardCondition))
+                            if (CardEffectCommons.CanTriggerWhenPermanentWouldDigivolve(hashtable, PermanentEvoCondition, CardCondition))
                             {
                                 return true;
                             }
@@ -115,7 +115,7 @@ namespace DCGO.CardEffects.BT21
                     {
                         if (targetPermanent.TopCard != null)
                         {
-                            return PermanentCondition(targetPermanent);
+                            return PermanentEvoCondition(targetPermanent);
                         }
 
                         return false;

+ 1 - 1
Assets/CardEffect/P/Green/P_185.cs

@@ -143,7 +143,7 @@ namespace DCGO.CardEffects.P
                 {
                     if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
                     {
-                        List<CardSource> cards = card.PermanentOfThisCard().cardSources;
+                        List<CardSource> cards = card.PermanentOfThisCard().DigivolutionCards;
                         var colourCount = Combinations.GetDifferenetColorCardCount(cards);
                         var newDP = colourCount * 1000;
 

+ 6 - 3
Assets/CardEffect/P/Purple/P_187.cs

@@ -132,9 +132,12 @@ namespace DCGO.CardEffects.P
                 {
                     if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
                     {
-                        if (permanent.IsDigimon || permanent.IsTamer)
+                        if(permanent != card.PermanentOfThisCard())
                         {
-                            return true;
+                            if (permanent.IsDigimon || permanent.IsTamer)
+                            {
+                                return true;
+                            }
                         }
                     }
                     return false;
@@ -174,7 +177,7 @@ namespace DCGO.CardEffects.P
 
                             IEnumerator SelectPermanentCoroutine(Permanent permanent)
                             {
-                                Permanent selectedPermanent = permanent;
+                                selectedPermanent = permanent;
                                 yield return null;
                             }