Răsfoiți Sursa

added Takato

dp101428 1 an în urmă
părinte
comite
c867caa592

+ 1 - 0
Assets/CardEffect/BT21/Purple/BT21_088.cs

@@ -427,6 +427,7 @@ namespace DCGO.CardEffects.BT21
                 }
             }
             #endregion
+
             #region Security
             if (timing == EffectTiming.SecuritySkill)
             {

+ 169 - 0
Assets/CardEffect/BT21/Purple/BT21_089.cs

@@ -0,0 +1,169 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+//BT21_089 Takato
+namespace DCGO.CardEffects.BT21
+{
+    public class BT21_089 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+
+            #region Start of Main Phase
+            if (timing == EffectTiming.OnStartMainPhase)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Start of Your Main Phase] If your opponent has a Digimon, gain 1 memory.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 1)
+                        {
+                            if (card.Owner.CanAddMemory(activateClass))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                }
+            }
+            #endregion
+
+            #region All turns
+            if(timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Gain blocker and maybe +2k", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[All Turns] When any of your Digimon are played or digivolve, by suspending this Tamer, until your opponent's turn ends, 1 of your Digimon with [Guilmon], [Growlmon], [Gallantmon], or [Megidramon] in its name or the [Hero] trait gains <Blocker> and, it here are 10 or more total cards in both players' trashes, gets + 2000 DP.";
+                }
+
+                bool MyDigimonPlayedDigid(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, MyDigimonPlayedDigid))
+                                return true;
+
+                            if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, MyDigimonPlayedDigid))
+                                return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanReceiveGainCondtion(Permanent permanent)
+                {
+                    return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) && (
+                        permanent.TopCard.ContainsCardName("Guilmon") ||
+                        permanent.TopCard.ContainsCardName("Growlmon") ||
+                        permanent.TopCard.ContainsCardName("Gallantmon") ||
+                        permanent.TopCard.ContainsCardName("Megidramon") ||
+                        permanent.TopCard.EqualsTraits("Hero"));
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return isExistOnField(card) 
+                        && CardEffectCommons.HasMatchConditionOwnersPermanent(card, CanReceiveGainCondtion) 
+                        && CardEffectCommons.CanActivateSuspendCostEffect(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
+                        new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
+
+
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanReceiveGainCondtion))
+                    {
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanReceiveGainCondtion));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanReceiveGainCondtion,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: false,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: SelectPermanentCoroutine,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will gain <Blocker> and 2k DP if 10+ cards in trashs.", "The opponent is selecting 1 Digimon that will gain <Blocker> and 2k DP if 10+ cards in trashs.");
+
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
+
+                        IEnumerator SelectPermanentCoroutine(Permanent permanent)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
+
+                            if (card.Owner.TrashCards.Count + card.Owner.Enemy.TrashCards.Count >= 10)
+                            {
+                                yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(permanent, 2000, EffectDuration.UntilOpponentTurnEnd, activateClass));
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+
+            #region Security
+            if (timing == EffectTiming.SecuritySkill)
+            {
+                cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT21/Purple/BT21_089.cs.meta

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