ST19_01.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST19
  4. {
  5. public class ST19_01 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region When Attacking - ESS
  11. if (timing == EffectTiming.OnAllyAttack)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  16. activateClass.SetIsInheritedEffect(true);
  17. activateClass.SetHashString("Draw_ST19_01");
  18. cardEffects.Add(activateClass);
  19. string EffectDescription()
  20. {
  21. return "[When Attacking] (Once Per Turn) If you have another Digimon, <Draw 1>.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  26. }
  27. bool CanActivateCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  30. CardEffectCommons.HasMatchConditionOwnersPermanent(card,
  31. permanent => permanent.IsDigimon && permanent != card.PermanentOfThisCard());
  32. }
  33. IEnumerator ActivateCoroutine(Hashtable hashtable)
  34. {
  35. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  36. }
  37. }
  38. #endregion
  39. return cardEffects;
  40. }
  41. }
  42. }