Преглед на файлове

EX9-001-002 (#132)

* EX9-001

* EX9-001 Actually

* Update EX9_001.cs
Michael8818 преди 1 година
родител
ревизия
5413cd2151
променени са 4 файла, в които са добавени 203 реда и са изтрити 0 реда
  1. 86 0
      Assets/CardEffect/EX9/Red/EX9_001.cs
  2. 11 0
      Assets/CardEffect/EX9/Red/EX9_001.cs.meta
  3. 95 0
      Assets/CardEffect/EX9/Red/EX9_002.cs
  4. 11 0
      Assets/CardEffect/EX9/Red/EX9_002.cs.meta

+ 86 - 0
Assets/CardEffect/EX9/Red/EX9_001.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.ConstrainedExecution;
+
+//Koromon
+namespace DCGO.CardEffects.EX9
+{
+    public class EX9_001 : CEntity_Effect
+    {
+        public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
+        {
+            List<ICardEffect> cardEffects = new List<ICardEffect>();
+
+            #region When Attacking - ESS
+
+            if (timing == EffectTiming.OnAllyAttack)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("Digivolve this digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Digivolve_EX9_001");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                    => "[When Attacking] [Once Per Turn] This Digimon with face-down digivolution cards may digivolve into a [Ver.1] trait Digimon card in the hand with the digivolution cost reduced by 1.";
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnAttack(hashtable, card))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanSelectCardCondition(CardSource digivolveTarget, Permanent digivolvingTarget)
+                {
+                    if (digivolveTarget.EqualsTraits("Ver.1"))
+                    {
+                        if (digivolveTarget.CanPlayCardTargetFrame(digivolvingTarget.PermanentFrame, true, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
+                           card.PermanentOfThisCard().HasFaceDownDigivolutionCards;
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                    if (selectedPermanent != null)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                targetPermanent: selectedPermanent,
+                                cardCondition: (cardSource) => CanSelectCardCondition(cardSource, selectedPermanent),
+                                payCost: true,
+                                reduceCostTuple: (reduceCost: 1, reduceCostCardCondition: null),
+                                fixedCostTuple: null,
+                                ignoreDigivolutionRequirementFixedCost: -1,
+                                isHand: true,
+                                activateClass: activateClass,
+                                successProcess: null));
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX9/Red/EX9_001.cs.meta

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

+ 95 - 0
Assets/CardEffect/EX9/Red/EX9_002.cs

@@ -0,0 +1,95 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.ConstrainedExecution;
+
+//Tsunomon
+namespace DCGO.CardEffects.EX9
+{
+    public class EX9_002 : 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("Digivolve this digimon", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
+                activateClass.SetIsInheritedEffect(true);
+                activateClass.SetHashString("Digivolve_EX9_002");
+                cardEffects.Add(activateClass);
+
+                string EffectDescription()
+                    => "[Your Turn] [Once Per Turn] When face-down cards are placed in this Digimon's digivolution cards, this Digimon may digivolve into a [Ver.2] trait Digimon card in the hand with the digivolution cost reduced by 1.";
+
+                bool PermanentCondition(Permanent permanent)
+                {
+                    return permanent == card.PermanentOfThisCard();
+                }
+
+                bool CardCondition(CardSource source)
+                {
+                    return source.IsFlipped;
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
+                    {
+                        if (CardEffectCommons.CanTriggerOnAddDigivolutionCard(hashtable, PermanentCondition, null, CardCondition))
+                        {
+                            return true;
+                        }
+                    }
+                    return false;
+                }
+
+                bool CanSelectCardCondition(CardSource digivolveTarget, Permanent digivolvingTarget)
+                {
+                    if (digivolveTarget.EqualsTraits("Ver.2"))
+                    {
+                        if (digivolveTarget.CanPlayCardTargetFrame(digivolvingTarget.PermanentFrame, true, activateClass))
+                        {
+                            return true;
+                        }
+                    }
+
+                    return false;
+                }
+
+                bool CanActivateCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
+                }
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    Permanent selectedPermanent = card.PermanentOfThisCard();
+
+                    if (selectedPermanent != null)
+                    {
+                        yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                                targetPermanent: selectedPermanent,
+                                cardCondition: (cardSource) => CanSelectCardCondition(cardSource, selectedPermanent),
+                                payCost: true,
+                                reduceCostTuple: (reduceCost: 1, reduceCostCardCondition: null),
+                                fixedCostTuple: null,
+                                ignoreDigivolutionRequirementFixedCost: -1,
+                                isHand: true,
+                                activateClass: activateClass,
+                                successProcess: null));
+                    }
+                }
+            }
+
+            #endregion
+
+            return cardEffects;
+        }
+    }
+}

+ 11 - 0
Assets/CardEffect/EX9/Red/EX9_002.cs.meta

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