RB1_033.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.RB1
  4. {
  5. public class RB1_033 : 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.OnAllyAttack)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[All Turns] When one of your Digimon with [Jellymon] in its text or an opponent's level 5 or higher Digimon attacks, if you have 7 or fewer cards in your hand, by suspending this Tamer, <Draw 1>.";
  19. }
  20. bool PermanentCondition(Permanent permanent)
  21. {
  22. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  23. {
  24. if (permanent.TopCard.HasText("Jellymon"))
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanUseCondition(Hashtable hashtable)
  32. {
  33. if (CardEffectCommons.IsExistOnBattleArea(card))
  34. {
  35. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. bool CanActivateCondition(Hashtable hashtable)
  43. {
  44. if (CardEffectCommons.IsExistOnBattleArea(card))
  45. {
  46. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  47. {
  48. if (card.Owner.HandCards.Count <= 7)
  49. {
  50. return true;
  51. }
  52. }
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  57. {
  58. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  59. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  60. }
  61. }
  62. if (timing == EffectTiming.OnAllyAttack)
  63. {
  64. ActivateClass activateClass = new ActivateClass();
  65. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  66. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  67. cardEffects.Add(activateClass);
  68. string EffectDiscription()
  69. {
  70. return "[All Turns] When one of your Digimon with [Jellymon] in its text or an opponent's level 5 or higher Digimon attacks, if you have 7 or fewer cards in your hand, by suspending this Tamer, <Draw 1>.";
  71. }
  72. bool PermanentCondition(Permanent permanent)
  73. {
  74. if (CardEffectCommons.IsOpponentPermanent(permanent, card))
  75. {
  76. if (permanent.TopCard.Level >= 5 && permanent.TopCard.HasLevel)
  77. {
  78. return true;
  79. }
  80. }
  81. return false;
  82. }
  83. bool CanUseCondition(Hashtable hashtable)
  84. {
  85. if (CardEffectCommons.IsExistOnBattleArea(card))
  86. {
  87. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  88. {
  89. return true;
  90. }
  91. }
  92. return false;
  93. }
  94. bool CanActivateCondition(Hashtable hashtable)
  95. {
  96. if (CardEffectCommons.IsExistOnBattleArea(card))
  97. {
  98. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  99. {
  100. if (card.Owner.HandCards.Count <= 7)
  101. {
  102. return true;
  103. }
  104. }
  105. }
  106. return false;
  107. }
  108. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  109. {
  110. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  111. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  112. }
  113. }
  114. if (timing == EffectTiming.OnUnTappedAnyone)
  115. {
  116. ActivateClass activateClass = new ActivateClass();
  117. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  118. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  119. cardEffects.Add(activateClass);
  120. string EffectDiscription()
  121. {
  122. return "[Your Turn] When this Tamer becomes unsuspended, gain 1 memory.";
  123. }
  124. bool CanUseCondition(Hashtable hashtable)
  125. {
  126. if (CardEffectCommons.IsExistOnBattleArea(card))
  127. {
  128. if (CardEffectCommons.IsOwnerTurn(card))
  129. {
  130. if (CardEffectCommons.CanTriggerWhenPermanentUnsuspends(hashtable, permanent => permanent == card.PermanentOfThisCard()))
  131. {
  132. return true;
  133. }
  134. }
  135. }
  136. return false;
  137. }
  138. bool CanActivateCondition(Hashtable hashtable)
  139. {
  140. if (CardEffectCommons.IsExistOnBattleArea(card))
  141. {
  142. if (card.Owner.CanAddMemory(activateClass))
  143. {
  144. return true;
  145. }
  146. }
  147. return false;
  148. }
  149. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  150. {
  151. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  152. }
  153. }
  154. if (timing == EffectTiming.SecuritySkill)
  155. {
  156. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  157. }
  158. return cardEffects;
  159. }
  160. }
  161. }