EX3_027.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX3
  4. {
  5. public class EX3_027 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetHashString("Draw1_EX3_027");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Your Turn][Once Per Turn] When you play a Digimon with [Four Great Dragons] in its traits or place [Trial of the Four Great Dragons] in your battle area, <Draw 1>.";
  21. }
  22. bool PermanentCondition(Permanent permanent)
  23. {
  24. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  25. {
  26. if (permanent.IsDigimon)
  27. {
  28. if (permanent.TopCard.CardTraits.Contains("Four Great Dragons") || permanent.TopCard.CardTraits.Contains("FourGreatDragons"))
  29. {
  30. return true;
  31. }
  32. }
  33. if (permanent.TopCard.CardNames.Contains("Trial of the Four Great Dragons") || permanent.TopCard.CardNames.Contains("TrialoftheFourGreatDragons"))
  34. {
  35. return true;
  36. }
  37. }
  38. return false;
  39. }
  40. bool CanUseCondition(Hashtable hashtable)
  41. {
  42. if (CardEffectCommons.IsExistOnBattleArea(card))
  43. {
  44. if (CardEffectCommons.IsOwnerTurn(card))
  45. {
  46. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  47. {
  48. return true;
  49. }
  50. }
  51. }
  52. return false;
  53. }
  54. bool CanActivateCondition(Hashtable hashtable)
  55. {
  56. if (CardEffectCommons.IsExistOnBattleArea(card))
  57. {
  58. return true;
  59. }
  60. return false;
  61. }
  62. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  63. {
  64. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  65. }
  66. }
  67. return cardEffects;
  68. }
  69. }
  70. }