BT13_074.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_074 : 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("Reveal the top 3 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] Reveal the top 3 cards of your deck. You may play 1 Digimon card that has [Mamemon] in its name and a play cost of 10 or less among them without paying the cost. Trash the rest.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  23. {
  24. if (cardSource.ContainsCardName("Mamemon"))
  25. {
  26. if (cardSource.GetCostItself <= 10)
  27. {
  28. if (cardSource.IsDigimon)
  29. {
  30. return true;
  31. }
  32. }
  33. }
  34. }
  35. return false;
  36. }
  37. bool CanUseCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  40. }
  41. bool CanActivateCondition(Hashtable hashtable)
  42. {
  43. if (CardEffectCommons.IsExistOnBattleArea(card))
  44. {
  45. if (card.Owner.LibraryCards.Count >= 1)
  46. {
  47. return true;
  48. }
  49. }
  50. return false;
  51. }
  52. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  53. {
  54. List<CardSource> selectedCards = new List<CardSource>();
  55. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  56. revealCount: 3,
  57. simplifiedSelectCardConditions:
  58. new SimplifiedSelectCardConditionClass[]
  59. {
  60. new SimplifiedSelectCardConditionClass(
  61. canTargetCondition:CanSelectCardCondition,
  62. message: "Select 1 Digimon card that has [Mamemon] in its name and a play cost of 10 or less.",
  63. mode: SelectCardEffect.Mode.Custom,
  64. maxCount: 1,
  65. selectCardCoroutine: SelectCardCoroutine),
  66. },
  67. remainingCardsPlace: RemainingCardsPlace.Trash,
  68. activateClass: activateClass,
  69. canNoSelect: true
  70. ));
  71. IEnumerator SelectCardCoroutine(CardSource cardSource)
  72. {
  73. selectedCards.Add(cardSource);
  74. yield return null;
  75. }
  76. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  77. cardSources: selectedCards,
  78. activateClass: activateClass,
  79. payCost: false,
  80. isTapped: false,
  81. root: SelectCardEffect.Root.Library,
  82. activateETB: true));
  83. }
  84. }
  85. if (timing == EffectTiming.OnEnterFieldAnyone)
  86. {
  87. ActivateClass activateClass = new ActivateClass();
  88. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  89. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  90. cardEffects.Add(activateClass);
  91. string EffectDiscription()
  92. {
  93. return "[When Digivolving] Reveal the top 3 cards of your deck. You may play 1 Digimon card that has [Mamemon] in its name and a play cost of 10 or less among them without paying the cost. Trash the rest.";
  94. }
  95. bool CanSelectCardCondition(CardSource cardSource)
  96. {
  97. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  98. {
  99. if (cardSource.ContainsCardName("Mamemon"))
  100. {
  101. if (cardSource.GetCostItself <= 10)
  102. {
  103. if (cardSource.IsDigimon)
  104. {
  105. return true;
  106. }
  107. }
  108. }
  109. }
  110. return false;
  111. }
  112. bool CanUseCondition(Hashtable hashtable)
  113. {
  114. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  115. }
  116. bool CanActivateCondition(Hashtable hashtable)
  117. {
  118. if (CardEffectCommons.IsExistOnBattleArea(card))
  119. {
  120. if (card.Owner.LibraryCards.Count >= 1)
  121. {
  122. return true;
  123. }
  124. }
  125. return false;
  126. }
  127. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  128. {
  129. List<CardSource> selectedCards = new List<CardSource>();
  130. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  131. revealCount: 3,
  132. simplifiedSelectCardConditions:
  133. new SimplifiedSelectCardConditionClass[]
  134. {
  135. new SimplifiedSelectCardConditionClass(
  136. canTargetCondition:CanSelectCardCondition,
  137. message: "Select 1 Digimon card that has [Mamemon] in its name and a play cost of 10 or less.",
  138. mode: SelectCardEffect.Mode.Custom,
  139. maxCount: 1,
  140. selectCardCoroutine: SelectCardCoroutine),
  141. },
  142. remainingCardsPlace: RemainingCardsPlace.Trash,
  143. activateClass: activateClass,
  144. canNoSelect: true
  145. ));
  146. IEnumerator SelectCardCoroutine(CardSource cardSource)
  147. {
  148. selectedCards.Add(cardSource);
  149. yield return null;
  150. }
  151. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  152. cardSources: selectedCards,
  153. activateClass: activateClass,
  154. payCost: false,
  155. isTapped: false,
  156. root: SelectCardEffect.Root.Library,
  157. activateETB: true));
  158. }
  159. }
  160. if (timing == EffectTiming.None)
  161. {
  162. bool CanUseCondition()
  163. {
  164. if (CardEffectCommons.IsExistOnBattleArea(card))
  165. {
  166. return true;
  167. }
  168. return false;
  169. }
  170. bool PermanentCondition(Permanent permanent)
  171. {
  172. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  173. {
  174. if (permanent.TopCard.ContainsCardName("Mamemon"))
  175. {
  176. return true;
  177. }
  178. if (permanent.TopCard.HasRoyalKnightTraits)
  179. {
  180. return true;
  181. }
  182. }
  183. return false;
  184. }
  185. cardEffects.Add(CardEffectFactory.JammingStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: false, card: card, condition: CanUseCondition));
  186. }
  187. if (timing == EffectTiming.None)
  188. {
  189. bool CanUseCondition()
  190. {
  191. if (CardEffectCommons.IsExistOnBattleArea(card))
  192. {
  193. return true;
  194. }
  195. return false;
  196. }
  197. bool PermanentCondition(Permanent permanent)
  198. {
  199. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  200. {
  201. if (permanent.TopCard.ContainsCardName("Mamemon"))
  202. {
  203. return true;
  204. }
  205. if (permanent.TopCard.HasRoyalKnightTraits)
  206. {
  207. return true;
  208. }
  209. }
  210. return false;
  211. }
  212. cardEffects.Add(CardEffectFactory.RebootStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: false, card: card, condition: CanUseCondition));
  213. }
  214. return cardEffects;
  215. }
  216. }
  217. }