| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects
- {
- public class BT20_034 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alt Digivovle Cost
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.IsLevel4 &&
- (targetPermanent.TopCard.HasText("Pulsemon") ||
- targetPermanent.TopCard.HasSeekersTraits);
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
- card: card, condition: null));
- }
- #endregion
- #region Fortitude
- if (timing == EffectTiming.OnDestroyedAnyone)
- {
- cardEffects.Add(CardEffectFactory.FortitudeSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.OnAddDigivolutionCards)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] When Tamer cards are placed in this Digimon's digivolution cards, 1 of your opponent's Digimon can't activate [When Digivolving] effects until the end of their turn.";
- }
- bool IsOpponentsDigimon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.CanTriggerOnAddDigivolutionCard(
- hashtable: hashtable,
- permanentCondition: permanent => permanent == card.PermanentOfThisCard(),
- cardEffectCondition: null,
- cardCondition: cardSource =>
- cardSource.IsTamer);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: IsOpponentsDigimon,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will disable effects.", "The opponent is selecting 1 Digimon that will disable effects.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- if (permanent != null)
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- DisableEffectClass invalidationClass = new DisableEffectClass();
- invalidationClass.SetUpICardEffect("Ignore [When Digivolving] Effect", CanUseCondition1, card);
- invalidationClass.SetUpDisableEffectClass(DisableCondition: InvalidateCondition);
- selectedPermanent.UntilOwnerTurnEndEffects.Add((_timing) => invalidationClass);
- if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
- {
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
- }
- bool CanUseCondition1(Hashtable hashtable)
- {
- if (selectedPermanent.TopCard != null)
- {
- if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass))
- {
- return true;
- }
- }
- return false;
- }
- bool InvalidateCondition(ICardEffect cardEffect)
- {
- if (cardEffect != null)
- {
- if (cardEffect is ActivateICardEffect)
- {
- if (cardEffect.EffectSourceCard != null)
- {
- if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(cardEffect.EffectSourceCard.PermanentOfThisCard(), card))
- {
- if (cardEffect.EffectSourceCard.PermanentOfThisCard() == selectedPermanent)
- {
- if (!cardEffect.EffectSourceCard.PermanentOfThisCard().TopCard.CanNotBeAffected(invalidationClass))
- {
- if (cardEffect.IsWhenDigivolving)
- {
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
- }
- }
- }
- #endregion
- #region ESS
- if (timing == EffectTiming.OnEndBattle)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash top security", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
- activateClass.SetHashString("TrashSecurity_BT20-034");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[All Turns] [Once Per Turn] When this Digimon deletes your opponent's Digimon in battle, trash their top security card.";
- }
- bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
- bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.IsOwnerTurn(card) &&
- CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable,
- winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: false);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
- player: card.Owner.Enemy,
- destroySecurityCount: 1,
- cardEffect: activateClass,
- fromTop: true).DestroySecurity());
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|