Lewisaaronwelch 9 месяцев назад
Родитель
Сommit
59eb78935a

+ 3 - 5
Assets/CardEffect/BT23/Blue/BT23_016.cs

@@ -77,15 +77,13 @@ namespace DCGO.CardEffects.BT23
                 bool CanUseCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.CanTriggerWhenLinked(hashtable, perm => perm == card.PermanentOfThisCard(), _ => true);
+                        && CardEffectCommons.CanTriggerWhenLinked(hashtable, perm => perm == card.PermanentOfThisCard(), null);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
                     return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
-                        && CardEffectCommons.IsOwnerTurn(card)
-                        && CardEffectCommons.OwnerHas1OrLessTamers(card)
-                        && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
+                        && CardEffectCommons.IsOwnerTurn(card);
                 }
 
                 bool CanSelectCardCondition(CardSource cardSource)
@@ -97,7 +95,7 @@ namespace DCGO.CardEffects.BT23
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
+                    if (CardEffectCommons.OwnerHas1OrLessTamers(card) && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
                     {
                         CardSource selectedCard = null;
                         int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CanSelectCardCondition));

+ 9 - 33
Assets/CardEffect/BT23/Blue/BT23_017.cs

@@ -230,39 +230,24 @@ namespace DCGO.CardEffects.BT23
                                 }
                                 #endregion
 
-                                #region Delete EoOT
+                                #region Delete EOOT
+
                                 ActivateClass activateClass1 = new ActivateClass();
                                 activateClass1.SetUpICardEffect("Delete the Digimon", CanUseEndofOpponentTurnCondition, card);
-                                activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "");
-                                card.Owner.UntilOpponentTurnEndEffects.Add(GetCardEffect);
+                                activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "at the end of your opponent's turn, Delete this digimon");
+                                card.EffectList(EffectTiming.OnEndTurn).Add(activateClass1);
 
                                 bool CanUseEndofOpponentTurnCondition(Hashtable hashtable)
                                 {
-                                    if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
-                                    {
-                                        if (CardEffectCommons.IsOpponentTurn(card))
-                                        {
-                                            return true;
-                                        }
-                                    }
-
-                                    return false;
+                                    return CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon)
+                                        && CardEffectCommons.IsOpponentTurn(card);
                                 }
 
                                 bool CanActivateCondition1(Hashtable hashtable)
                                 {
-                                    if (CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon))
-                                    {
-                                        if (playedDigimon.CanBeDestroyedBySkill(activateClass1))
-                                        {
-                                            if (!playedDigimon.TopCard.CanNotBeAffected(activateClass1))
-                                            {
-                                                return true;
-                                            }
-                                        }
-                                    }
-
-                                    return false;
+                                    return CardEffectCommons.IsPermanentExistsOnBattleArea(playedDigimon)
+                                        && playedDigimon.CanBeDestroyedBySkill(activateClass1)
+                                        && !playedDigimon.TopCard.CanNotBeAffected(activateClass1);
                                 }
 
                                 IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
@@ -270,15 +255,6 @@ namespace DCGO.CardEffects.BT23
                                     yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(new List<Permanent>() { playedDigimon }, CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
                                 }
 
-                                ICardEffect GetCardEffect(EffectTiming _timing)
-                                {
-                                    if (_timing == EffectTiming.OnEndTurn)
-                                    {
-                                        return activateClass1;
-                                    }
-
-                                    return null;
-                                }
                                 #endregion
                             }
                             #endregion

+ 64 - 5
Assets/CardEffect/BT23/Blue/BT23_021.cs

@@ -307,13 +307,43 @@ namespace DCGO.CardEffects.BT23
 
             #endregion
 
