Bladeren bron

Added Candlemon.

JanusClockwork 1 jaar geleden
bovenliggende
commit
7179ce82cf

+ 152 - 0
Assets/CardEffect/BT18/Yellow/Candlemon_BT18_030.cs

@@ -0,0 +1,152 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects
+{
+    public class Candlemon_BT18_030 : CEntity_Effect
+    {
+        List<ICardEffect> cardEffects = new List<ICardEffect>();
+        
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal top 3, add 1 yellow Data and 1 Witchelny", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 yellow card with the [Data] trait and 1 card with the [Witchelny] trait among them to the hand. Return the rest to the bottom of the deck.";
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    return (cardSource.CardTraits.Contains("Data") && cardSource.CardColors.Contains(CardColor.Yellow));
+                }
+
+                bool CanSelectCardCondition1(CardSource cardSource)
+                {
+                    return cardSource.CardTraits.Contains("Witchelny");
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.Owner.LibraryCards.Count >= 1)
+                            return true;
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                            new SimplifiedSelectCardConditionClass(
+                                canTargetCondition:CanSelectCardCondition,
+                                message: "Select 1 yellow card with [Data] in its traits.",
+                                mode: SelectCardEffect.Mode.AddHand,
+                                maxCount: 1,
+                                selectCardCoroutine: null),
+                            new SimplifiedSelectCardConditionClass(
+                                canTargetCondition:CanSelectCardCondition1,
+                                message: "Select 1 card with [Witchelny] in its traits.",
+                                mode: SelectCardEffect.Mode.AddHand,
+                                maxCount: 1,
+                                selectCardCoroutine: null),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.DeckBottom,
+                        activateClass: activateClass
+                    ));
+                }
+            }
+            #endregion
+
+            #region All Turns - Inherited
+
+            if (timing == EffectTiming.WhenRemoveField)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash 1 security to prevent this Digimon from leaving Battle Area", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                activateClass.SetHashString("TrashSecurityToStay_BT18_030");
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[All Turns] When this yellow Digimon with the [Data] or [Witchelny] trait would leave the battle area by an opponent's effect, by trashing your top security card, it doesn't leave.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card))
+                        {
+                            if (CardEffectCommons.IsByEffect(hashtable, cardEffect => CardEffectCommons.IsOpponentEffect(cardEffect, card)))
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.CardColors.Contains(CardColor.Yellow) && 
+                            (card.CardTraits.Contains("Data") || card.CardTraits.Contains("Witchelny")))
+                        {
+                            if (card.Owner.SecurityCards.Count >= 1 )
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card) || card.Owner.SecurityCards.Count >= 1)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
+                        card.Owner,
+                        1,
+                        activateClass,
+                        true).DestroySecurity());
+
+
+                        Permanent thisCardPermanent = card.PermanentOfThisCard();
+
+                        thisCardPermanent.willBeRemoveField = false;
+
+                        thisCardPermanent.HideDeleteEffect();
+                        thisCardPermanent.HideHandBounceEffect();
+                        thisCardPermanent.HideDeckBounceEffect();
+                        thisCardPermanent.HideWillRemoveFieldEffect();
+
+                        yield return null;
+                    }
+                }
+            }
+
+            #endregion
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT18/Yellow/Candlemon_BT18_030.cs.meta

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