mbunch_kascope 1 год назад
Родитель
Сommit
7002dd74be

+ 59 - 28
Assets/CardEffect/BT18/Black/Machinedramon_BT18_073.cs

@@ -596,9 +596,8 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanSelectPermanentCondition(Permanent permanent)
                 {
-                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && 
-                           permanent.TopCard.EqualsTraits("Composite") &&
-                           permanent.TopCard.EqualsTraits("Wicked God");
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
+                           (permanent.TopCard.EqualsTraits("Composite") || permanent.TopCard.EqualsTraits("Wicked God"));
                 }
 
                 bool PermanentCondition(Permanent permanent)
@@ -627,7 +626,7 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
                     {
                         if (GManager.instance.attackProcess.IsAttacking)
                         {
@@ -643,35 +642,67 @@ namespace DCGO.CardEffects.BT18
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(GManager.instance.attackProcess.AttackingPermanent, card))
+                        {
+                            if (GManager.instance.attackProcess.IsAttacking)
+                            {
+                                if (GManager.instance.attackProcess.AttackingPermanent.CanSwitchAttackTarget)
+                                {
+                                    List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                        {
+                            new SelectionElement<bool>(message: $"Switch", value : true, spriteIndex: 0),
+                            new SelectionElement<bool>(message: $"Not switch", value : false, spriteIndex: 1),
+                        };
 
-                    SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+                                    string selectPlayerMessage = "Will you switch the attack target?";
+                                    string notSelectPlayerMessage = "The opponent is selecting whether to switch the attack target.";
 
-                    selectPermanentEffect.SetUp(
-                        selectPlayer: card.Owner,
-                        canTargetCondition: CanSelectPermanentCondition,
-                        canTargetCondition_ByPreSelecetedList: null,
-                        canEndSelectCondition: null,
-                        maxCount: maxCount,
-                        canNoSelect: false,
-                        canEndNotMax: false,
-                        selectPermanentCoroutine: SelectPermanentCoroutine,
-                        afterSelectPermanentCoroutine: null,
-                        mode: SelectPermanentEffect.Mode.Custom,
-                        cardEffect: activateClass);
+                                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
 
-                    selectPermanentEffect.SetUpCustomMessage(
-                        "Select 1 Digimon to switch the attack to.",
-                        "The opponent is selecting 1 Digimon to switch the attack to.");
+                                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                    yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                                    bool doSwitch = GManager.instance.userSelectionManager.SelectedBoolValue;
 
-                    IEnumerator SelectPermanentCoroutine(Permanent permanent)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.SwitchDefender(
-                        activateClass,
-                        false,
-                        permanent));
+
+
+                                    if (doSwitch)
+                                    {
+                                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                                        selectPermanentEffect.SetUp(
+                                            selectPlayer: card.Owner,
+                                            canTargetCondition: CanSelectPermanentCondition,
+                                            canTargetCondition_ByPreSelecetedList: null,
+                                            canEndSelectCondition: null,
+                                            maxCount: maxCount,
+                                            canNoSelect: false,
+                                            canEndNotMax: false,
+                                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                                            afterSelectPermanentCoroutine: null,
+                                            mode: SelectPermanentEffect.Mode.Custom,
+                                            cardEffect: activateClass);
+
+                                        selectPermanentEffect.SetUpCustomMessage(
+                                            "Select 1 Digimon to switch the attack to.",
+                                            "The opponent is selecting 1 Digimon to switch the attack to.");
+
+                                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                                        {
+                                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.attackProcess.SwitchDefender(
+                                            activateClass,
+                                            false,
+                                            permanent));
+                                        }
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
             }

+ 3 - 3
Assets/CardEffect/BT18/Black/Snatchmon_BT18_065.cs

@@ -199,16 +199,16 @@ namespace DCGO.CardEffects.BT18
                     {
                         if (!permanent.TopCard.EqualsCardName("Vemmon"))
                         {
-                            return false;
+                            return true;
                         }
                     }
 
-                    return true;
+                    return false;
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanSelectPermanentCondition1);
+                    return CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1) == 0;
                 }
 
                 int GetCount(CardSource cardSource)

+ 6 - 15
Assets/CardEffect/BT18/Red/Millenniummon_BT18_019.cs

