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

Guilmon and Growlmon cardEffects

Quick-Bolt 1 год назад
Родитель
Сommit
6a985424a7

+ 135 - 0
Assets/CardEffect/BT19/Red/Growlmon_BT19_009.cs

@@ -0,0 +1,135 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.BT19
+{
+    public class Growlmon_BT19_009 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play 1 Tamer with [Takato Matsuki] in its name from hand", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[When Digivolving] If you have 1 or fewer Tamers, you may play 1 [Takato Matsuki] from your hand without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool IsTakatoCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsTamer && (cardSource.ContainsCardName("Takato Matsuki") && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass));
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.HasMatchConditionOwnersHand(card, IsTakatoCardCondition) && card.Owner.GetBattleAreaPermanents().Count(permanent => permanent.IsTamer) <= 1;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsTakatoCardCondition))
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                        selectHandEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: IsTakatoCardCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: 1,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            isShowOpponent: true,
+                            selectCardCoroutine: SelectCardCoroutine,
+                            afterSelectCardCoroutine: null,
+                            mode: SelectHandEffect.Mode.Custom,
+                            cardEffect: activateClass);
+
+                        selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
+                        selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectHandEffect.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
+
+            #region Inherit
+            if (timing == EffectTiming.None)
+            {
+                ChangeDPDeleteEffectMaxDPClass changeDPDeleteEffectMaxDPClass = new ChangeDPDeleteEffectMaxDPClass();
+                changeDPDeleteEffectMaxDPClass.SetUpICardEffect("Maximum DP of DP-based deletion effects gets +2000 DP if 0 or less memory", CanUseCondition, card);
+                changeDPDeleteEffectMaxDPClass.SetUpChangeDPDeleteEffectMaxDPClass(changeMaxDP: ChangeMaxDP);
+                changeDPDeleteEffectMaxDPClass.SetIsInheritedEffect(true);
+                cardEffects.Add(changeDPDeleteEffectMaxDPClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (isExistOnField(card))
+                    {
+                        if (card.Owner.MemoryForPlayer <= 0)
+                        {
+                            if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                int ChangeMaxDP(int maxDP, ICardEffect cardEffect)
+                {
+                    if (cardEffect != null)
+                    {
+                        if (cardEffect.EffectSourceCard != null)
+                        {
+                            if (cardEffect.EffectSourceCard.Owner == card.Owner)
+                            {
+                                if (cardEffect.EffectSourceCard.PermanentOfThisCard() == card.PermanentOfThisCard()) maxDP += 2000;
+                            }
+                        }
+                    }
+
+                    return maxDP;
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT19/Red/Growlmon_BT19_009.cs.meta

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

+ 111 - 0
Assets/CardEffect/BT19/Red/Guilmon_BT19_007.cs

@@ -0,0 +1,111 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.BT19
+{
+    public class Guilmon_BT19_007 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Start of Your Main Phase
+            if (timing == EffectTiming.OnStartMainPhase)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Start of Your Main Phase] If you have [Takato Matsuki]/[Calumon], gain 1 memory.";
+                }
+
+                bool HasPermanentsCondition(Permanent permanent)
+                {
+                    if (permanent.IsDigimon && permanent.TopCard.EqualsCardName("Calumon") || permanent.IsTamer && permanent.TopCard.EqualsCardName("Takato Matsuki"))
+                    {
+                        return true;
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.IsOwnerTurn(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+
+                    if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, HasPermanentsCondition))
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                    }
+                }
+            }
+            #endregion
+
+            #region Inherit
+            if (timing == EffectTiming.None)
+            {
+                ChangeDPDeleteEffectMaxDPClass changeDPDeleteEffectMaxDPClass = new ChangeDPDeleteEffectMaxDPClass();
+                changeDPDeleteEffectMaxDPClass.SetUpICardEffect("Maximum DP of DP-based deletion effects gets +2000 DP if 0 or less memory", CanUseCondition, card);
+                changeDPDeleteEffectMaxDPClass.SetUpChangeDPDeleteEffectMaxDPClass(changeMaxDP: ChangeMaxDP);
+                changeDPDeleteEffectMaxDPClass.SetIsInheritedEffect(true);
+                cardEffects.Add(changeDPDeleteEffectMaxDPClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (isExistOnField(card))
+                    {
+                        if (card.Owner.MemoryForPlayer <= 0)
+                        {
+                            if (card.Owner.GetBattleAreaDigimons().Contains(card.PermanentOfThisCard()))
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                int ChangeMaxDP(int maxDP, ICardEffect cardEffect)
+                {
+                    if (cardEffect != null)
+                    {
+                        if (cardEffect.EffectSourceCard != null)
+                        {
+                            if (cardEffect.EffectSourceCard.Owner == card.Owner)
+                            {
+                                if (cardEffect.EffectSourceCard.PermanentOfThisCard() == card.PermanentOfThisCard()) maxDP += 2000;
+                            }
+                        }
+                    }
+
+                    return maxDP;
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/BT19/Red/Guilmon_BT19_007.cs.meta

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