-            #region Link ESS - OPT
+            #region AT/ESS Shared
+
+            IEnumerator SharedActivateCoroutine1(Hashtable hashtable, ActivateClass activateClass)
+            {
+                bool CanNotBeDestroyedByBattleCondition(Permanent permanent, Permanent AttackingPermanent, Permanent DefendingPermanent, CardSource DefendingCard)
+                {
+                    if (permanent == AttackingPermanent)
+                    {
+                        return true;
+                    }
+
+                    if (permanent == DefendingPermanent)
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                Permanent thisPermanent = card.PermanentOfThisCard().TopCard.PermanentOfThisCard();
+                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBeDeletedByBattle(
+                    targetPermanent: thisPermanent,
+                    canNotBeDestroyedByBattleCondition: CanNotBeDestroyedByBattleCondition,
+                    effectDuration: EffectDuration.UntilOpponentTurnEnd,
+                    activateClass: activateClass,
+                    effectName: "Can't be desstroyed by battle"));
+            }
+
+            #endregion
+
+            #region All Turns - OPT
 
             if (timing == EffectTiming.WhenLinked)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Gain immunity from battle", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetUpActivateClass(CanActivateCondition, hash => SharedActivateCoroutine1(hash, activateClass), 1, false, EffectDiscription());
                 activateClass.SetHashString("BT23_021_WL");
                 cardEffects.Add(activateClass);
 
@@ -324,13 +354,42 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnField(card)
-                        && CardEffectCommons.CanTriggerWhenLinking(hashtable, perm => perm.TopCard.Owner == card.Owner, card);
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
+                        && CardEffectCommons.CanTriggerWhenLinked(hashtable, perm => perm == card.PermanentOfThisCard(), null);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+            }
+
+            #endregion
+
+            #region Link ESS - OPT
+
+            if (timing == EffectTiming.WhenLinked)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Gain immunity from battle", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsLinkedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[When Linking] This Digimon can't be deleted in battle until your opponent's turn ends.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card)
+                        && CardEffectCommons.CanTriggerWhenLinking(hashtable, null, card);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnField(card);
+                    return CardEffectCommons.IsExistOnBattleArea(card);
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 28 - 1
Assets/CardEffect/BT23/Blue/BT23_025.cs

@@ -73,7 +73,7 @@ namespace DCGO.CardEffects.BT23
                     return CardEffectCommons.IsExistOnHand(card)
                         && CardEffectCommons.IsOwnerTurn(card)
                         && CardEffectCommons.HasMatchConditionOwnersPermanent(card, IsCSDigimonOrTamer);
-                }   
+                }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
@@ -262,6 +262,33 @@ namespace DCGO.CardEffects.BT23
             if (timing == EffectTiming.SecuritySkill)
             {
                 cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
+
+                #region Delete EOOT
+
+                ActivateClass activateClass1 = new ActivateClass();
+                activateClass1.SetUpICardEffect("Delete the Digimon", CanUseEndofOpponentTurnCondition, card);
+                activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, "at the end of your opponent's turn, Delete this digimon");
+                card.EffectList(EffectTiming.OnEndTurn).Add(activateClass1);
+
+                bool CanUseEndofOpponentTurnCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnBattleArea(card.PermanentOfThisCard())
+                        && CardEffectCommons.IsOpponentTurn(card);
+                }
+
+                bool CanActivateCondition1(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnBattleArea(card.PermanentOfThisCard())
+                        && card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass1)
+                        && !card.PermanentOfThisCard().TopCard.CanNotBeAffected(activateClass1);
+                }
+
+                IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass1)).Destroy());
+                }
+
+                #endregion
             }
             #endregion
 

+ 2 - 1
Assets/CardEffect/BT23/Green/BT23_002.cs

@@ -32,7 +32,8 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnField(card);
+                    return CardEffectCommons.IsExistOnField(card)
+                        && card.PermanentOfThisCard().TopCard.HasCSTraits;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)

+ 2 - 2
Assets/CardEffect/BT23/Red/BT23_006.cs

