| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects.BT20
- {
- public class BT20_008 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Start of Your Main Phase
- if (timing == EffectTiming.OnStartMainPhase)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash a card, draw a card, gain 1 memory", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[Start of Your Main Phase] By trashing 1 card with [Huckmon] or [Sistermon] in its name or the [Royal Knight] trait in your hand, <Draw 1> and gain 1 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsOwnerTurn(card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
- CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelect);
- }
- bool CanSelect(CardSource cardSource)
- {
- return cardSource.ContainsCardName("Sistermon") || cardSource.ContainsCardName("Huckmon") || cardSource.HasRoyalKnightTraits;
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
- bool discarded = false;
- selectHandEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelect,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: true,
- canEndNotMax: false,
- isShowOpponent: true,
- selectCardCoroutine: null,
- afterSelectCardCoroutine: AfterSelectCardCoroutine,
- mode: SelectHandEffect.Mode.Discard,
- cardEffect: activateClass);
- IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
- {
- if (cardSources.Count == 1)
- {
- discarded = true;
- yield return null;
- }
- }
- selectHandEffect.SetUpCustomMessage("Select 1 card to discard.", "The opponent is selecting 1 card to discard.");
- selectHandEffect.SetUpCustomMessage_ShowCard("Discarded Card");
- yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
- if (discarded)
- {
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
- }
- }
- }
- #endregion
- #region ESS
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (CardEffectCommons.IsOwnerTurn(card))
- {
- return true;
- }
- }
- return false;
- }
- bool PermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
- {
- return true;
- }
- return false;
- }
- cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
- permanentCondition: PermanentCondition,
- changeValue: 1000,
- isInheritedEffect: true,
- card: card,
- condition: Condition,
- effectName: () => "Your Digimon gain DP +1000"));
- }
- #endregion
- return cardEffects;
- }
- }
- }
|