@@ -136,20 +136,12 @@ namespace DCGO.CardEffects.BT18
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
-                    {
-                        if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
-                        {
-                            return true;
-                        }
-                    }
-
-                    return false;
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
                 {
-                    if (card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
                         int maxCount = Math.Min(1, card.Owner.Enemy.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
 
@@ -170,6 +162,7 @@ namespace DCGO.CardEffects.BT18
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
+
                     if (CardEffectCommons.IsJogress(_hashtable))
                     {
                         List<CardSource> selectedCards = new List<CardSource>();
@@ -369,7 +362,7 @@ namespace DCGO.CardEffects.BT18
                 {
                     if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass, root: SelectCardEffect.Root.Trash))
                     {
-                        if (cardSource.CardNames.Contains("Milleniummon"))
+                        if (cardSource.EqualsCardName("Millenniummon"))
                         {
                             return true;
                         }
@@ -480,10 +473,8 @@ namespace DCGO.CardEffects.BT18
 
                     if (returned)
                     {
-                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, (cardSource) => CanSelectCardConditionMilleniummon(cardSource)))
+                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardConditionMilleniummon))
                         {
-                            maxCount = Math.Min(1, card.Owner.TrashCards.Count((cardSource) => CanSelectCardConditionMilleniummon(cardSource)));
-
                             List<CardSource> selectedCards = new List<CardSource>();
 
                             SelectCardEffect selectPlayEffect = GManager.instance.GetComponent<SelectCardEffect>();
@@ -496,7 +487,7 @@ namespace DCGO.CardEffects.BT18
                                         selectCardCoroutine: SelectCardCoroutine,
                                         afterSelectCardCoroutine: null,
                                         message: "Select 1 card to play.",
-                                        maxCount: maxCount,
+                                        maxCount: 1,
                                         canEndNotMax: false,
                                         isShowOpponent: true,
                                         mode: SelectCardEffect.Mode.Custom,

+ 37 - 62
Assets/CardEffect/BT18/Red/WindtoFlameIcetoSword_BT18_095.cs

@@ -27,6 +27,37 @@ namespace DCGO.CardEffects.BT18
                         "[Main] You may place up to 5 [Hybrid] trait cards with different names from your hand or trash under 1 of your Tamers. Then, 1 of your Tamers with 5 or more cards under it may digivolve into [EmperorGreymon] in the hand or trash, ignoring digivolution requirements and without paying the cost.";
                 }
 
+                bool CanTargetCondition_ByPreSelecetedList(List<CardSource> cardSources, CardSource cardSource)
+                {
+                    List<string> cardNames = GetNamesList(cardSources);
+
+                    foreach (string name in cardNames)
+                    {
+                        if (cardSource.CardNames.Contains(name))
+                            return false;
+                    }
+
+                    return true;
+                }
+
+                List<string> GetNamesList(List<CardSource> cardSources)
+                {
+                    List<string> cardNames = new List<string>();
+
+                    foreach (CardSource cardName in cardSources)
+                    {
+                        foreach (string name in cardName.CardNames)
+                        {
+                            if (!cardNames.Contains(name))
+                            {
+                                cardNames.Add(name);
+                            }
+                        }
+                    }
+
+                    return cardNames;
+                }
+
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
@@ -47,9 +78,9 @@ namespace DCGO.CardEffects.BT18
                     return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
                            permanent.IsTamer && permanent.DigivolutionCards.Count >= 5 &&
                            (card.Owner.HandCards.Where(DigivolveToCardCondition).Any(cardSource =>
-                                cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass)) ||
+                                cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass, ignore:CardEffectCommons.IgnoreRequirement.All)) ||
                             card.Owner.TrashCards.Where(DigivolveToCardCondition).Any(cardSource =>
-                                cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass)));
+                                cardSource.CanPlayCardTargetFrame(permanent.PermanentFrame, false, activateClass, SelectCardEffect.Root.Trash, ignore: CardEffectCommons.IgnoreRequirement.All)));
                 }
 
                 bool DigivolveToCardCondition(CardSource cardSource)
