BT19_050.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_050 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Ace - Blast Digivolve
  11. if (timing == EffectTiming.OnCounterTiming)
  12. {
  13. cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
  14. }
  15. #endregion
  16. #region On Play
  17. if (timing == EffectTiming.OnEnterFieldAnyone)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  22. cardEffects.Add(activateClass);
  23. string EffectDescription()
  24. {
  25. return "[On Play] Suspend 1 of your opponent's Digimon or Tamers. Then, one of your opponent's Digimon or Tamers can't unsuspend until the end of their turn.";
  26. }
  27. bool SelectOpponentDigimonOrTamer(Permanent permanent)
  28. {
  29. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) &&
  30. (permanent.IsDigimon || permanent.IsTamer);
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  35. }
  36. bool CanActivateCondition(Hashtable hashtable)
  37. {
  38. if (CardEffectCommons.IsExistOnBattleArea(card))
  39. {
  40. return CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SelectOpponentDigimonOrTamer);
  41. }
  42. return false;
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable hashtable)
  45. {
  46. if (CardEffectCommons.HasMatchConditionPermanent(SelectOpponentDigimonOrTamer))
  47. {
  48. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  49. selectPermanentEffect.SetUp(
  50. selectPlayer: card.Owner,
  51. canTargetCondition: SelectOpponentDigimonOrTamer,
  52. canTargetCondition_ByPreSelecetedList: null,
  53. canEndSelectCondition: null,
  54. maxCount: 1,
  55. canNoSelect: false,
  56. canEndNotMax: false,
  57. selectPermanentCoroutine: null,
  58. afterSelectPermanentCoroutine: null,
  59. mode: SelectPermanentEffect.Mode.Tap,
  60. cardEffect: activateClass);
  61. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  62. }
  63. if (CardEffectCommons.HasMatchConditionPermanent(SelectOpponentDigimonOrTamer))
  64. {
  65. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  66. selectPermanentEffect.SetUp(
  67. selectPlayer: card.Owner,
  68. canTargetCondition: SelectOpponentDigimonOrTamer,
  69. canTargetCondition_ByPreSelecetedList: null,
  70. canEndSelectCondition: null,
  71. maxCount: 1,
  72. canNoSelect: false,
  73. canEndNotMax: false,
  74. selectPermanentCoroutine: SelectPermanentCoroutine,
  75. afterSelectPermanentCoroutine: null,
  76. mode: SelectPermanentEffect.Mode.Custom,
  77. cardEffect: activateClass);
  78. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will not unsuspend.", "The opponent is selecting 1 Digimon or Tamer that will not unsuspend.");
  79. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  80. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  81. {
  82. Permanent selectedPermanent = permanent;
  83. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  84. targetPermanent: selectedPermanent,
  85. activateClass: activateClass
  86. ));
  87. }
  88. }
  89. }
  90. }
  91. #endregion
  92. #region When Digivolving
  93. if (timing == EffectTiming.OnEnterFieldAnyone)
  94. {
  95. ActivateClass activateClass = new ActivateClass();
  96. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  97. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  98. cardEffects.Add(activateClass);
  99. string EffectDescription()
  100. {
  101. return "[When Digivolving] Suspend 1 of your opponent's Digimon or Tamers. Then, one of your opponent's Digimon or Tamers can't unsuspend until the end of their turn.";
  102. }
  103. bool SelectOpponentDigimonOrTamer(Permanent permanent)
  104. {
  105. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) &&
  106. (permanent.IsDigimon || permanent.IsTamer);
  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. return CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SelectOpponentDigimonOrTamer);
  117. }
  118. return false;
  119. }
  120. IEnumerator ActivateCoroutine(Hashtable hashtable)
  121. {
  122. if (CardEffectCommons.HasMatchConditionPermanent(SelectOpponentDigimonOrTamer))
  123. {
  124. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  125. selectPermanentEffect.SetUp(
  126. selectPlayer: card.Owner,
  127. canTargetCondition: SelectOpponentDigimonOrTamer,
  128. canTargetCondition_ByPreSelecetedList: null,
  129. canEndSelectCondition: null,
  130. maxCount: 1,
  131. canNoSelect: false,
  132. canEndNotMax: false,
  133. selectPermanentCoroutine: null,
  134. afterSelectPermanentCoroutine: null,
  135. mode: SelectPermanentEffect.Mode.Tap,
  136. cardEffect: activateClass);
  137. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  138. }
  139. if (CardEffectCommons.HasMatchConditionPermanent(SelectOpponentDigimonOrTamer))
  140. {
  141. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  142. selectPermanentEffect.SetUp(
  143. selectPlayer: card.Owner,
  144. canTargetCondition: SelectOpponentDigimonOrTamer,
  145. canTargetCondition_ByPreSelecetedList: null,
  146. canEndSelectCondition: null,
  147. maxCount: 1,
  148. canNoSelect: false,
  149. canEndNotMax: false,
  150. selectPermanentCoroutine: SelectPermanentCoroutine,
  151. afterSelectPermanentCoroutine: null,
  152. mode: SelectPermanentEffect.Mode.Custom,
  153. cardEffect: activateClass);
  154. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will not unsuspend.", "The opponent is selecting 1 Digimon or Tamer that will not unsuspend.");
  155. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  156. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  157. {
  158. Permanent selectedPermanent = permanent;
  159. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  160. targetPermanent: selectedPermanent,
  161. activateClass: activateClass
  162. ));
  163. }
  164. }
  165. }
  166. }
  167. #endregion
  168. #region Inherit
  169. if (timing == EffectTiming.None)
  170. {
  171. bool Condition()
  172. {
  173. if (CardEffectCommons.IsOwnerTurn(card))
  174. {
  175. return true;
  176. }
  177. return false;
  178. }
  179. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  180. changeValue: 4000,
  181. isInheritedEffect: true,
  182. card: card,
  183. condition: Condition));
  184. }
  185. #endregion
  186. return cardEffects;
  187. }
  188. }
  189. }