ST18_04.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST18
  4. {
  5. public class ST18_04 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region On Play
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
  16. EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return
  21. "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Bird]/[Avian] in one of its traits and 1 card with the [Vortex Warriors]/[LIBERATOR] trait among them to the hand. Return the rest to the bottom of the deck.";
  22. }
  23. bool CanSelectBirdCardCondition(CardSource cardSource)
  24. {
  25. return cardSource.ContainsTraits("Bird") ||
  26. cardSource.ContainsTraits("Avian");
  27. }
  28. bool CanSelectLiberatorCardCondition(CardSource cardSource)
  29. {
  30. return cardSource.EqualsTraits("Vortex Warriors") ||
  31. cardSource.EqualsTraits("LIBERATOR");
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  36. }
  37. bool CanActivateCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  40. card.Owner.LibraryCards.Count >= 1;
  41. }
  42. IEnumerator ActivateCoroutine(Hashtable hashtable)
  43. {
  44. yield return ContinuousController.instance.StartCoroutine(
  45. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  46. revealCount: 3,
  47. simplifiedSelectCardConditions:
  48. new SimplifiedSelectCardConditionClass[]
  49. {
  50. new(
  51. canTargetCondition: CanSelectBirdCardCondition,
  52. message: "Select 1 card with the [Bird]/[Avian] in one of its traits.",
  53. mode: SelectCardEffect.Mode.AddHand,
  54. maxCount: 1,
  55. selectCardCoroutine: null),
  56. new(
  57. canTargetCondition: CanSelectLiberatorCardCondition,
  58. message: "Select 1 card with the [Vortex Warriors]/[LIBERATOR] trait.",
  59. mode: SelectCardEffect.Mode.AddHand,
  60. maxCount: 1,
  61. selectCardCoroutine: null),
  62. },
  63. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  64. activateClass: activateClass
  65. ));
  66. }
  67. }
  68. #endregion
  69. #region Your Turn - ESS
  70. if (timing == EffectTiming.None)
  71. {
  72. bool Condition()
  73. {
  74. return CardEffectCommons.IsOwnerTurn(card);
  75. }
  76. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  77. changeValue: 2000,
  78. isInheritedEffect: true,
  79. card: card,
  80. condition: Condition));
  81. }
  82. #endregion
  83. return cardEffects;
  84. }
  85. }
  86. }