Ver Fonte

Nidhoggmon cardEffect

Quick-Bolt há 2 anos atrás
pai
commit
b914b48631

+ 293 - 0
Assets/CardEffect/EX7/Purple/Nidhoggmon_EX7_060.cs

@@ -0,0 +1,293 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace DCGO.CardEffects.EX7
+{
+    public class Nidhoggmon_EX7_060 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Blocker
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: null));
+            }
+            #endregion
+
+            #region Trash Main
+            if (timing == EffectTiming.OnDeclaration)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play this card from trash with reduced cost", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
+                activateClass.SetIsInheritedEffect(true);
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[Trash] [Main] If you have 4 or fewer cards in your hand, you may play this card from your trash with the play cost reduced by 4.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsOwnerTurn(card))
+                    {
+                        if(CardEffectCommons.IsExistOnTrash(card))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (card.Owner.LibraryCards.Count >= 1)
+                        {
+                            if (card.Owner.HandCards.Count <= 4)
+                            {
+                                return true;
+                            }
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.IsDigimon)
+                    {
+                        if(cardSource.name.Contains("Nidhoggmon"))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    #region reduce play cost
+                    ChangeCostClass changeCostClass = new ChangeCostClass();
+                    changeCostClass.SetUpICardEffect($"Play Cost -3", CanUseCondition1, card);
+                    changeCostClass.SetUpChangeCostClass(changeCostFunc: ChangeCost, cardSourceCondition: CardSourceCondition, rootCondition: RootCondition, isUpDown: isUpDown, isCheckAvailability: () => false, isChangePayingCost: () => true);
+                    Func<EffectTiming, ICardEffect> getCardEffect = GetCardEffect;
+                    card.Owner.UntilCalculateFixedCostEffect.Add(getCardEffect);
+
+                    ICardEffect GetCardEffect(EffectTiming _timing)
+                    {
+                        if (_timing == EffectTiming.None)
+                        {
+                            return changeCostClass;
+                        }
+
+                        return null;
+                    }
+
+                    bool CanUseCondition1(Hashtable hashtable)
+                    {
+                        return true;
+                    }
+
+                    int ChangeCost(CardSource cardSource, int Cost, SelectCardEffect.Root root, List<Permanent> targetPermanents)
+                    {
+                        return Cost -3;
+                    }
+
+                    bool CardSourceCondition(CardSource cardSource)
+                    {
+                        if (cardSource.IsDigimon)
+                        {
+                            if (cardSource.ContainsCardName("Nidhoggmon"))
+                            {
+                                return true;
+                            }
+                        }
+
+                        return false;
+                    }
+
+                    bool RootCondition(SelectCardEffect.Root root)
+                    {
+                        return true;
+                    }
+
+                    bool isUpDown()
+                    {
+                        return true;
+                    }
+                    #endregion
+
+                    if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        int maxCount = 1;
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select cards to play.",
+                                    maxCount: maxCount,
+                                    canEndNotMax: true,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Trash,
+                                    customRootCardList: null,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select cards to play.", "The opponent is selecting cards to play.");
+                        selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectCardEffect.Activate());
+
+                        IEnumerator SelectCardCoroutine(CardSource cardSource)
+                        {
+                            selectedCards.Add(cardSource);
+
+                            yield return null;
+                        }
+
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
+                          cardSources: selectedCards,
+                          activateClass: activateClass,
+                          payCost: true,
+                          isTapped: false,
+                          root: SelectCardEffect.Root.Trash,
+                          activateETB: true));
+                    }
+
+                    #region release effect reducing play cost 
+                    card.Owner.UntilCalculateFixedCostEffect.Remove(getCardEffect);
+                    #endregion
+                }
+            }
+            #endregion
+
+            #region On Deletion
+            if (timing == EffectTiming.OnDestroyedAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Play Digimons from trash", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] You may play up to 2 level 4 or lower purple Digimon cards from your trash without paying their memory costs. Any [On Play] effects on Digimon played with this effect don't activate. ";
+                }
+
+                bool CanSelectCardCondition(CardSource cardSource)
+                {
+                    if (cardSource.IsDigimon)
+                    {
+                        if (cardSource.Level <= 5 && cardSource.CardTraits.Contains("Dark Dragon") || cardSource.Level <= 5 && cardSource.CardTraits.Contains("Evil Dragon"))
+                        {
+                            if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
+                            {
+                                if (cardSource.HasLevel)
+                                {
+                                    return true;
+                                }
+                            }
+                        }
+                        
+                    }
+
+                    return false;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleArea(card))
+                    {
+                        if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable _hashtable)
+                {
+                    if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition))
+                    {
+                        List<CardSource> selectedCards = new List<CardSource>();
+
+                        int maxCount = 1;
+
+                        SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
+
+                        selectCardEffect.SetUp(
+                                    canTargetCondition: CanSelectCardCondition,
+                                    canTargetCondition_ByPreSelecetedList: null,
+                                    canEndSelectCondition: null,
+                                    canNoSelect: () => true,
+                                    selectCardCoroutine: SelectCardCoroutine,
+                                    afterSelectCardCoroutine: null,
+                                    message: "Select 1 card to play.",
+                                    maxCount: maxCount,
+                                    canEndNotMax: true,
+                                    isShowOpponent: true,
+                                    mode: SelectCardEffect.Mode.Custom,
+                                    root: SelectCardEffect.Root.Trash,
+                                    customRootCardList: null,
+                                    canLookReverseCard: true,
+                                    selectPlayer: card.Owner,
+                                    cardEffect: activateClass);
+
+                        selectCardEffect.SetUpCustomMessage("Select 1 card with [Dark Dragon]/[Evil Dragon] trait to play.", "The opponent is selecting 1 card to play.");
+                        selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
+
+                        yield return StartCoroutine(selectCardEffect.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.Trash,
+                            activateETB: true));
+                    }
+                }
+            }
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX7/Purple/Nidhoggmon_EX7_060.cs.meta

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

