BT20_085.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. namespace DCGO.CardEffects.BT20
  5. {
  6. public class BT20_085 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Start of Main
  12. if (timing == EffectTiming.OnStartMainPhase)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Play 1 [Shoto Kazama], and 1 level 3 digimon", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[Start of Your Main Phase] By returning this Tamer to the bottom of the deck, you may play 1 [Shoto Kazama] from your hand without paying the cost. Then, if you don't have a Digimon, you may play 1 level 3 Digimon card with [Avian] or [Bird] in any of its traits from your trash without paying the cost.";
  21. }
  22. bool IsShotoKazama(CardSource source)
  23. {
  24. return source.EqualsCardName("Shoto Kazama") &&
  25. CardEffectCommons.CanPlayAsNewPermanent(source, false, activateClass);
  26. }
  27. bool IsProperLevel3(CardSource source)
  28. {
  29. return source.HasLevel && source.IsLevel3 &&
  30. (source.ContainsTraits("Avian") || source.ContainsTraits("Bird")) &&
  31. CardEffectCommons.CanPlayAsNewPermanent(source, false, activateClass,SelectCardEffect.Root.Trash);
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return isExistOnField(card) &&
  36. CardEffectCommons.IsOwnerTurn(card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return isExistOnField(card) &&
  41. !card.PermanentOfThisCard().CannotReturnToLibrary(activateClass);
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable hashtable)
  44. {
  45. yield return ContinuousController.instance.StartCoroutine(new DeckBottomBounceClass(new List<Permanent> { card.PermanentOfThisCard() }, hashtable).DeckBounce());
  46. if(CardEffectCommons.HasMatchConditionOwnersHand(card, IsShotoKazama))
  47. {
  48. List<CardSource> selectedTamerCards = new List<CardSource>();
  49. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  50. selectHandEffect.SetUp(
  51. selectPlayer: card.Owner,
  52. canTargetCondition: IsShotoKazama,
  53. canTargetCondition_ByPreSelecetedList: null,
  54. canEndSelectCondition: null,
  55. maxCount: 1,
  56. canNoSelect: true,
  57. canEndNotMax: false,
  58. isShowOpponent: true,
  59. selectCardCoroutine: SelectCardCoroutine,
  60. afterSelectCardCoroutine: null,
  61. mode: SelectHandEffect.Mode.Custom,
  62. cardEffect: activateClass);
  63. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  64. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  65. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  66. IEnumerator SelectCardCoroutine(CardSource cardSource)
  67. {
  68. selectedTamerCards.Add(cardSource);
  69. yield return null;
  70. }
  71. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedTamerCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.DigivolutionCards, activateETB: true));
  72. }
  73. if (card.Owner.GetBattleAreaDigimons().Count == 0)
  74. {
  75. if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, IsProperLevel3))
  76. {
  77. List<CardSource> selectedDigimonCards = new List<CardSource>();
  78. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  79. selectCardEffect.SetUp(
  80. canTargetCondition: IsProperLevel3,
  81. canTargetCondition_ByPreSelecetedList: null,
  82. canEndSelectCondition: null,
  83. canNoSelect: () => false,
  84. selectCardCoroutine: SelectCardCoroutine,
  85. afterSelectCardCoroutine: null,
  86. message: "Select 1 Digimon card.",
  87. maxCount: 1,
  88. canEndNotMax: false,
  89. isShowOpponent: true,
  90. mode: SelectCardEffect.Mode.Custom,
  91. root: SelectCardEffect.Root.Trash,
  92. customRootCardList: null,
  93. canLookReverseCard: true,
  94. selectPlayer: card.Owner,
  95. cardEffect: activateClass);
  96. selectCardEffect.SetUpCustomMessage("Select 1 Digimon to play.", "The opponent is selecting 1 Digimon to play.");
  97. yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
  98. IEnumerator SelectCardCoroutine(CardSource cardSource)
  99. {
  100. selectedDigimonCards.Add(cardSource);
  101. yield return null;
  102. }
  103. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: selectedDigimonCards, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.DigivolutionCards, activateETB: true));
  104. }
  105. }
  106. }
  107. }
  108. #endregion
  109. #region End of Turn
  110. if (timing == EffectTiming.OnEndTurn)
  111. {
  112. ActivateClass activateClass = new ActivateClass();
  113. activateClass.SetUpICardEffect("Suspend Opponents Digimon, 1 of your digimon get +2000 DP", CanUseCondition, card);
  114. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  115. cardEffects.Add(activateClass);
  116. string EffectDiscription()
  117. {
  118. return "[End of Your Turn] By suspending this Tamer, suspend 1 of your opponent's Digimon and, until the end of their turn, 1 of your Digimon with the [Vortex Warriors] trait gets +2000 DP.";
  119. }
  120. bool IsOpponentsDigimon(Permanent permanent)
  121. {
  122. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  123. }
  124. bool IsYourDigimon(Permanent permanent)
  125. {
  126. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  127. permanent.TopCard.EqualsTraits("Vortex Warriors");
  128. }
  129. bool CanUseCondition(Hashtable hashtable)
  130. {
  131. return isExistOnField(card) &&
  132. CardEffectCommons.IsOwnerTurn(card);
  133. }
  134. bool CanActivateCondition(Hashtable hashtable)
  135. {
  136. return isExistOnField(card) &&
  137. CardEffectCommons.CanActivateSuspendCostEffect(card);
  138. }
  139. IEnumerator ActivateCoroutine(Hashtable hashtable)
  140. {
  141. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  142. if (CardEffectCommons.HasMatchConditionPermanent(IsOpponentsDigimon))
  143. {
  144. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  145. selectPermanentEffect.SetUp(
  146. selectPlayer: card.Owner,
  147. canTargetCondition: IsOpponentsDigimon,
  148. canTargetCondition_ByPreSelecetedList: null,
  149. canEndSelectCondition: null,
  150. maxCount: 1,
  151. canNoSelect: false,
  152. canEndNotMax: false,
  153. selectPermanentCoroutine: null,
  154. afterSelectPermanentCoroutine: null,
  155. mode: SelectPermanentEffect.Mode.Tap,
  156. cardEffect: activateClass);
  157. selectPermanentEffect.SetUpCustomMessage("Select Digimon that will suspend.",
  158. "The opponent is selecting Digimon that will suspend.");
  159. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  160. }
  161. if (CardEffectCommons.HasMatchConditionPermanent(IsYourDigimon))
  162. {
  163. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  164. selectPermanentEffect.SetUp(
  165. selectPlayer: card.Owner,
  166. canTargetCondition: IsYourDigimon,
  167. canTargetCondition_ByPreSelecetedList: null,
  168. canEndSelectCondition: null,
  169. maxCount: 1,
  170. canNoSelect: false,
  171. canEndNotMax: false,
  172. selectPermanentCoroutine: SelectYourDigimon,
  173. afterSelectPermanentCoroutine: null,
  174. mode: SelectPermanentEffect.Mode.Custom,
  175. cardEffect: activateClass);
  176. selectPermanentEffect.SetUpCustomMessage("Select Digimon that gets +2000 DP",
  177. "The opponent is selecting Digimon that gets +2000 DP.");
  178. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  179. IEnumerator SelectYourDigimon(Permanent permanent)
  180. {
  181. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 2000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  182. }
  183. }
  184. }
  185. }
  186. #endregion
  187. #region Security Effect
  188. if (timing == EffectTiming.SecuritySkill)
  189. {
  190. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  191. }
  192. #endregion
  193. return cardEffects;
  194. }
  195. }
  196. }