Просмотр исходного кода

Finished BT20-008, 013, 014.
Added BT20-17-token

S-E-I-G-E 1 год назад
Родитель
Сommit
7b8317cb4f

+ 3 - 1
Assets/CardEffect/BT20/Red/BT20_008.cs

@@ -20,7 +20,7 @@ namespace DCGO.CardEffects.BT20
 
                 string EffectDiscription()
                 {
-                    return "[Start of Your Main Phase] By trashing 1 card with [Huckmon] or [Sistermon] in its name or the [Royal Knight] trait";
+                    return "[Start of Your Main Phase] By trashing 1 card with [Huckmon] or [Sistermon] in its name or the [Royal Knight] trait in your hand, <Draw 1> and gain 1 memory.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -78,6 +78,8 @@ namespace DCGO.CardEffects.BT20
 
                         selectHandEffect.SetUpCustomMessage("Select 1 card to discard.", "The opponent is selecting 1 card to discard.");
                         selectHandEffect.SetUpCustomMessage_ShowCard("Discarded Card");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
                     }
 
                     if (discarded)

+ 3 - 3
Assets/CardEffect/BT20/Red/BT20_013.cs

@@ -144,7 +144,7 @@ namespace DCGO.CardEffects.BT20
 
                         #endregion
 
-                        if (card.Owner.TrashCards.Count(CanSelectCardCondition) >= 1)
+                        if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
                         {
                             List<CardSource> selectedCards = new List<CardSource>();
 
@@ -165,7 +165,7 @@ namespace DCGO.CardEffects.BT20
                                 selectCardCoroutine: SelectCardCoroutine,
                                 afterSelectCardCoroutine: null,
                                 mode: SelectCardEffect.Mode.Custom,
-                                root: SelectCardEffect.Root.Trash,
+                                root: SelectCardEffect.Root.Hand,
                                 customRootCardList: null,
                                 canLookReverseCard: false,
                                 cardEffect: activateClass);
@@ -187,7 +187,7 @@ namespace DCGO.CardEffects.BT20
                                 activateClass: activateClass,
                                 payCost: true,
                                 isTapped: false,
-                                root: SelectCardEffect.Root.Trash,
+                                root: SelectCardEffect.Root.Hand,
                                 activateETB: true));
                         }
 

+ 219 - 27
Assets/CardEffect/BT20/Red/BT20_014.cs

@@ -1,7 +1,8 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 
-namespace DCGO.CardEffects
+namespace DCGO.CardEffects.BT20
 {
     public class BT20_014 : CEntity_Effect
     {
@@ -11,35 +12,117 @@ namespace DCGO.CardEffects
 
             if (timing == EffectTiming.OnEnterFieldAnyone)
             {
-                #region On Play
-                ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
-                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
-                cardEffects.Add(activateClass);
-
-                string EffectDiscription()
                 {
-                    return "";
-                }
+                    #region On Play
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    cardEffects.Add(activateClass);
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return true;
-                }
+                    string EffectDiscription()
+                    {
+                        return "[On Play] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                    }
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    return true;
-                }
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                    }
 
-                IEnumerator ActivateCoroutine(Hashtable hashtable)
-                {
-                    yield return null;
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        return card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanent) >= 1;
+                    }
+
+                    bool CanSelectPermanent(Permanent permanent)
+                    {
+                        return permanent.DP <= 5000;
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        List<Permanent> selectedPermanents = new List<Permanent>();
+
+                        int maxCount = 1;
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanent,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass
+                            );
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+                    #endregion
                 }
-                #endregion
+                {
+                    #region On Digivolve
+                    ActivateClass activateClass = new ActivateClass();
+                    activateClass.SetUpICardEffect("", CanUseCondition, card);
+                    activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                    cardEffects.Add(activateClass);
 
-                #region On Digivolve
-                #endregion
+                    string EffectDiscription()
+                    {
+                        return "[On Digivolve] Delete 1 of your opponent's Digimon with 5000DP or less.";
+                    }
+
+                    bool CanUseCondition(Hashtable hashtable)
+                    {
+                        return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
+                    }
+
+                    bool CanActivateCondition(Hashtable hashtable)
+                    {
+                        return card.Owner.Enemy.GetBattleAreaDigimons().Count(CanSelectPermanent) >= 1;
+                    }
+
+                    bool CanSelectPermanent(Permanent permanent)
+                    {
+                        return permanent.DP <= 5000;
+                    }
+
+                    IEnumerator ActivateCoroutine(Hashtable hashtable)
+                    {
+                        List<Permanent> selectedPermanents = new List<Permanent>();
+
+                        int maxCount = 1;
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner.Enemy,
+                            canTargetCondition: CanSelectPermanent,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Destroy,
+                            cardEffect: activateClass
+                            );
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 card to delete.", "The opponent is selecting 1 card to delete.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+                    }
+
+                    #endregion
+                }
             }
 
             if (timing == EffectTiming.OnEndTurn)