+ 53 - 0
lfs/objects/82/df/82df6af2caf43810da285616d64e05e043c6d5d6c73821cb22157e3ed64e07c1

@@ -0,0 +1,53 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ac423894725fed64a9146a10d3878ce1, type: 3}
+  m_Name: SaberLeomon-EX7-029_P1
+  m_EditorClassIdentifier: 
+  CardIndex: 3743
+  cardColors: 0200000003000000
+  PlayCost: 7
+  EvoCosts:
+  - CardColor: 2
+    Level: 5
+    MemoryCost: 4
+  Level: 6
+  CardName_JPN: 
+  CardName_ENG: SaberLeomon
+  Form_JPN: []
+  Form_ENG:
+  - Mega
+  Attribute_JPN: []
+  Attribute_ENG:
+  - Data
+  Type_JPN: []
+  Type_ENG:
+  - Ancient Animal
+  - NSp
+  CardSpriteName: EX7-029_P1
+  cardKind: 0
+  EffectDiscription_JPN: 
+  EffectDiscription_ENG: "[Digivolve]Lv.5 w/[NSp]\_trait or Lv.5 w/[Leomon]\_in its
+    name: Cost 3 \n\n[Hand] [Counter] \uFF1CBlast Digivolve\uFF1E \n[On Play] [When
+    Digivolving] 2 of your opponent's suspended Digimon get -8000 DP until the end
+    of your turn.\n[When Digivolving] [When Attacking] [Once Per Turn] Suspend 1
+    of your opponent's Digimon. Then, if your opponent has no unsuspended Digimon,
+    unsuspend this Digimon."
+  InheritedEffectDiscription_JPN: 
+  InheritedEffectDiscription_ENG: '-'
+  SecurityEffectDiscription_JPN: 
+  SecurityEffectDiscription_ENG: '-'
+  CardEffectClassName: SaberLeomonAce_EX7_029
+  DP: 12000
+  rarity: 3
+  OverflowMemory: 4
+  CardID: EX7-029
+  MaxCountInDeck: 4

+ 53 - 0
lfs/objects/dc/17/dc172c4b72e7f0db37bf33e8691445490d2cd2a98400cf18c1149bf8533ed554

@@ -0,0 +1,53 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ac423894725fed64a9146a10d3878ce1, type: 3}
+  m_Name: SaberLeomon-EX7-029
+  m_EditorClassIdentifier: 
+  CardIndex: 3742
+  cardColors: 0200000003000000
+  PlayCost: 7
+  EvoCosts:
+  - CardColor: 2
+    Level: 5
+    MemoryCost: 4
+  Level: 6
+  CardName_JPN: 
+  CardName_ENG: SaberLeomon
+  Form_JPN: []
+  Form_ENG:
+  - Mega
+  Attribute_JPN: []
+  Attribute_ENG:
+  - Data
+  Type_JPN: []
+  Type_ENG:
+  - Ancient Animal
+  - NSp
+  CardSpriteName: EX7-029
+  cardKind: 0
+  EffectDiscription_JPN: 
+  EffectDiscription_ENG: "[Digivolve]Lv.5 w/[NSp]\_trait or Lv.5 w/[Leomon]\_in its
+    name: Cost 3 \n\n[Hand] [Counter] \uFF1CBlast Digivolve\uFF1E \n[On Play] [When
+    Digivolving] 2 of your opponent's suspended Digimon get -8000 DP until the end
+    of your turn.\n[When Digivolving] [When Attacking] [Once Per Turn] Suspend 1
+    of your opponent's Digimon. Then, if your opponent has no unsuspended Digimon,
+    unsuspend this Digimon."
+  InheritedEffectDiscription_JPN: 
+  InheritedEffectDiscription_ENG: '-'
+  SecurityEffectDiscription_JPN: 
+  SecurityEffectDiscription_ENG: '-'
+  CardEffectClassName: SaberLeomonAce_EX7_029
+  DP: 12000
+  rarity: 3
+  OverflowMemory: 4
+  CardID: EX7-029
+  MaxCountInDeck: 4