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

Add level 2 and 3 black cardEffects

Andrej Erdelsky 2 лет назад
Родитель
Сommit
75742eb21d

+ 58 - 0
Assets/CardEffect/EX7/Black/Gotsumon_EX7_038.cs

@@ -0,0 +1,58 @@
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.EX7
+{
+    public class Gotsumon_EX7_038 : 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.IsLevel2 && targetPermanent.TopCard.ContainsTraits("NSp");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region Blocker
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
+                    isInheritedEffect: false,
+                    card: card,
+                    condition: null));
+            }
+
+            #endregion
+
+            #region Reboot - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: null));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX7/Black/Gotsumon_EX7_038.cs.meta

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

+ 133 - 0
Assets/CardEffect/EX7/Black/Jazamon_EX7_039.cs

@@ -0,0 +1,133 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.EX7
+{
+    public class Jazamon_EX7_039 : 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("Trash 1 [Rock Dragon]/[Earth Dragon], <Draw 1> and gain 1 memory", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Start of Your Main Phase] By trashing 1 card with the [Rock Dragon]/[Earth Dragon] trait from your hand, <Draw 1> and gain 1 memory.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.IsOwnerTurn(card);
+                }
+
+                bool HasDragonInTrait(CardSource cardSource)
+                {
+                    return cardSource.ContainsTraits("Rock Dragon") ||
+                           cardSource.ContainsTraits("Earth Dragon");
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.Owner.HandCards.Some(HasDragonInTrait);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                    selectHandEffect.SetUp(
+                        canTargetCondition: HasDragonInTrait,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: true,
+                        selectCardCoroutine: null,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                        maxCount: 1,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectHandEffect.Mode.Discard,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    selectHandEffect.SetUpCustomMessage("Select 1 card with [Rock Dragon]/[Earth Dragon] trait to discard.",
+                        "The opponent is selecting 1 card with [Rock Dragon]/[Earth Dragon] trait to discard.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+
+                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                    {
+                        if (cardSources.Count > 0)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                new DrawClass(card.Owner, 1, activateClass).Draw());
+
+                            yield return ContinuousController.instance.StartCoroutine(
+                                card.Owner.AddMemory(1, activateClass));
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Rule Text
+
+            if (timing == EffectTiming.None)
+            {
+                ChangeTraitsClass changeTraitsClass = new ChangeTraitsClass();
+                changeTraitsClass.SetUpICardEffect("Trait: Has the [Machine Dragon] type", CanUseCondition, card);
+                changeTraitsClass.SetUpChangeTraitsClass(changeeTraits: ChangeTraits);
+                cardEffects.Add(changeTraitsClass);
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return true;
+                }
+
+                List<string> ChangeTraits(CardSource cardSource, List<string> cardTraits)
+                {
+                    if (cardSource == card)
+                    {
+                        cardTraits.Add("Machine Dragon");
+                    }
+
+                    return cardTraits;
+                }
+            }
+
+            #endregion
+
+            #region Opponent's Turn - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                bool Condition()
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.IsOpponentTurn(card);
+                }
+
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
+                    changeValue: 2000,
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: Condition));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX7/Black/Jazamon_EX7_039.cs.meta

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

+ 59 - 0
Assets/CardEffect/EX7/Black/Kapurimon_EX7_005.cs

@@ -0,0 +1,59 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.EX7
+{
+    public class Kapurimon_EX7_005 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region Your Turn - ESS
+
+            if (timing == EffectTiming.OnAddDigivolutionCards)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Gain 1 Memory", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
+                    EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Gain1Memory_EX7_005");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return
+                        "[Your Turn] [Once Per Turn] When an effect places an Option card with the [Three Musketeers] trait in this Digimon's digivolution cards, gain 1 memory.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card) &&
+                           CardEffectCommons.IsOwnerTurn(card) &&
+                           CardEffectCommons.CanTriggerOnAddDigivolutionCard(
+                               hashtable: hashtable,
+                               permanentCondition: permanent => permanent == card.PermanentOfThisCard(),
+                               cardEffectCondition: cardEffect => cardEffect.EffectSourceCard != null,
+                               cardCondition: cardSource => 
+                                   cardSource.IsOption &&
+                                   cardSource.ContainsTraits("Three Musketeers"));
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleArea(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX7/Black/Kapurimon_EX7_005.cs.meta

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

+ 113 - 0
Assets/CardEffect/EX7/Black/ToyAgumon_EX7_040.cs

@@ -0,0 +1,113 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace DCGO.CardEffects.EX7
+{
+    public class ToyAgumon_EX7_040 : 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.IsLevel2 && targetPermanent.TopCard.ContainsTraits("Three Musketeers");
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
+                    permanentCondition: PermanentCondition,
+                    digivolutionCost: 0,
+                    ignoreDigivolutionRequirement: false,
+                    card: card,
+                    condition: null)
+                );
+            }
+
+            #endregion
+
+            #region On Play
+
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Trash 1 [Three Musketeers], <Draw 2>", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                {
+                    return "[On Play] By trashing 1 card with the [Three Musketeers] trait in your hand, <Draw 2>.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+                bool HasThreeMusketeersInTrait(CardSource cardSource)
+                {
+                    return cardSource.ContainsTraits("Three Musketeers");
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.Owner.HandCards.Some(HasThreeMusketeersInTrait);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
+
+                    selectHandEffect.SetUp(
+                        canTargetCondition: HasThreeMusketeersInTrait,
+                        canTargetCondition_ByPreSelecetedList: null,
+                        canEndSelectCondition: null,
+                        canNoSelect: true,
+                        selectCardCoroutine: null,
+                        afterSelectCardCoroutine: AfterSelectCardCoroutine,
+                        maxCount: 1,
+                        canEndNotMax: false,
+                        isShowOpponent: true,
+                        mode: SelectHandEffect.Mode.Discard,
+                        selectPlayer: card.Owner,
+                        cardEffect: activateClass);
+
+                    selectHandEffect.SetUpCustomMessage("Select 1 card with [Three Musketeers] trait to discard.",
+                        "The opponent is selecting 1 card with [Three Musketeers] trait to discard.");
+
+                    yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
+
+                    IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
+                    {
+                        if (cardSources.Count > 0)
+                        {
+                            yield return ContinuousController.instance.StartCoroutine(
+                                new DrawClass(card.Owner, 2, activateClass).Draw());
+                        }
+                    }
+                }
+            }
+
+            #endregion
+
+            #region Reboot - ESS
+
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(
+                    isInheritedEffect: true,
+                    card: card,
+                    condition: null));
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX7/Black/ToyAgumon_EX7_040.cs.meta

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

+ 6 - 0
Assets/Scripts/CardSource.cs

@@ -2152,6 +2152,12 @@ public class CardSource : MonoBehaviour
     public bool HasLevel => _cEntity_Base == null || _cEntity_Base.HasLevel;
     #endregion
     
+    #region whether this card is level 2
+    
+    public bool IsLevel2 => (_cEntity_Base == null || _cEntity_Base.HasLevel) && _cEntity_Base.Level == 2;
+    
+    #endregion
+    
     #region whether this card is level 3
     
     public bool IsLevel3 => (_cEntity_Base == null || _cEntity_Base.HasLevel) && _cEntity_Base.Level == 3;