|
|
@@ -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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|