Lewisaaronwelch 1 rok temu
rodzic
commit
50438064a3

+ 60 - 0
Assets/CardEffect/BT21/Red/BT21_002.cs

@@ -0,0 +1,60 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+//Gurimon
+namespace DCGO.CardEffects.BT21
+{
+    public class BT21_002 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Your Turn - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Draw a card", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Draw_BT21_002");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                    => "[When Attacking] [Once Per Turn] If this Digimon has [Gammamon] in its text or the [Hero] trait, <Draw 1> (Draw 1 card from your deck).";
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnAttack(hashtable, card))
+                        {
+                            if (card.PermanentOfThisCard().TopCard.HasText("Gammamon") || card.PermanentOfThisCard().TopCard.CardTraits.FirstOrDefault(x => x.Equals("Hero")) != null)
+                            {
+                                return true;
+                            }
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT21/Red/BT21_002.cs.meta

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