BT11_089.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_089 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] Reveal the top 4 cards of your deck. Add 1 red Digimon card with [Vaccine] in its traits among them to your hand. Place the rest at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.HasCardColor(CardColor.Red))
  23. {
  24. if (cardSource.IsDigimon)
  25. {
  26. if (cardSource.CardTraits.Contains("Vaccine"))
  27. {
  28. return true;
  29. }
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (card.Owner.LibraryCards.Count >= 1)
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  52. revealCount: 4,
  53. simplifiedSelectCardConditions:
  54. new SimplifiedSelectCardConditionClass[]
  55. {
  56. new SimplifiedSelectCardConditionClass(
  57. canTargetCondition:CanSelectCardCondition,
  58. message: "Select 1 red Digimon card with [Vaccine] in its traits.",
  59. mode: SelectCardEffect.Mode.AddHand,
  60. maxCount: 1,
  61. selectCardCoroutine: null),
  62. },
  63. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  64. activateClass: activateClass
  65. ));
  66. }
  67. }
  68. if (timing == EffectTiming.OnEnterFieldAnyone)
  69. {
  70. ActivateClass activateClass = new ActivateClass();
  71. activateClass.SetUpICardEffect("Played Digimon gets Rush", CanUseCondition, card);
  72. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  73. cardEffects.Add(activateClass);
  74. string EffectDiscription()
  75. {
  76. return "[Your Turn] When you play a red Digimon with [Avian], [Bird], [Beast], [Animal], or [Sovereign] in its traits by an effect, by suspending this Tamer, that Digimon gains <Rush> for the turn.";
  77. }
  78. bool PermanentCondition(Permanent permanent)
  79. {
  80. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  81. {
  82. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  83. {
  84. if (permanent.TopCard.HasAvianBeastAnimalTraits)
  85. {
  86. return true;
  87. }
  88. }
  89. }
  90. return false;
  91. }
  92. bool CanUseCondition(Hashtable hashtable)
  93. {
  94. if (CardEffectCommons.IsExistOnBattleArea(card))
  95. {
  96. if (CardEffectCommons.IsOwnerTurn(card))
  97. {
  98. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  99. {
  100. if (CardEffectCommons.IsByEffect(hashtable, null))
  101. {
  102. return true;
  103. }
  104. }
  105. }
  106. }
  107. return false;
  108. }
  109. bool CanActivateCondition(Hashtable hashtable)
  110. {
  111. if (CardEffectCommons.IsExistOnBattleArea(card))
  112. {
  113. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  114. {
  115. return true;
  116. }
  117. }
  118. return false;
  119. }
  120. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  121. {
  122. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  123. List<Permanent> permanents = CardEffectCommons.GetPlayedPermanentsFromEnterFieldHashtable(
  124. hashtable: _hashtable,
  125. rootCondition: null);
  126. if (permanents != null)
  127. {
  128. foreach (Permanent permanent in permanents.Filter(PermanentCondition).Clone())
  129. {
  130. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
  131. targetPermanent: permanent,
  132. effectDuration: EffectDuration.UntilEachTurnEnd,
  133. activateClass: activateClass));
  134. }
  135. }
  136. }
  137. }
  138. if (timing == EffectTiming.SecuritySkill)
  139. {
  140. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  141. }
  142. return cardEffects;
  143. }
  144. }
  145. }