BT18_025.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_025 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. // Any blue or red tamer
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.IsTamer && (targetPermanent.TopCard.CardColors.Contains(CardColor.Blue) ||
  17. targetPermanent.TopCard.CardColors.Contains(CardColor.Red));
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition, digivolutionCost: 4, ignoreDigivolutionRequirement: false,
  21. card: card, condition: null));
  22. }
  23. // Tommy Himi
  24. if (timing == EffectTiming.None)
  25. {
  26. bool Condition()
  27. {
  28. return true;
  29. }
  30. bool PermanentCondition(Permanent targetPermanent)
  31. {
  32. return targetPermanent.TopCard.EqualsCardName("Tommy Himi");
  33. }
  34. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  35. permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false,
  36. card: card, condition: Condition));
  37. }
  38. // Kumamon
  39. if (timing == EffectTiming.None)
  40. {
  41. bool PermanentCondition(Permanent targetPermanent)
  42. {
  43. return targetPermanent.TopCard.EqualsCardName("Kumamon");
  44. }
  45. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  46. permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false,
  47. card: card, condition: null));
  48. }
  49. #endregion
  50. #region Jamming
  51. if (timing == EffectTiming.None)
  52. {
  53. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(
  54. isInheritedEffect: false,
  55. card: card,
  56. condition: null));
  57. }
  58. #endregion
  59. #region On Play/ When Digivolving Shared
  60. bool CanSelectPermanentConditionShared(Permanent permanent)
  61. {
  62. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  63. permanent.HasNoDigivolutionCards;
  64. }
  65. bool CanActivateConditionShared(Hashtable hashtable)
  66. {
  67. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  68. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
  69. }
  70. #endregion
  71. #region On Play
  72. if (timing == EffectTiming.OnEnterFieldAnyone)
  73. {
  74. ActivateClass activateClass = new ActivateClass();
  75. activateClass.SetUpICardEffect("Opponent's Digimon can't suspend", CanUseCondition, card);
  76. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  77. cardEffects.Add(activateClass);
  78. string EffectDescription()
  79. {
  80. return
  81. "[On Play] 1 of your opponent's Digimon with no digivolution cards can't suspend until the end of their turn.";
  82. }
  83. bool CanUseCondition(Hashtable hashtable)
  84. {
  85. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  86. }
  87. IEnumerator ActivateCoroutine(Hashtable hashtable)
  88. {
  89. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  90. selectPermanentEffect.SetUp(
  91. selectPlayer: card.Owner,
  92. canTargetCondition: CanSelectPermanentConditionShared,
  93. canTargetCondition_ByPreSelecetedList: null,
  94. canEndSelectCondition: null,
  95. maxCount: 1,
  96. canNoSelect: false,
  97. canEndNotMax: false,
  98. selectPermanentCoroutine: SelectPermanentCoroutine,
  99. afterSelectPermanentCoroutine: null,
  100. mode: SelectPermanentEffect.Mode.Custom,
  101. cardEffect: activateClass);
  102. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will not be able to suspend.",
  103. "The opponent is selecting 1 Digimon that will not be able to suspend.");
  104. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  105. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  106. {
  107. CanNotSuspendClass canNotSuspendClass = new CanNotSuspendClass();
  108. canNotSuspendClass.SetUpICardEffect("Can't Suspend", CanUseCanNotSuspendCondition, card);
  109. canNotSuspendClass.SetUpCanNotSuspendClass(PermanentCondition: PermanentCanNotSuspendCondition);
  110. permanent.UntilOwnerTurnEndEffects.Add(_ => canNotSuspendClass);
  111. if (!permanent.TopCard.CanNotBeAffected(activateClass))
  112. {
  113. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
  114. .CreateDebuffEffect(permanent));
  115. }
  116. bool CanUseCanNotSuspendCondition(Hashtable hashtableCanNotSuspend)
  117. {
  118. return permanent.TopCard != null && !permanent.TopCard.CanNotBeAffected(activateClass);
  119. }
  120. bool PermanentCanNotSuspendCondition(Permanent permanentCanNotSuspend)
  121. {
  122. return permanentCanNotSuspend == permanent;
  123. }
  124. }
  125. }
  126. }
  127. #endregion
  128. #region When Digivolving
  129. if (timing == EffectTiming.OnEnterFieldAnyone)
  130. {
  131. ActivateClass activateClass = new ActivateClass();
  132. activateClass.SetUpICardEffect("Opponent's Digimon can't suspend", CanUseCondition, card);
  133. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  134. cardEffects.Add(activateClass);
  135. string EffectDescription()
  136. {
  137. return
  138. "[When Digivolving] 1 of your opponent's Digimon with no digivolution cards can't suspend until the end of their turn.";
  139. }
  140. bool CanUseCondition(Hashtable hashtable)
  141. {
  142. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  143. }
  144. IEnumerator ActivateCoroutine(Hashtable hashtable)
  145. {
  146. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  147. selectPermanentEffect.SetUp(
  148. selectPlayer: card.Owner,
  149. canTargetCondition: CanSelectPermanentConditionShared,
  150. canTargetCondition_ByPreSelecetedList: null,
  151. canEndSelectCondition: null,
  152. maxCount: 1,
  153. canNoSelect: false,
  154. canEndNotMax: false,
  155. selectPermanentCoroutine: SelectPermanentCoroutine,
  156. afterSelectPermanentCoroutine: null,
  157. mode: SelectPermanentEffect.Mode.Custom,
  158. cardEffect: activateClass);
  159. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will not be able to suspend.",
  160. "The opponent is selecting 1 Digimon that will not be able to suspend.");
  161. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  162. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  163. {
  164. CanNotSuspendClass canNotSuspendClass = new CanNotSuspendClass();
  165. canNotSuspendClass.SetUpICardEffect("Can't Suspend", CanUseCanNotSuspendCondition, card);
  166. canNotSuspendClass.SetUpCanNotSuspendClass(PermanentCondition: PermanentCanNotSuspendCondition);
  167. permanent.UntilOwnerTurnEndEffects.Add(_ => canNotSuspendClass);
  168. if (!permanent.TopCard.CanNotBeAffected(activateClass))
  169. {
  170. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
  171. .CreateDebuffEffect(permanent));
  172. }
  173. bool CanUseCanNotSuspendCondition(Hashtable hashtableCanNotSuspend)
  174. {
  175. return permanent.TopCard != null && !permanent.TopCard.CanNotBeAffected(activateClass);
  176. }
  177. bool PermanentCanNotSuspendCondition(Permanent permanentCanNotSuspend)
  178. {
  179. return permanentCanNotSuspend == permanent;
  180. }
  181. }
  182. }
  183. }
  184. #endregion
  185. #region Jamming - ESS
  186. if (timing == EffectTiming.None)
  187. {
  188. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(
  189. isInheritedEffect: true,
  190. card: card,
  191. condition: null));
  192. }
  193. #endregion
  194. return cardEffects;
  195. }
  196. }
  197. }