BT10_044.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_044 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.OnEnterFieldAnyone)
  16. {
  17. ActivateClass activateClass = new ActivateClass();
  18. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  19. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  20. activateClass.SetHashString("Draw1_BT10_044");
  21. cardEffects.Add(activateClass);
  22. string EffectDiscription()
  23. {
  24. return "[Your Turn][Once Per Turn] When you play a green Tamer, <Draw 1>. (Draw 1 card from your deck.)";
  25. }
  26. bool PermanentCondition(Permanent permanent)
  27. {
  28. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  29. {
  30. if (permanent.IsTamer)
  31. {
  32. if (permanent.TopCard.CardColors.Contains(CardColor.Green))
  33. {
  34. return true;
  35. }
  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. if (timing == EffectTiming.OnTappedAnyone)
  68. {
  69. ActivateClass activateClass = new ActivateClass();
  70. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  71. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  72. activateClass.SetIsInheritedEffect(true);
  73. activateClass.SetHashString("Draw1_BT10_044");
  74. cardEffects.Add(activateClass);
  75. string EffectDiscription()
  76. {
  77. return "[Your Turn][Once Per Turn] When an opponent's Digimon becomes suspended, <Draw 1>. (Draw 1 card from your deck.)";
  78. }
  79. bool PermanentCondition(Permanent permanent)
  80. {
  81. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  82. }
  83. bool CanUseCondition(Hashtable hashtable)
  84. {
  85. if (CardEffectCommons.IsExistOnBattleArea(card))
  86. {
  87. if (CardEffectCommons.IsOwnerTurn(card))
  88. {
  89. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  90. {
  91. return true;
  92. }
  93. }
  94. }
  95. return false;
  96. }
  97. bool CanActivateCondition(Hashtable hashtable)
  98. {
  99. if (CardEffectCommons.IsExistOnBattleArea(card))
  100. {
  101. return true;
  102. }
  103. return false;
  104. }
  105. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  106. {
  107. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  108. }
  109. }
  110. return cardEffects;
  111. }
  112. }
  113. }