Procházet zdrojové kódy

togemon implemented

dp101428 před 1 rokem
rodič
revize
e8f3d2b235

+ 8 - 0
Assets/CardBaseEntity/ST21.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c3fd36bac077a6742959d6e61e952e6d
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/CardBaseEntity/ST21/Green.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4e06a31f88d3d7e4cb084d87ccac7bba
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/CardBaseEntity/ST21/Green/Digimon.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a6c86ea4128457f42901781f267e9106
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 0
Assets/CardBaseEntity/ST21/Green/Digimon/ST21_08.asset

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db9cef6581d2352cf9602725189b379405b2c8880c0a95d9aa7e122a2c356441
+size 918

+ 8 - 0
Assets/CardBaseEntity/ST21/Green/Digimon/ST21_08.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f3ed079783027f14dbe1f7b306b285be
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 11400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 104 - 6
Assets/CardEffect/ST21/Green/ST21_08.cs

@@ -1,6 +1,8 @@
 using System.Collections;
 using System.Collections.Generic;
 
+//st21-08 Togemon
+//Code largely copied from st20 birdramon, so if one has a problem, check the other to make sure it's not also there
 namespace DCGO.CardEffects.ST21
 {
     public class ST21_08 : CEntity_Effect
@@ -9,33 +11,129 @@ namespace DCGO.CardEffects.ST21
         {
             List<ICardEffect> cardEffects = new List<ICardEffect>();
 
+            #region Alternate Digivolution Requirement
             if (timing == EffectTiming.None)
+            {
+                static bool PermanentCondition(Permanent targetPermanent)
+                {
+                    return targetPermanent.TopCard.EqualsTraits("ADVENTURE") && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 3;
+                }
+
+                cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
+            }
+            #endregion
+
+            #region On-Play/When-Digivolving Shared
+            bool CanActivateCondition(Hashtable hashtable)
+            {
+                if (CardEffectCommons.IsExistOnBattleArea(card))
+                {
+                    List<CardSource> tamerCards = new List<CardSource>();
+
+                    foreach (Permanent permanent in card.Owner.GetBattleAreaPermanents())
+                    {
+                        if (permanent.IsTamer && permanent.TopCard.EqualsTraits("ADVENTURE"))
+                        {
+                            tamerCards.Add(permanent.TopCard);
+                        }
+                    }
+
+                    return Combinations.GetDifferenetColorCardCount(tamerCards) >= 3;
+                }
+                return false;
+            }
+
+            #endregion
+
+            #region On Play
+            if (timing == EffectTiming.OnEnterFieldAnyone)
+            {
+                ActivateClass activateClass = new ActivateClass();
+                activateClass.SetUpICardEffect("If your Tamers with the [ADVENTURE] trait have 3 or more total colors, this Digimon may digivolve into a Digimon card with the [ADVENTURE] trait in the hand without paying the cost.", CanUseCondition, card);
+                activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
+                cardEffects.Add(activateClass);
+
+                string EffectDiscription()
+                {
+                    return "[On Play] If your Tamers with the [ADVENTURE] trait have 3 or more total colors, this Digimon may digivolve into a Digimon card with the [ADVENTURE] trait in the hand without paying the cost.";
+                }
+
+                bool CanUseCondition(Hashtable hashtable)
+                {
+                    return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
+                }
+
+
+                bool CanDigivolveIntoCardCondition(CardSource cardSource)
+                {
+                    return cardSource.IsDigimon && cardSource.EqualsTraits("ADVENTURE");
+                }
+
+
+                IEnumerator ActivateCoroutine(Hashtable hashtable)
+                {
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            cardCondition: CanDigivolveIntoCardCondition,
+                            payCost: false,
+                            reduceCostTuple: null,
+                            fixedCostTuple: null,
+                            ignoreDigivolutionRequirementFixedCost: -1,
+                            isHand: true,
+                            activateClass: activateClass,
+                            successProcess: null));
+                }
+            }
+            #endregion
+
+            #region When Digivolving
+            if (timing == EffectTiming.OnEnterFieldAnyone)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("", CanUseCondition, card);
+                activateClass.SetUpICardEffect("If your Tamers with the [ADVENTURE] trait have 3 or more total colors, this Digimon may digivolve into a Digimon card with the [ADVENTURE] trait in the hand without paying the cost.", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
                 cardEffects.Add(activateClass);
 
                 string EffectDiscription()
                 {
-                    return "";
+                    return "[When Digivolving] If your Tamers with the [ADVENTURE] trait have 3 or more total colors, this Digimon may digivolve into a Digimon card with the [ADVENTURE] trait in the hand without paying the cost.";
                 }
 
                 bool CanUseCondition(Hashtable hashtable)
                 {
-                    return true;
+                    return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
                 }
 
-                bool CanActivateCondition(Hashtable hashtable)
+                bool CanDigivolveIntoCardCondition(CardSource cardSource)
                 {
-                    return true;
+                    return cardSource.IsDigimon && cardSource.EqualsTraits("ADVENTURE");
                 }
 
+
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    yield return null;
+                    yield return ContinuousController.instance.StartCoroutine(
+                        CardEffectCommons.DigivolveIntoHandOrTrashCard(
+                            targetPermanent: card.PermanentOfThisCard(),
+                            cardCondition: CanDigivolveIntoCardCondition,
+                            payCost: false,
+                            reduceCostTuple: null,
+                            fixedCostTuple: null,
+                            ignoreDigivolutionRequirementFixedCost: -1,
+                            isHand: true,
+                            activateClass: activateClass,
+                            successProcess: null));
                 }
             }
+            #endregion
+
+            #region All Turn - ESS
+            if (timing == EffectTiming.None)
+            {
+                cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: null));
+            }
+            #endregion
 
             return cardEffects;
         }