@@ -81,8 +112,8 @@ namespace DCGO.CardEffects.BT18
                             cardEffect: activateClass);
 
                         selectPermanentEffect.SetUpCustomMessage(
-                            "Select 1 of your Tamers that will digivolve.",
-                            "The opponent is selecting 1 of their Tamers that will digivolve.");
+                            "Select 1 of your Tamers that will add digivolution cards.",
+                            "The opponent is selecting 1 of their Tamers that will add digivolution cards.");
 
                         yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
 
@@ -105,7 +136,7 @@ namespace DCGO.CardEffects.BT18
                                     selectPlayer: card.Owner,
                                     canTargetCondition: SelectHybridCardCondition,
                                     canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
-                                    canEndSelectCondition: CanEndSelectCondition,
+                                    canEndSelectCondition: null,
                                     maxCount: Math.Min(5,
                                         CardEffectCommons.MatchConditionOwnersCardCountInHand(card, SelectHybridCardCondition)),
                                     canNoSelect: true,
@@ -129,7 +160,7 @@ namespace DCGO.CardEffects.BT18
                                 selectCardEffect.SetUp(
                                     canTargetCondition: SelectHybridCardCondition,
                                     canTargetCondition_ByPreSelecetedList: CanTargetCondition_ByPreSelecetedList,
-                                    canEndSelectCondition: CanEndSelectCondition,
+                                    canEndSelectCondition: null,
                                     canNoSelect: () => true,
                                     selectCardCoroutine: null,
                                     afterSelectCardCoroutine: SelectCardCoroutine,
@@ -148,62 +179,6 @@ namespace DCGO.CardEffects.BT18
                                 yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
                             }
 
-                            bool CanTargetCondition_ByPreSelecetedList(List<CardSource> cardSources, CardSource cardSource)
-                            {
-                                List<string> cardNames = new List<string>();
-
-                                foreach (CardSource cardSource1 in cardSources)
-                                {
-                                    if (!cardNames.Any(x => cardSource1.CardNames.Any(y => y == x)))
-                                    {
-                                        cardNames.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                foreach (CardSource cardSource1 in digivolutionCards)
-                                {
-                                    if (!cardNames.Any(x => cardSource1.CardNames.Any(y => y == x)))
-                                    {
-                                        cardNames.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                if (cardNames.Any(x => cardSource.CardNames.Any(y => y == x)))
-                                {
-                                    return false;
-                                }
-
-                                return true;
-                            }
-
-                            bool CanEndSelectCondition(List<CardSource> cardSources)
-                            {
-                                List<string> cardNames = new List<string>();
-
-                                foreach (CardSource cardSource1 in cardSources)
-                                {
-                                    if (!cardNames.Any(x => cardSource1.CardNames.Any(y => y == x)))
-                                    {
-                                        cardNames.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                foreach (CardSource cardSource1 in digivolutionCards)
-                                {
-                                    if (!cardNames.Any(x => cardSource1.CardNames.Any(y => y == x)))
-                                    {
-                                        cardNames.Add(cardSource1.CardID);
-                                    }
-                                }
-
-                                if (cardNames.Count != cardSources.Count + digivolutionCards.Count)
-                                {
-                                    return false;
-                                }
-
-                                return true;
-                            }
-
                             IEnumerator SelectCardCoroutine(List<CardSource> cardSources)
                             {
                                 digivolutionCards.AddRange(cardSources);

+ 1 - 1
Assets/CardEffect/BT18/Yellow/Patamon_BT18_033.cs

@@ -14,7 +14,7 @@ namespace DCGO.CardEffects.BT18
             if (timing == EffectTiming.OnDeclaration)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Delete your 1 Digimon to play 1 Digimon from hand", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Return 1 Digimon from trash to play 1 Digimon from hand", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 

+ 3 - 4
Assets/CardEffect/BT19/Green/QueenBeemon_BT19_053.cs

@@ -215,6 +215,7 @@ namespace DCGO.CardEffects.BT19
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Place those Digimon face up as your bottom security cards", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetHashString("AllTurns_BT19-053");
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
@@ -238,10 +239,8 @@ namespace DCGO.CardEffects.BT19
                         {
                             if (!CardEffectCommons.IsByBattle(hashtable))
                             {
-                                if (CardEffectCommons.IsByEffect(hashtable, effect => effect.IsSameEffect(activateClass)))
-                                    return false;
-
-                                return true;
+                                if (!CardEffectCommons.IsByEffect(hashtable, effect => effect.HashString.Equals("AllTurns_BT19-053")))
+                                    return true;
                             }
                         }
                     }

+ 0 - 6
Assets/CardEffect/BT19/Purple/LordKnightmonXAntibody_BT19_073.cs

@@ -175,12 +175,6 @@ namespace DCGO.CardEffects.BT19
 
                             return null;
                         }
-
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
-                                    targetPermanent: selectedPermanent,
-                                    activateClass: activateClass
-                                ));
-
                     }
                 }
             }

