| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- // Garurumon
- namespace DCGO.CardEffects.EX9
- {
- public class EX9_017 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternative Digivolution Condition
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- if (targetPermanent.TopCard.IsLevel3)
- {
- if (targetPermanent.TopCard.EqualsTraits("DM"))
- {
- return true;
- }
- }
- return false;
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 2,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
- #endregion
- #region Training
- if (timing == EffectTiming.OnDeclaration)
- {
- cardEffects.Add(CardEffectFactory.TrainingEffect(card: card));
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Place 1 digimon in hand as source, to trash digimon sources", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[On Play] By placing 1 card in your hand face down as this Digimon's bottom digivolution card, for each of its face-down digivolution cards, trash any 1 digivolution card from your opponent's Digimon.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectHandCardCondition);
- }
- bool CanSelectHandCardCondition(CardSource cardSource)
- {
- return true;
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
- permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1;
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return !cardSource.CanNotTrashFromDigivolutionCards(activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- CardSource selectedCard = null;
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectHandCardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Custom,
- cardEffect: activateClass);
- selectHandEffect.SetUpCustomMessage("Select 1 card to place face-down on bottom of digivolution cards.",
- "The opponent is selecting 1 card to place face-down on bottom of digivolution cards.");
- selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCard = cardSource;
- yield return null;
- }
- if (selectedCard)
- {
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddExecutingCard(selectedCard));
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
- .AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass, isFacedown: true));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
- permanentCondition: CanSelectPermanentCondition,
- cardCondition: CanSelectCardCondition,
- maxCount: card.PermanentOfThisCard().DigivolutionCards.Filter(source => source.IsFlipped).Count,
- canNoTrash: false,
- isFromOnly1Permanent: false,
- activateClass: activateClass
- ));
- }
- }
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Place 1 digimon in hand as source, to trash digimon sources", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] By placing 1 card in your hand face down as this Digimon's bottom digivolution card, for each of its face-down digivolution cards, trash any 1 digivolution card from your opponent's Digimon.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectHandCardCondition);
- }
- bool CanSelectHandCardCondition(CardSource cardSource)
- {
- return true;
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
- permanent.DigivolutionCards.Count(CanSelectCardCondition) >= 1;
- }
- bool CanSelectCardCondition(CardSource cardSource)
- {
- return !cardSource.CanNotTrashFromDigivolutionCards(activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- CardSource selectedCard = null;
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectHandCardCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: SelectCardCoroutine,
- afterSelectCardCoroutine: null,
- mode: SelectHandEffect.Mode.Custom,
- cardEffect: activateClass);
- selectHandEffect.SetUpCustomMessage("Select 1 card to place face-down on bottom of digivolution cards.",
- "The opponent is selecting 1 card to place face-down on bottom of digivolution cards.");
- selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- IEnumerator SelectCardCoroutine(CardSource cardSource)
- {
- selectedCard = cardSource;
- yield return null;
- }
- if (selectedCard)
- {
- yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddExecutingCard(selectedCard));
- yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
- .AddDigivolutionCardsBottom(new List<CardSource>() { selectedCard }, activateClass, isFacedown: true));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SelectTrashDigivolutionCards(
- permanentCondition: CanSelectPermanentCondition,
- cardCondition: CanSelectCardCondition,
- maxCount: card.PermanentOfThisCard().DigivolutionCards.Filter(source => source.IsFlipped).Count,
- canNoTrash: false,
- isFromOnly1Permanent: false,
- activateClass: activateClass
- ));
- }
- }
- }
- #endregion
- #region ESS - Jamming
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|