| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- using System.Collections;
- using System.Collections.Generic;
- using System;
- namespace DCGO.CardEffects.EX6
- {
- public class EX6_028 : 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.ContainsCardName("MagnaAngemon");
- }
-
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 3,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
-
- #endregion
-
- #region Ace - Blast Digivolve
-
- if (timing == EffectTiming.OnCounterTiming)
- {
- cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
- }
-
- #endregion
-
- #region On Play
-
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
- EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[On Play] Trigger <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
-
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- if (card.Owner.CanAddSecurity(activateClass))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(
- new IRecovery(card.Owner, 1, activateClass).Recovery());
- }
- }
-
- #endregion
-
- #region When Digivolving
-
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Recovery +1 (Deck)", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
- EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] Trigger <Recovery +1 (Deck)>. (Place the top card of your deck on top of your security stack.)";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
-
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.Owner.LibraryCards.Count >= 1)
- {
- if (card.Owner.CanAddSecurity(activateClass))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(
- new IRecovery(card.Owner, 1, activateClass).Recovery());
- }
- }
-
- #endregion
-
- #region All Turns
-
- if (timing == EffectTiming.OnAddSecurity)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Return 1 of your opponent's Digimon to the hand", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
- activateClass.SetHashString("ReturnToHand_EX6_028");
- cardEffects.Add(activateClass);
-
- string EffectDescription()
- {
- return
- "[All Turns] [Once per Turn] When a card is added to your security stack, return 1 of your opponent's Digimon with as high or lower a level as the number of your security cards to the hand.";
- }
-
- bool CanSelectOpponentPermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
- {
- if (permanent.Level <= card.Owner.SecurityCards.Count)
- {
- if (permanent.TopCard.HasLevel)
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerWhenAddSecurity(hashtable, player => player == card.Owner))
- {
- return true;
- }
- }
-
- return false;
- }
-
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
-
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
- {
- int maxCount = Math.Min(1,
- CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
-
- SelectPermanentEffect selectPermanentEffect =
- GManager.instance.GetComponent<SelectPermanentEffect>();
-
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectOpponentPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Bounce,
- cardEffect: activateClass);
-
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- }
-
- #endregion
-
- return cardEffects;
- }
- }
- }
|