+ 23 - 19
Assets/CardEffect/BT19/Yellow/LucemonXAntibody_BT19_043.cs

@@ -160,36 +160,40 @@ namespace DCGO.CardEffects.BT19
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable _hashtable)
-                {                                       
-                    if (!card.Owner.isYou)
+                {   
+                    if(card.Owner.Enemy.SecurityCards.Count > 0)
                     {
-                        GManager.instance.commandText.OpenCommandText("Will you discard the top card of your security?");
+                        if (!card.Owner.isYou)
+                        {
+                            GManager.instance.commandText.OpenCommandText("Will you discard the top card of your security?");
 
-                        List<Command_SelectCommand> command_SelectCommands = new List<Command_SelectCommand>()
+                            List<Command_SelectCommand> command_SelectCommands = new List<Command_SelectCommand>()
                     {
                         new Command_SelectCommand($"Discard", () => photonView.RPC("SetDoDiscard", RpcTarget.All, true), 0),
                         new Command_SelectCommand($"Not Discard", () => photonView.RPC("SetDoDiscard", RpcTarget.All, false), 1),
                     };
 
-                        GManager.instance.selectCommandPanel.SetUpCommandButton(command_SelectCommands);
-                    }
-                    else
-                    {
-                        GManager.instance.commandText.OpenCommandText("The opponent is choosing whether to discard security.");
-
-                        #region AI
-                        if (GManager.instance.IsAI)
+                            GManager.instance.selectCommandPanel.SetUpCommandButton(command_SelectCommands);
+                        }
+                        else
                         {
-                            SetDoDiscard(RandomUtility.IsSucceedProbability(0.5f));
+                            GManager.instance.commandText.OpenCommandText("The opponent is choosing whether to discard security.");
+
+                            #region AI
+                            if (GManager.instance.IsAI)
+                            {
+                                SetDoDiscard(RandomUtility.IsSucceedProbability(0.5f));
+                            }
+                            #endregion
                         }
-                        #endregion
+
+                        yield return new WaitWhile(() => !endSelect);
+                        endSelect = false;
+
+                        GManager.instance.commandText.CloseCommandText();
+                        yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
                     }
                     
-                    yield return new WaitWhile(() => !endSelect);
-                    endSelect = false;
-
-                    GManager.instance.commandText.CloseCommandText();
-                    yield return new WaitWhile(() => GManager.instance.commandText.gameObject.activeSelf);
 
                     if (!doDiscard)
                     {

+ 2 - 2
Assets/CardEffect/BT19/Yellow/WizardmonXAntibody_BT19_036.cs

@@ -167,7 +167,7 @@ namespace DCGO.CardEffects.BT19
                     {
                         if (cardSource.CardColors.Contains(CardColor.Yellow) || cardSource.CardColors.Contains(CardColor.Purple))
                         {
-                            if (cardSource.HasPlayCost && cardSource.GetCostItself <= 5)
+                            if (cardSource.HasUseCost && cardSource.GetCostItself <= 5)
                             {
                                 return true;
                             }
@@ -200,7 +200,7 @@ namespace DCGO.CardEffects.BT19
                         player: card.Owner,
                         refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
 
-                    if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Wizardmon") || cardSource.EqualsCardName("XAntibody")) >= 1)
+                    if (card.PermanentOfThisCard().DigivolutionCards.Count((cardSource) => cardSource.EqualsCardName("Wizardmon") || cardSource.EqualsCardName("X Antibody")) >= 1)
                     {
                         if (card.Owner.CanAddSecurity(activateClass))
                         {