EX5_006.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. public class EX5_006 : CEntity_Effect
  4. {
  5. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  6. {
  7. List<ICardEffect> cardEffects = new List<ICardEffect>();
  8. if (timing == EffectTiming.OnEnterFieldAnyone)
  9. {
  10. ActivateClass activateClass = new ActivateClass();
  11. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  12. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  13. activateClass.SetHashString("Draw1_EX5_002");
  14. activateClass.SetIsInheritedEffect(true);
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[Your Turn] [Once Per Turn] When an effect plays one of your Digimon, <Draw 1> (Draw 1 card from your deck).";
  19. }
  20. bool PermanentCondition(Permanent permanent)
  21. {
  22. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleArea(card))
  27. {
  28. if (CardEffectCommons.IsOwnerTurn(card))
  29. {
  30. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  31. {
  32. if (CardEffectCommons.IsByEffect(hashtable, null))
  33. {
  34. return true;
  35. }
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanActivateCondition(Hashtable hashtable)
  42. {
  43. if (CardEffectCommons.IsExistOnBattleArea(card))
  44. {
  45. return true;
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  52. }
  53. }
  54. return cardEffects;
  55. }
  56. }