| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System.Collections;
- using System.Collections.Generic;
- // Gasamon
- namespace DCGO.CardEffects.EX12
- {
- public class EX12_020 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternative Digivolve Condition
- if (timing == EffectTiming.None)
- {
- static bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.EqualsTraits("Shambala");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 0, false, card, null, level: 2));
- }
- #endregion
- #region Your Turn
- if (timing == EffectTiming.None)
- {
- bool Condition()
- {
- return CardEffectCommons.IsOwnerTurn(card)
- && CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent == card.PermanentOfThisCard();
- }
- bool CardSourceCondition(CardSource cardSource)
- {
- return cardSource.EqualsTraits("TB");
- }
- bool RootCondition(SelectCardEffect.Root root)
- {
- return true;
- }
- cardEffects.Add(CardEffectFactory.ChangeDigivolutionCostStaticEffect(
- changeValue: -1,
- permanentCondition: PermanentCondition,
- cardCondition: CardSourceCondition,
- rootCondition: RootCondition,
- isInheritedEffect: false,
- card: card,
- condition: Condition,
- setFixedCost: false));
- }
- #endregion
- #region Inherited
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("If you have 7 or fewer cards in hand, <Draw 1>.", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("EX12_020_Inherited");
- cardEffects.Add(activateClass);
- string EffectDescription()
- => "[When Attacking] [Once Per Turn] If your hand has 7 or fewer cards, <Draw 1>.";
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimonTrigger(card, activateClass)
- && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimonActivate(card, activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- bool Used = false;
- if (card.Owner.HandCards.Count <= 7)
- {
- Used = true;
- yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
- }
- if (!Used)
- {
- activateClass.RemoveUse();
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|