@@ -114,13 +114,13 @@ namespace DCGO.CardEffects.BT23
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnField(card)
+                    return CardEffectCommons.IsExistOnBattleArea(card)
                         && CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, IsYourWhiteDigimon, null);
                 }
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return CardEffectCommons.IsExistOnField(card)
+                    return CardEffectCommons.IsExistOnBattleArea(card)
                         && CardEffectCommons.IsOwnerTurn(card);
 
                 }

+ 104 - 111
Assets/CardEffect/BT23/Red/BT23_013.cs

@@ -117,132 +117,125 @@ namespace DCGO.CardEffects.BT23
 
                 #region User Selection - Play Token or Select Card Location
 
-                if (canPlayToken || canSelectHand || canSelectTrash)
+                var playOptions = new List<SelectionElement<bool>>();
+                if (canPlayToken) playOptions.Add(new SelectionElement<bool>(message: $"Play [Atho, René & Por] Token", value: true, spriteIndex: 0));
+                if (canSelectHand || canSelectTrash) playOptions.Add(new SelectionElement<bool>(message: $"Player [Sistermon] in name digimon from hand or trash", value: false, spriteIndex: 1));
+
+                if (playOptions.Count == 1)
+                {
+                    if (playOptions[0].Message.Contains("Token")) playToken = true;
+                    else if (canSelectHand) playFromHand = true;
+                    else playFromTrash = true;
+                }
+
+                if (playOptions.Count == 2)
                 {
-                    if(canPlayToken && (canSelectHand || canSelectTrash))
+                    string selectPlayerMessage = "Which effect will you use";
+                    string notSelectPlayerMessage = "The opponent is which effect to use.";
+
+                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: playOptions, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                    yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                    var selectedOption = GManager.instance.userSelectionManager.SelectedBoolValue;
+
+                    if (selectedOption) playToken = true;
+                    else if (!selectedOption && canSelectHand && !canSelectTrash) playFromHand = true;
+                    else if (!selectedOption && canSelectTrash && !canSelectHand) playFromTrash = true;
+                    else
                     {
-                        List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
+                        List<SelectionElement<bool>> selectionElements1 = new List<SelectionElement<bool>>()
                         {
-                            new SelectionElement<bool>(message: $"Play [Atho, René & Por] Token", value : true, spriteIndex: 0),
-                            new SelectionElement<bool>(message: $"Player [Sistermon] in name digimon from hand or trash", value : false, spriteIndex: 1),
+                            new SelectionElement<bool>(message: $"From hand", value : true, spriteIndex: 0),
+                            new SelectionElement<bool>(message: $"From trash", value : false, spriteIndex: 1),
                         };
 
-                        string selectPlayerMessage = "Which effect will you use";
-                        string notSelectPlayerMessage = "The opponent is which effect to use.";
+                        string selectPlayerMessage1 = "From which area do you select a card?";
+                        string notSelectPlayerMessage1 = "The opponent is choosing from which area to select a card.";
 
-                        GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                        GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
                         yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
 
-                        playToken = GManager.instance.userSelectionManager.SelectedBoolValue;
+                        var handOrTrashSelection = GManager.instance.userSelectionManager.SelectedBoolValue;
+                        if (handOrTrashSelection) playFromHand = true;
+                        else playFromTrash = true;
                     }
-                    else if(!canPlayToken && (canSelectHand || canSelectTrash))
-                    {
-                        
-                    }
-
-                    if (playToken)
-                    {
-                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass));
-                    }
-                    else
-                    {
-                        if(canSelectHand && canSelectTrash)
-                        {
-                            List<SelectionElement<bool>> selectionElements1 = 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 selectPlayerMessage1 = "From which area do you select a card?";
-                            string notSelectPlayerMessage1 = "The opponent is choosing from which area to select a card.";
+                }
 
-                            GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements1, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage1, notSelectPlayerMessage: notSelectPlayerMessage1);
-                            yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+                #endregion
 
