| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Cyclonemon
- namespace DCGO.CardEffects.BT21
- {
- public class BT21_015 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Security
- if (timing == EffectTiming.SecuritySkill)
- {
- cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
- }
- #endregion
- #region On Play / When Digivolving Shared
- IEnumerator ActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
- {
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
- && permanent.DP <= card.Owner.MaxDP_DeleteEffect(4000, activateClass);
- }
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: maxCount,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Destroy,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 digimon with up to 4000 DP", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => ActivateCoroutine(hashtable, activateClass), -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- => "[On Play] Delete 1 of your opponent's Digimon with 4000 DP or less.";
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerOnPlay(hashtable, card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 digimon with up to 4000 DP", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hashtable => ActivateCoroutine(hashtable, activateClass), -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- => "[When Digivolving] Delete 1 of your opponent's Digimon with 4000 DP or less.";
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
- {
- return true;
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- }
- #endregion
- #region ESS
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- return true;
- }
- return false;
- }
- cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|