| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- // Elizamon
- namespace DCGO.CardEffects.BT24
- {
- public class BT24_008 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash 1 [Reptile], [Dragonkin] or [LIBERATOR] trait to <Draw 2>", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return "[On Play] By trashing 1 card with the [Reptile], [Dragonkin] or [LIBERATOR] trait in your hand, <Draw 2>.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- bool HasARequiredTrait(CardSource cardSource)
- {
- return (cardSource.EqualsTraits("Reptile")
- || cardSource.EqualsTraits("Dragonkin")
- || cardSource.EqualsTraits("LIBERATOR"));
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
- && CardEffectCommons.HasMatchConditionOwnersHand(card, HasARequiredTrait);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- selectHandEffect.SetUp(
- canTargetCondition: HasARequiredTrait,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- canNoSelect: true,
- selectCardCoroutine: null,
- afterSelectCardCoroutine: AfterSelectCardCoroutine,
- maxCount: 1,
- canEndNotMax: false,
- isShowOpponent: true,
- mode: SelectHandEffect.Mode.Discard,
- selectPlayer: card.Owner,
- cardEffect: activateClass);
- selectHandEffect.SetUpCustomMessage("Select 1 card with the [Reptile], [Dragonkin] or [LIBERATOR] trait to discard.",
- "The opponent is selecting 1 card with the [Reptile], [Dragonkin] or [LIBERATOR] trait to discard.");
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
- {
- if (cardSources.Count > 0)
- {
- yield return ContinuousController.instance.StartCoroutine(
- new DrawClass(card.Owner, 2, activateClass).Draw());
- }
- }
- }
- }
- #endregion
- #region Your Turn - ESS
- if (timing == EffectTiming.OnLoseSecurity)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Gain 1 memory", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("GainMemory_BT24_008");
- cardEffects.Add(activateClass);
- string EffectDescription()
- => "[Your Turn] [Once Per Turn] When your opponent's security stack is removed from, gain 1 memory.";
- bool CanUseCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, PlayerCondition))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- return true;
- }
- }
- }
- return false;
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- return true;
- }
- return false;
- }
- bool PlayerCondition(Player player)
- {
- if (player == card.Owner.Enemy)
- {
- return true;
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|