BT16_021.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT16
  4. {
  5. public class BT16_021 : 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 Requirement, Blocker
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.CardNames.Contains("Wormmon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 2,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null)
  23. );
  24. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  25. }
  26. #endregion
  27. #region Armor Purge
  28. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  29. {
  30. cardEffects.Add(CardEffectFactory.ArmorPurgeEffect(card: card));
  31. }
  32. #endregion
  33. #region All Turns
  34. if (timing == EffectTiming.OnTappedAnyone)
  35. {
  36. ActivateClass activateClass = new ActivateClass();
  37. activateClass.SetUpICardEffect("Trash 1 digivolution card & stun 1 Digimon", CanUseCondition, card);
  38. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  39. cardEffects.Add(activateClass);
  40. string EffectDiscription()
  41. {
  42. return "[All Turns] [Once Per Turn] When an opponent's Digimon becomes suspended, trash the top digivolution card of 1 of their Digimon. Then, 1 of their Digimon with no digivolution cards can't attack or block until the end of their turn.";
  43. }
  44. bool CanSelectPermanentSourceStripCondition(Permanent permanent)
  45. {
  46. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  47. }
  48. bool CanSelectPermanentStunCondition(Permanent permanent)
  49. {
  50. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  51. {
  52. if (permanent.HasNoDigivolutionCards)
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. bool PermanentCondition(Permanent permanent)
  60. {
  61. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  62. }
  63. bool CanUseCondition(Hashtable hashtable)
  64. {
  65. if (CardEffectCommons.IsExistOnBattleArea(card))
  66. {
  67. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  68. {
  69. return true;
  70. }
  71. }
  72. return false;
  73. }
  74. bool CanActivateCondition(Hashtable hashtable)
  75. {
  76. return CardEffectCommons.IsExistOnBattleArea(card);
  77. }
  78. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  79. {
  80. SelectPermanentEffect selectPermanentSourceStripEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  81. selectPermanentSourceStripEffect.SetUp(
  82. selectPlayer: card.Owner,
  83. canTargetCondition: CanSelectPermanentSourceStripCondition,
  84. canTargetCondition_ByPreSelecetedList: null,
  85. canEndSelectCondition: null,
  86. maxCount: 1,
  87. canNoSelect: false,
  88. canEndNotMax: false,
  89. selectPermanentCoroutine: SelectPermanentSourceStripCoroutine,
  90. afterSelectPermanentCoroutine: null,
  91. mode: SelectPermanentEffect.Mode.Custom,
  92. cardEffect: activateClass);
  93. selectPermanentSourceStripEffect.SetUpCustomMessage("Select 1 Digimon that will trash digivolution cards.",
  94. "The opponent is selecting 1 Digimon that will trash digivolution cards.");
  95. yield return ContinuousController.instance.StartCoroutine(selectPermanentSourceStripEffect.Activate());
  96. IEnumerator SelectPermanentSourceStripCoroutine(Permanent permanent)
  97. {
  98. yield return ContinuousController.instance.StartCoroutine(
  99. CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(targetPermanent: permanent,
  100. trashCount: 1, isFromTop: true, activateClass: activateClass));
  101. }
  102. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentStunCondition))
  103. {
  104. SelectPermanentEffect selectPermanentStunEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  105. selectPermanentStunEffect.SetUp(
  106. selectPlayer: card.Owner,
  107. canTargetCondition: CanSelectPermanentStunCondition,
  108. canTargetCondition_ByPreSelecetedList: null,
  109. canEndSelectCondition: null,
  110. maxCount: 1,
  111. canNoSelect: false,
  112. canEndNotMax: false,
  113. selectPermanentCoroutine: SelectPermanentStunCoroutine,
  114. afterSelectPermanentCoroutine: null,
  115. mode: SelectPermanentEffect.Mode.Custom,
  116. cardEffect: activateClass);
  117. selectPermanentStunEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  118. yield return ContinuousController.instance.StartCoroutine(selectPermanentStunEffect.Activate());
  119. IEnumerator SelectPermanentStunCoroutine(Permanent permanent)
  120. {
  121. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(
  122. targetPermanent: permanent,
  123. defenderCondition: null,
  124. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  125. activateClass: activateClass,
  126. effectName: "Can't Attack"));
  127. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(
  128. targetPermanent: permanent,
  129. attackerCondition: null,
  130. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  131. activateClass: activateClass,
  132. effectName: "Can't Block"));
  133. }
  134. }
  135. }
  136. }
  137. #endregion
  138. return cardEffects;
  139. }
  140. }
  141. }