EX8_041.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX8
  4. {
  5. public class EX8_041 : 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. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.IsLevel3 && targetPermanent.TopCard.EqualsTraits("Reptile");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 2,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null)
  23. );
  24. }
  25. #endregion
  26. #region On Play/When Digivolving Shared
  27. bool CanSelectPermanentConditionShared(Permanent permanent)
  28. {
  29. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card) &&
  30. permanent.IsTamer;
  31. }
  32. bool CanActivateConditionShared(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  35. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
  36. }
  37. #endregion
  38. #region On Play
  39. if (timing == EffectTiming.OnEnterFieldAnyone)
  40. {
  41. ActivateClass activateClass = new ActivateClass();
  42. activateClass.SetUpICardEffect("Suspend 1 opponent's Tamer", CanUseCondition, card);
  43. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  44. cardEffects.Add(activateClass);
  45. string EffectDescription()
  46. {
  47. return
  48. "[On Play] Suspend 1 of your opponent's Tamers. Then, 1 of their Tamers can't unsuspend until the end of their turn.";
  49. }
  50. bool CanUseCondition(Hashtable hashtable)
  51. {
  52. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable hashtable)
  55. {
  56. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  57. selectPermanentEffect.SetUp(
  58. selectPlayer: card.Owner,
  59. canTargetCondition: CanSelectPermanentConditionShared,
  60. canTargetCondition_ByPreSelecetedList: null,
  61. canEndSelectCondition: null,
  62. maxCount: 1,
  63. canNoSelect: false,
  64. canEndNotMax: false,
  65. selectPermanentCoroutine: null,
  66. afterSelectPermanentCoroutine: null,
  67. mode: SelectPermanentEffect.Mode.Tap,
  68. cardEffect: activateClass);
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. selectPermanentEffect.SetUp(
  71. selectPlayer: card.Owner,
  72. canTargetCondition: CanSelectPermanentConditionShared,
  73. canTargetCondition_ByPreSelecetedList: null,
  74. canEndSelectCondition: null,
  75. maxCount: 1,
  76. canNoSelect: false,
  77. canEndNotMax: false,
  78. selectPermanentCoroutine: SelectPermanentCoroutine,
  79. afterSelectPermanentCoroutine: null,
  80. mode: SelectPermanentEffect.Mode.Custom,
  81. cardEffect: activateClass);
  82. selectPermanentEffect.SetUpCustomMessage(
  83. "Select 1 Tamer that will be unable to unsuspend.",
  84. "The opponent is selecting 1 Tamer that will be unable to unsuspend.");
  85. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  86. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  87. {
  88. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  89. targetPermanent: permanent,
  90. activateClass: activateClass
  91. ));
  92. }
  93. }
  94. }
  95. #endregion
  96. #region When Digivolving
  97. if (timing == EffectTiming.OnEnterFieldAnyone)
  98. {
  99. ActivateClass activateClass = new ActivateClass();
  100. activateClass.SetUpICardEffect("Suspend 1 opponent's Tamer", CanUseCondition, card);
  101. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  102. cardEffects.Add(activateClass);
  103. string EffectDescription()
  104. {
  105. return
  106. "[When Digivolving] Suspend 1 of your opponent's Tamers. Then, 1 of their Tamers can't unsuspend until the end of their turn.";
  107. }
  108. bool CanUseCondition(Hashtable hashtable)
  109. {
  110. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  111. }
  112. IEnumerator ActivateCoroutine(Hashtable hashtable)
  113. {
  114. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  115. selectPermanentEffect.SetUp(
  116. selectPlayer: card.Owner,
  117. canTargetCondition: CanSelectPermanentConditionShared,
  118. canTargetCondition_ByPreSelecetedList: null,
  119. canEndSelectCondition: null,
  120. maxCount: 1,
  121. canNoSelect: false,
  122. canEndNotMax: false,
  123. selectPermanentCoroutine: null,
  124. afterSelectPermanentCoroutine: null,
  125. mode: SelectPermanentEffect.Mode.Tap,
  126. cardEffect: activateClass);
  127. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  128. selectPermanentEffect.SetUp(
  129. selectPlayer: card.Owner,
  130. canTargetCondition: CanSelectPermanentConditionShared,
  131. canTargetCondition_ByPreSelecetedList: null,
  132. canEndSelectCondition: null,
  133. maxCount: 1,
  134. canNoSelect: false,
  135. canEndNotMax: false,
  136. selectPermanentCoroutine: SelectPermanentCoroutine,
  137. afterSelectPermanentCoroutine: null,
  138. mode: SelectPermanentEffect.Mode.Custom,
  139. cardEffect: activateClass);
  140. selectPermanentEffect.SetUpCustomMessage(
  141. "Select 1 Tamer that will be unable to unsuspend.",
  142. "The opponent is selecting 1 Tamer that will be unable to unsuspend.");
  143. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  144. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  145. {
  146. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  147. targetPermanent: permanent,
  148. activateClass: activateClass
  149. ));
  150. }
  151. }
  152. }
  153. #endregion
  154. #region Retaliation - ESS
  155. if (timing == EffectTiming.OnDestroyedAnyone)
  156. {
  157. cardEffects.Add(CardEffectFactory.RetaliationSelfEffect(isInheritedEffect: true, card: card, condition: null));
  158. }
  159. #endregion
  160. return cardEffects;
  161. }
  162. }
  163. }