BT13_020.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.BT13
  5. {
  6. public class BT13_020 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.None)
  12. {
  13. AddBurstDigivolutionConditionClass addBurstDigivolutionConditionClass = new AddBurstDigivolutionConditionClass();
  14. addBurstDigivolutionConditionClass.SetUpICardEffect($"Burst Digivolution", CanUseCondition, card);
  15. addBurstDigivolutionConditionClass.SetUpAddBurstDigivolutionConditionClass(getBurstDigivolutionCondition: GetBurstDigivolution);
  16. addBurstDigivolutionConditionClass.SetNotShowUI(true);
  17. cardEffects.Add(addBurstDigivolutionConditionClass);
  18. bool CanUseCondition(Hashtable hashtable)
  19. {
  20. return true;
  21. }
  22. BurstDigivolutionCondition GetBurstDigivolution(CardSource cardSource)
  23. {
  24. if (cardSource == card)
  25. {
  26. bool tamerCondition(Permanent permanent)
  27. {
  28. if (permanent != null)
  29. {
  30. if (permanent.TopCard != null)
  31. {
  32. if (permanent.TopCard.Owner == card.Owner)
  33. {
  34. if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent))
  35. {
  36. if (!permanent.CannotReturnToHand(null))
  37. {
  38. if (permanent.TopCard.CardNames.Contains("Marcus Damon"))
  39. {
  40. return true;
  41. }
  42. if (permanent.TopCard.CardNames.Contains("MarcusDamon"))
  43. {
  44. return true;
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. return false;
  52. }
  53. bool digimonCondition(Permanent permanent)
  54. {
  55. if (permanent != null)
  56. {
  57. if (permanent.TopCard != null)
  58. {
  59. if (permanent.TopCard.Owner == card.Owner)
  60. {
  61. if (permanent.TopCard.Owner.GetFieldPermanents().Contains(permanent))
  62. {
  63. if (!card.CanNotEvolve(permanent))
  64. {
  65. if (permanent.TopCard.CardNames.Contains("ShineGreymon"))
  66. {
  67. return true;
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. return false;
  75. }
  76. BurstDigivolutionCondition burstDigivolutionCondition = new BurstDigivolutionCondition(
  77. tamerCondition: tamerCondition,
  78. selectTamerMessage: "1 [Marcus Damon]",
  79. digimonCondition: digimonCondition,
  80. selectDigimonMessage: "1 [ShineGreymon]",
  81. cost: 0);
  82. return burstDigivolutionCondition;
  83. }
  84. return null;
  85. }
  86. }
  87. if (timing == EffectTiming.OnEnterFieldAnyone)
  88. {
  89. ActivateClass activateClass = new ActivateClass();
  90. activateClass.SetUpICardEffect("Play 1 [Marcus Damon] from hand", CanUseCondition, card);
  91. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  92. cardEffects.Add(activateClass);
  93. string EffectDiscription()
  94. {
  95. return "[When Digivolving] You may play 1 [Marcus Damon] from your hand without paying the cost. For the turn, the Tamer played by this effect is also treated as a 12000 DP Digimon, can't digivolve, and gains <Rush>.";
  96. }
  97. bool CanSelectCardCondition(CardSource cardSource)
  98. {
  99. if (cardSource.CardNames.Contains("Marcus Damon") || cardSource.CardNames.Contains("MarcusDamon"))
  100. {
  101. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  102. {
  103. return true;
  104. }
  105. }
  106. return false;
  107. }
  108. bool CanUseCondition(Hashtable hashtable)
  109. {
  110. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  111. }
  112. bool CanActivateCondition(Hashtable hashtable)
  113. {
  114. if (CardEffectCommons.IsExistOnBattleArea(card))
  115. {
  116. if (card.Owner.HandCards.Count >= 1)
  117. {
  118. return true;
  119. }
  120. }
  121. return false;
  122. }
  123. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  124. {
  125. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  126. {
  127. List<CardSource> selectedCards = new List<CardSource>();
  128. int maxCount = 1;
  129. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  130. selectHandEffect.SetUp(
  131. selectPlayer: card.Owner,
  132. canTargetCondition: CanSelectCardCondition,
  133. canTargetCondition_ByPreSelecetedList: null,
  134. canEndSelectCondition: null,
  135. maxCount: maxCount,
  136. canNoSelect: true,
  137. canEndNotMax: false,
  138. isShowOpponent: true,
  139. selectCardCoroutine: SelectCardCoroutine,
  140. afterSelectCardCoroutine: null,
  141. mode: SelectHandEffect.Mode.Custom,
  142. cardEffect: activateClass);
  143. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  144. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  145. yield return StartCoroutine(selectHandEffect.Activate());
  146. IEnumerator SelectCardCoroutine(CardSource cardSource)
  147. {
  148. selectedCards.Add(cardSource);
  149. yield return null;
  150. }
  151. if (selectedCards.Count >= 1)
  152. {
  153. CardSource selectedCard = selectedCards[0];
  154. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
  155. if (CardEffectCommons.IsExistOnBattleArea(selectedCard))
  156. {
  157. Permanent selectedPermanent = selectedCard.PermanentOfThisCard();
  158. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(
  159. targetPermanent: selectedPermanent,
  160. DP: 12000,
  161. effectDuration: EffectDuration.UntilEachTurnEnd,
  162. activateClass: activateClass));
  163. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
  164. targetPermanent: selectedPermanent,
  165. effectDuration: EffectDuration.UntilEachTurnEnd,
  166. activateClass: activateClass));
  167. }
  168. }
  169. }
  170. }
  171. }
  172. if (timing == EffectTiming.OnTappedAnyone)
  173. {
  174. ActivateClass activateClass = new ActivateClass();
  175. activateClass.SetUpICardEffect("Trash the top card of opponent's security", CanUseCondition, card);
  176. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  177. activateClass.SetHashString("TrashSecurity_BT13_020");
  178. cardEffects.Add(activateClass);
  179. string EffectDiscription()
  180. {
  181. return "[Your Turn][Once Per Turn] When one of your Tamers becomes suspended, trash the top card of your opponent's security stack.";
  182. }
  183. bool PermanentCondition(Permanent permanent)
  184. {
  185. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  186. {
  187. if (permanent.IsTamer)
  188. {
  189. return true;
  190. }
  191. }
  192. return false;
  193. }
  194. bool CanUseCondition(Hashtable hashtable)
  195. {
  196. if (CardEffectCommons.IsExistOnBattleArea(card))
  197. {
  198. if (CardEffectCommons.IsOwnerTurn(card))
  199. {
  200. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  201. {
  202. return true;
  203. }
  204. }
  205. }
  206. return false;
  207. }
  208. bool CanActivateCondition(Hashtable hashtable)
  209. {
  210. if (CardEffectCommons.IsExistOnBattleArea(card))
  211. {
  212. return true;
  213. }
  214. return false;
  215. }
  216. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  217. {
  218. yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
  219. player: card.Owner.Enemy,
  220. destroySecurityCount: 1,
  221. cardEffect: activateClass,
  222. fromTop: true).DestroySecurity());
  223. }
  224. }
  225. return cardEffects;
  226. }
  227. }
  228. }