-                            playFromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
-                        }
-                        else
-                        {
-                            playFromHand = canSelectHand;
-                        }
+                CardSource selectedCard = null;
+                IEnumerator SelectCardCoroutine(CardSource cardSource)
+                {
+                    selectedCard = cardSource;
+                    yield return null;
+                }
 
-                        CardSource selectedCard = null;
-                        IEnumerator SelectCardCoroutine(CardSource cardSource)
-                        {
-                            selectedCard = cardSource;
-                            yield return null;
-                        }
+                if (playToken) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayAthoRenePorToken(activateClass: activateClass));
 
-                        if (playFromHand)
-                        {
-                            SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
-
-                            selectHandEffect.SetUp(
-                                selectPlayer: card.Owner,
-                                canTargetCondition: IsValidSistermon,
-                                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 digimon to play", "The opponent is selecting 1 digimon to play");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
-
-                            if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                new List<CardSource>() { selectedCard },
-                                activateClass: activateClass,
-                                payCost: false,
-                                isTapped: false,
-                                root: SelectCardEffect.Root.Hand,
-                                activateETB: true));
-                        }
-                        if (playFromTrash)
-                        {
-                            SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
-
-                            selectCardEffect.SetUp(
-                                canTargetCondition: IsValidSistermon,
-                                canTargetCondition_ByPreSelecetedList: null,
-                                canEndSelectCondition: null,
-                                canNoSelect: () => true,
-                                selectCardCoroutine: SelectCardCoroutine,
-                                afterSelectCardCoroutine: null,
-                                message: "Select 1 digimon to play",
-                                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 digimon to play", "The opponent is selecting 1 digimon to play");
-                            selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
-
-                            yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
-
-                            if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                new List<CardSource>() { selectedCard },
-                                activateClass: activateClass,
-                                payCost: false,
-                                isTapped: false,
-                                root: SelectCardEffect.Root.Trash,
-                                activateETB: true));
-                        }
-                    }
+                if (playFromHand)
+                {
+                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                    selectHandEffect.SetUp(
+                        selectPlayer: card.Owner,
+                        canTargetCondition: IsValidSistermon,
+                        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 digimon to play", "The opponent is selecting 1 digimon to play");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+
+                    if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                        new List<CardSource>() { selectedCard },
+                        activateClass: activateClass,
+                        payCost: false,
+                        isTapped: false,
+                        root: SelectCardEffect.Root.Hand,
+                        activateETB: true));
                 }
 
-                #endregion
+                if (playFromTrash)
+                {
+                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                    selectCardEffect.SetUp(
+                        canTargetCondition: IsValidSistermon,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: () => true,
+                        selectCardCoroutine: SelectCardCoroutine,
+                        afterSelectCardCoroutine: null,
+                        message: "Select 1 digimon to play",
+                        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 digimon to play", "The opponent is selecting 1 digimon to play");
+                    selectCardEffect.SetUpCustomMessage_ShowCard("Selected Digimon");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                    if (selectedCard != null) yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                        new List<CardSource>() { selectedCard },
+                        activateClass: activateClass,
+                        payCost: false,
+                        isTapped: false,
+                        root: SelectCardEffect.Root.Trash,
+                        activateETB: true));
+                }
             }
 
             #endregion

+ 4 - 1
Assets/CardEffect/BT23/Red/BT23_014.cs

@@ -2,7 +2,6 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 
-
 // Gallantmon 
 namespace DCGO.CardEffects.BT23
 {
@@ -64,6 +63,7 @@ namespace DCGO.CardEffects.BT23
                 ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().DebuffSE);
                 yield return null;
             }
+
             #endregion
 
             #region On Play - Floodgate
@@ -159,6 +159,9 @@ namespace DCGO.CardEffects.BT23
 
                     yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                 }
+
+                // This is here to see if it helps with timing issues when this is used first & floodgate second
+                yield return null;
             }
 
             #endregion