ST19_03.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST19
  4. {
  5. public class ST19_03 : 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 [Puppet] trait and 1 card with the [LIBERATOR] trait among them to the hand. Return the rest to the bottom of the deck.";
  22. }
  23. bool CanSelectPuppetCardCondition(CardSource cardSource)
  24. {
  25. return cardSource.ContainsTraits("Puppet");
  26. }
  27. bool CanSelectLiberatorCardCondition(CardSource cardSource)
  28. {
  29. return cardSource.ContainsTraits("Liberator") || cardSource.ContainsTraits("LIBERATOR");
  30. }
  31. bool CanUseCondition(Hashtable hashtable)
  32. {
  33. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  34. }
  35. bool CanActivateCondition(Hashtable hashtable)
  36. {
  37. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  38. card.Owner.LibraryCards.Count >= 1;
  39. }
  40. IEnumerator ActivateCoroutine(Hashtable hashtable)
  41. {
  42. yield return ContinuousController.instance.StartCoroutine(
  43. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  44. revealCount: 3,
  45. simplifiedSelectCardConditions:
  46. new SimplifiedSelectCardConditionClass[]
  47. {
  48. new(
  49. canTargetCondition: CanSelectPuppetCardCondition,
  50. message: "Select 1 Digimon card with the [Puppet] in one of its traits.",
  51. mode: SelectCardEffect.Mode.AddHand,
  52. maxCount: 1,
  53. selectCardCoroutine: null),
  54. new(
  55. canTargetCondition: CanSelectLiberatorCardCondition,
  56. message: "Select 1 card with the [LIBERATOR] trait.",
  57. mode: SelectCardEffect.Mode.AddHand,
  58. maxCount: 1,
  59. selectCardCoroutine: null),
  60. },
  61. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  62. activateClass: activateClass
  63. ));
  64. }
  65. }
  66. #endregion
  67. #region Your Turn - ESS
  68. if (timing == EffectTiming.None)
  69. {
  70. bool CardCondition(CardSource cardSource)
  71. {
  72. return cardSource.Owner == card.Owner.Enemy;
  73. }
  74. bool Condition()
  75. {
  76. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  77. CardEffectCommons.IsOwnerTurn(card);
  78. }
  79. cardEffects.Add(CardEffectFactory.ChangeSecurityDigimonCardDPStaticEffect(
  80. cardCondition: CardCondition,
  81. changeValue: -3000,
  82. isInheritedEffect: true,
  83. card: card,
  84. condition: Condition,
  85. effectName: "Opponent's Security Digimon gains DP -3000"));
  86. }
  87. #endregion
  88. return cardEffects;
  89. }
  90. }
  91. }