Răsfoiți Sursa

Create EX12_022.cs

x89rt2 2 luni în urmă
părinte
comite
4941f1df79
1 a modificat fișierele cu 135 adăugiri și 0 ștergeri
  1. 135 0
      Assets/Scripts/CardEffect/EX12/Blue/EX12_022.cs

+ 135 - 0
Assets/Scripts/CardEffect/EX12/Blue/EX12_022.cs

@@ -0,0 +1,135 @@
+using System.Collections;
+using System.Collections.Generic;
+
+// Kamemon
+namespace DCGO.CardEffects.EX12
+{
+    public class EX12_022 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Alternate Digivolution
+            if (timing == EffectTiming.None)
+            {
+                bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsTraits("Shambala");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 2, permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Reveal 3, Add 1 [Shambala] trait and 1 [SW] trait, bot deck the rest", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Shambala] trait and 1 card with [SW] trait among them to the hand. Return the rest to the bottom of the deck.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card)
+                        && CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    return cardSource.EqualsTraits("Shambala");
+                }
+
+                bool CanSelectCardCondition1(CardSource cardSource)
+                {
+                    return cardSource.EqualsTraits("SW");
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (card.Owner.LibraryCards.Count > 0)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
+                        revealCount: 3,
+                        simplifiedSelectCardConditions:
+                        new SimplifiedSelectCardConditionClass[]
+                        {
+                            new SimplifiedSelectCardConditionClass(
+                                canTargetCondition:CanSelectCardCondition,
+                                message: "Select 1 [Shambala] trait card.",
+                                mode: SelectCardEffect.Mode.AddHand,
+                                maxCount: 1,
+                                selectCardCoroutine: null),
+                            new SimplifiedSelectCardConditionClass(
+                                canTargetCondition:CanSelectCardCondition1,
+                                message: "Select 1 [SW] trait card.",
+                                mode: SelectCardEffect.Mode.AddHand,
+                                maxCount: 1,
+                                selectCardCoroutine: null),
+                        },
+                        remainingCardsPlace: RemainingCardsPlace.DeckBottom,
+                        activateClass: activateClass
+                    ));
+                    }
+                }
+            }
+            #endregion
+
+            #region Inherited
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("If you have 7 or fewer cards in hand, <Draw 1>.", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("EX12_022_Inherited");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                 => "[When Attacking] [Once Per Turn] If your hand has 7 or fewer cards, <Draw 1>.";
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimonTrigger(card, activateClass)
+                        && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    bool Used = false;
+
+                    if (card.Owner.HandCards.Count <= 7)
+                    {
+                        Used = true;
+
+                        yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
+                    }
+
+                    if (!Used)
+                    {
+                        activateClass.RemoveUse();
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}