| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- // Wolkenapalm
- namespace DCGO.CardEffects.BT23
- {
- public class BT23_091 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Ignore Color Requirment
- if (timing == EffectTiming.None)
- {
- IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
- ignoreColorConditionClass.SetUpICardEffect("Ignore color requirements", CanUseCondition, card);
- ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
- cardEffects.Add(ignoreColorConditionClass);
- bool HasAppmonTrait(Permanent permanent)
- {
- if (CardEffectCommons.IsOwnerPermanent(permanent, card))
- {
- if (permanent.TopCard.HasCSTraits)
- {
- if (permanent.IsDigimon || permanent.IsTamer)
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.HasMatchConditionPermanent(HasAppmonTrait, true);
- }
- bool CardCondition(CardSource cardSource)
- {
- return cardSource == card;
- }
- }
- #endregion
- #region Main/YT/Security Shared
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
- && CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy, null);
- }
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
- 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);
- selectPermanentEffect.SetUpCustomMessage("Select 1 digimon to delete", "Your opponent is choosing 1 digimon to delete");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- }
- }
- #endregion
- #region Main
- if (timing == EffectTiming.OptionSkill)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 digimon with lowest DP, then place in battle area", CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Main] Delete 1 of your opponent's Digimon with the lowest DP. Then, place this card in the battle area.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(SharedActivateCoroutine(hashtable, activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
- }
- }
- #endregion
- #region Your Turn - Delay
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 digimon with lowest DP", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, hash => SharedActivateCoroutine(hash, activateClass), -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Your Turn] When one of your [CS] trait Digimon attacks <Delay>, Delete 1 of your opponent's Digimon with the lowest DP.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.CanDeclareOptionDelayEffect(card)
- && CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.IsOwnerTurn(card);
- }
- bool PermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
- && permanent.TopCard.HasCSTraits;
- }
- }
- #endregion
- #region Security
- if (timing == EffectTiming.SecuritySkill)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Delete 1 digimon with lowest DP, then place in battle area", CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Security] Delete 1 of your opponent's Digimon with the lowest DP. Then, place this card in the battle area.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(SharedActivateCoroutine(hashtable, activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|