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