@@ -52,7 +135,7 @@ namespace DCGO.CardEffects
 
                 string EffectDiscription()
                 {
-                    return "";
+                    return "[End of Your Turn] By suspending 1 of your other Digimon, this Digiomon may digivolve into a Digimon card with [Jesmon] in its name in the hand without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
@@ -62,12 +145,121 @@ namespace DCGO.CardEffects
 
                 bool CanActivateCondition(Hashtable hashtable)
                 {
-                    return true;
+                    if (card.Owner.HandCards.Count(CanSelectPlayCardCondition) >= 1)
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                bool CanSelectPlayCardCondition (CardSource cardSource)
+                {
+                    if (cardSource.ContainsCardName("Jesmon"))
+                    {
+                        return true;
+                    }
+                    return false;
+                }
+
+                bool CanSelectSuspendPermanent (Permanent permanent)
+                {
+                    if (permanent.CanSuspend)
+                    {
+                        if (permanent.TopCard.Level == 5)
+                        {
+                            return true;
+                        }    
+                    }
+                    return false;
                 }
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    if (card.Owner.HandCards.Count(CanSelectPlayCardCondition) >= 1)
+                    {
+                        if (card.Owner.GetBattleAreaDigimons().Count(CanSelectSuspendPermanent) >= 1)
+                        {
+
+                            #region select card to suspend
+                            List<Permanent> selectedPermanents = new List<Permanent>();
+
+                            int maxCount = 1;
+
+                            SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                            selectPermanentEffect.SetUp(
+                                selectPlayer: card.Owner,
+                                canTargetCondition: CanSelectSuspendPermanent,
+                                canTargetCondition_ByPreSelecetedList: null,
+                                canEndSelectCondition: null,
+                                maxCount: maxCount,
+                                canNoSelect: false,
+                                canEndNotMax: false,
+                                selectPermanentCoroutine: selectPermanentCoroutine,
+                                afterSelectPermanentCoroutine: null,
+                                mode: SelectPermanentEffect.Mode.Tap,
+                                cardEffect: activateClass
+                                );
+                            selectPermanentEffect.SetUpCustomMessage("Select 1 card to suspend.", "The opponent is selecting 1 card to suspend.");
+
+                            yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                            IEnumerator selectPermanentCoroutine (Permanent permanent)
+                            {
+                                selectedPermanents.Add( permanent );
+                                yield return null;
+                            }
+                            #endregion
+
+                            if (selectedPermanents.Count > 0)
+                            {
+                                #region select card to play
+                                List<CardSource> selectedCards = new List<CardSource>();
+
+                                SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                                selectCardEffect.SetUp(
+                                    selectPlayer: card.Owner,
+                                    canTargetCondition: CanSelectPlayCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    maxCount: maxCount,
+                                    message: "Select 1 card to play.",
+                                    canNoSelect: () => true,
+                                    canEndNotMax: false,
+                                    isShowOpponent: true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Hand,
+                                    customRootCardList: null,
+                                    canLookReverseCard: false,
+                                    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());
+
+                                IEnumerator SelectCardCoroutine(CardSource cardSource)
+                                {
+                                    selectedCards.Add(cardSource);
+
+                                    yield return null;
+                                }
+
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                                    cardSources: selectedCards,
+                                    activateClass: activateClass,
+                                    payCost: false,
+                                    isTapped: false,
+                                    root: SelectCardEffect.Root.Hand,
+                                    activateETB: true));
+                                #endregion
+
+                            }
+                        }
+                    }
                 }
                 #endregion
             }

+ 62 - 0
Assets/CardEffect/BT20/White/BT20_17_token.cs

@@ -0,0 +1,62 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT20
+{
+    public class BT20_17_token : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Reboot
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region Blocker
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region Decoy
+
+            if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
+            {
+                string DecoyDiscription()
+                {
+                    return "<Decoy (Red)/(Black)> (When one of your other Red or Black Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
+                }
+
+                bool CanSelectDecoyPermanentCondition(Permanent permanent)
+                {
+                    if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
+                    {
+                        if (permanent != card.PermanentOfThisCard())
+                        {
+                            if (permanent.TopCard.CardColors.Contains(CardColor.Red) || permanent.TopCard.CardColors.Contains(CardColor.Black))
+                            {
+                                if (permanent.willBeRemoveField)
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy ([Black])", effectDiscription: DecoyDiscription()));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT20/White/BT20_17_token.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d9eecd4b160fb624783bc5083933a4ba
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: