| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.ST19
- {
- public class ST19_13 : 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.IsLevel5 &&
- (targetPermanent.TopCard.ContainsCardName("Monzaemon") || targetPermanent.TopCard.ContainsCardName("Numemon"));
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 3,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
- #endregion
- #region Armor Purge
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
- }
- #endregion
- #region On Play/ When Digivolving Shared
- bool CanSelectCardSharedCondition(CardSource cardSource)
- {
- return cardSource.IsDigimon &&
- cardSource.HasLevel && cardSource.Level <= 5 &&
- (cardSource.ContainsTraits("Puppet") || cardSource.ContainsCardName("Numemon"));
- }
- bool CanActivateSharedCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardSharedCondition);
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Place a card under this Digimon to <Recovery +1 (Deck)>.", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, true, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[On Play] By placing 1 level 5 or lower card with [Puppet] trait or with [Numemon] in its name from your trash as this Digimon's bottom digivolution card, <Recovery +1 (Deck)>.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- bool added = false;
- List<CardSource> selectedCards = new List<CardSource>();
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: CanSelectCardSharedCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 card to place on bottom of digivolution cards.",
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Trash,
- customRootCardList: null,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
- selectCardEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.",
- "The opponent is selecting 1 card to place on bottom of digivolution cards.");
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCards.Add(cardSource);
- yield return null;
- }
- if (selectedCards.Count >= 1)
- {
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
- .AddDigivolutionCardsBottom(selectedCards, activateClass));
- added = true;
- }
- if (added)
- {
- 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("Place a card under this Digimon to <Recovery +1 (Deck)>.", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, true, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] By placing 1 level 5 or lower card with [Puppet] trait or with [Numemon] in its name from your trash as this Digimon's bottom digivolution card, <Recovery +1 (Deck)>.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- bool added = false;
- List<CardSource> selectedCards = new List<CardSource>();
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: CanSelectCardSharedCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- message: "Select 1 card to place on bottom of digivolution cards.",
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Custom,
- root: SelectCardEffect.Root.Trash,
- customRootCardList: null,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
- selectCardEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.",
- "The opponent is selecting 1 card to place on bottom of digivolution cards.");
- yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCards.Add(cardSource);
- yield return null;
- }
- if (selectedCards.Count >= 1)
- {
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
- .AddDigivolutionCardsBottom(selectedCards, activateClass));
- added = true;
- }
- if (added)
- {
- yield return ContinuousController.instance.StartCoroutine(new IRecovery(card.Owner, 1, activateClass).Recovery());
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|