Procházet zdrojové kódy

remaining bugged bt19 cards

mbunch_kascope před 1 rokem
rodič
revize
6dbf7a76ea

+ 100 - 28
Assets/CardEffect/BT19/Black/BT19_086.cs

@@ -77,6 +77,7 @@ namespace DCGO.CardEffects.BT19
                     if (selectedCard != null)
                     {
                         yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: selectedCard, cardEffect: activateClass));
+                        yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
                     }
                 }
             }
@@ -175,41 +176,112 @@ namespace DCGO.CardEffects.BT19
                         {
                             if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsCyberdramon))
                             {
-                                int maxCount = Math.Min(1, card.Owner.HandCards.Count(IsCyberdramon));
+                                
+                            }
 
-                                SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+                            bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, IsCyberdramon);
+                            bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsCyberdramon);
 
-                                selectHandEffect.SetUp(
-                                    selectPlayer: card.Owner,
-                                    canTargetCondition: IsCyberdramon,
-                                    canTargetCondition_ByPreSelecetedList: null,
-                                    canEndSelectCondition: null,
-                                    maxCount: maxCount,
-                                    canNoSelect: true,
-                                    canEndNotMax: false,
-                                    isShowOpponent: false,
-                                    selectCardCoroutine: null,
-                                    afterSelectCardCoroutine: SelectCardCoroutine,
-                                    mode: SelectHandEffect.Mode.Custom,
-                                    cardEffect: activateClass);
+                            if (canSelectHand || canSelectTrash)
+                            {
+                                if (canSelectHand && canSelectTrash)
+                                {
+                                    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),
+                        };
 
-                                selectHandEffect.SetUpCustomMessage("Select [Cyberdramon] to play.", "The opponent is selecting an [Cyberdramon] to play.");
+                                    string selectPlayerMessage = "From which area do you play a card?";
+                                    string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
 
-                                yield return StartCoroutine(selectHandEffect.Activate());
+                                    GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
+                                }
+                                else
+                                {
+                                    GManager.instance.userSelectionManager.SetBool(canSelectHand);
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
+
+                                bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
 
-                                IEnumerator SelectCardCoroutine(List<CardSource> selectedCards)
+                                List<CardSource> selectedCards = new List<CardSource>();
+
+                                IEnumerator SelectCardCoroutine(CardSource cardSource)
                                 {
-                                    if (selectedCards.Count > 0)
-                                    {
-                                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
-                                            cardSources: selectedCards,
-                                            activateClass: activateClass,
-                                            payCost: false,
-                                            isTapped: false,
-                                            root: SelectCardEffect.Root.Hand,
-                                            activateETB: true));
-                                    }
+                                    selectedCards.Add(cardSource);
+
+                                    yield return null;
                                 }
+
+                                if (fromHand)
+                                {
+                                    int maxCount = Math.Min(1, card.Owner.HandCards.Count(IsCyberdramon));
+
+                                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                                    selectHandEffect.SetUp(
+                                        selectPlayer: card.Owner,
+                                        canTargetCondition: IsCyberdramon,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        maxCount: maxCount,
+                                        canNoSelect: true,
+                                        canEndNotMax: false,
+                                        isShowOpponent: false,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        mode: SelectHandEffect.Mode.Custom,
+                                        cardEffect: activateClass);
+
+                                    selectHandEffect.SetUpCustomMessage("Select [Cyberdramon] to play.", "The opponent is selecting an [Cyberdramon] to play.");
+
+                                    yield return StartCoroutine(selectHandEffect.Activate());
+                                }
+                                else
+                                {
+                                    int maxCount = 1;
+
+                                    SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                    selectCardEffect.SetUp(
+                                        canTargetCondition: IsCyberdramon,
+                                        canTargetCondition_ByPreSelecetedList: null,
+                                        canEndSelectCondition: null,
+                                        canNoSelect: () => true,
+                                        selectCardCoroutine: SelectCardCoroutine,
+                                        afterSelectCardCoroutine: null,
+                                        message: "Select 1 card to play.",
+                                        maxCount: maxCount,
+                                        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 play.", "The opponent is selecting 1 card to play.");
+                                    selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                                    yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
+                                }
+
+
+                                SelectCardEffect.Root root = SelectCardEffect.Root.Hand;
+
+                                if (!fromHand)
+                                    root = SelectCardEffect.Root.Trash;
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                                    cardSources: selectedCards,
+                                    activateClass: activateClass,
+                                    payCost: false,
+                                    isTapped: false,
+                                    root: root,
+                                    activateETB: true));
                             }
                         }
                     }

+ 1 - 1
Assets/CardEffect/BT19/Green/BT19_095.cs

@@ -120,7 +120,7 @@ namespace DCGO.CardEffects.BT19
 
                 bool HasDigimon(Permanent permanent)
                 {
-                    return CardEffectCommons.IsOwnerPermanent(permanent, card) && permanent.IsDigimon;
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 1 - 1
Assets/CardEffect/BT19/Yellow/BT19_040_token.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 
-namespace DCGO.CardEffects.BT19
+namespace DCGO.CardEffects.Tokens
 {
     public class BT19_040_token : CEntity_Effect
     {

+ 1 - 1
Assets/CardEffect/BT19/Yellow/BT19_083.cs

@@ -91,7 +91,7 @@ namespace DCGO.CardEffects.BT19
             #endregion
 
             #region Your Turn 
-            if (timing == EffectTiming.None)
+            if (timing == EffectTiming.OnUseOption)
             {
                 ActivateClass activateClass = new ActivateClass();
                 activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);

+ 1 - 1
Assets/CardEffect/BT19/Yellow/BT19_093.cs

@@ -152,7 +152,7 @@ namespace DCGO.CardEffects.BT19
 
                 bool HasDigimon(Permanent permanent)
                 {
-                    return CardEffectCommons.IsOpponentPermanent(permanent, card) && permanent.IsDigimon;
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
                 }
 
                 bool CanUseCondition(Hashtable hashtable)

+ 2 - 1
Assets/CardEffect/EX2/White/EX2_007.cs

@@ -295,7 +295,8 @@ namespace DCGO.CardEffects.EX2
                     {
                         if (cardSource.CardTraits.Contains("D-Reaper"))
                         {
-                            return true;
+                            if(!cardSource.IsOption)
+                                return true;
                         }
                     }
                 }

+ 0 - 1
Assets/Scripts/CardSource.cs

@@ -1142,7 +1142,6 @@ public class CardSource : MonoBehaviour
         }
 
         string replaced = name.Replace(" ", "");
-        replaced = replaced.Replace(":", "");
         string lower = name.ToLower();
 
         return CardNames.Some((cardName) =>