P_188.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. //P_188 Demiveemon
  4. namespace DCGO.CardEffects.P
  5. {
  6. public class P_188 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Inherit
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  17. activateClass.SetIsInheritedEffect(true);
  18. activateClass.SetHashString("Draw1_P_188");
  19. cardEffects.Add(activateClass);
  20. string EffectDescription()
  21. {
  22. return "[Your Turn][Once Per Turn] When any of your blue Tamers are played, <Draw 1>.";
  23. }
  24. bool PermanentCondition(Permanent permanent)
  25. {
  26. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  27. {
  28. if (permanent.TopCard.CardColors.Contains(CardColor.Blue))
  29. {
  30. if (permanent.IsTamer)
  31. {
  32. return true;
  33. }
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanUseCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (CardEffectCommons.IsOwnerTurn(card))
  43. {
  44. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  45. {
  46. return true;
  47. }
  48. }
  49. }
  50. return false;
  51. }
  52. bool CanActivateCondition(Hashtable hashtable)
  53. {
  54. if (CardEffectCommons.IsExistOnBattleArea(card))
  55. {
  56. return true;
  57. }
  58. return false;
  59. }
  60. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  63. }
  64. }
  65. #endregion
  66. return cardEffects;
  67. }
  68. }
  69. }