| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Guardromon
- namespace DCGO.CardEffects.BT25
- {
- public class BT25_066 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternate Digivolution Requirement
- if (timing == EffectTiming.None)
- {
- static bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.HasTSTraits;
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 3));
- }
- #endregion
- #region Blocker
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.WhenRemoveField)
- {
- List<Permanent> removedPermanents = new List<Permanent>();
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash a linked card to prevent this digimon from leaving", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
- activateClass.SetIsSkippable(true);
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[All Turns] When this Digimon would leave the battle area, by trashing 1 of its link cards, it doesn't leave.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && !card.PermanentOfThisCard().HasNoLinkCards;
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- Permanent thisPermanent = card.PermanentOfThisCard();
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
- selectCardEffect.SetUp(
- canTargetCondition: _ => true,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: () => true,
- selectCardCoroutine: null,
- afterSelectCardCoroutine: SelectCardCoroutine,
- message: "Select 1 link card to trash.",
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectCardEffect.Mode.Discard,
- root: SelectCardEffect.Root.LinkedCards,
- customRootCardList: card.PermanentOfThisCard().LinkedCards,
- canLookReverseCard: true,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectCardEffect.SetUpCustomMessage("Select 1 link card to trash.", "The opponent is selecting 1 link card to trash.");
- yield return StartCoroutine(selectCardEffect.Activate());
- IEnumerator SelectCardCoroutine(List<CardSource> cardSources)
- {
- if (cardSources.Count > 0)
- {
- thisPermanent.willBeRemoveField = false;
- thisPermanent.HideHandBounceEffect();
- thisPermanent.HideDeckBounceEffect();
- thisPermanent.HideWillRemoveFieldEffect();
- thisPermanent.HideDeleteEffect();
- }
- yield return null;
- }
- }
- }
- #endregion
- #region All Turns - Inherited Effect
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return true;
- }
- cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
- changeValue: 1000,
- isInheritedEffect: true,
- card: card,
- condition: Condition));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|