BT13_048.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_048 : 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 3 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 3 cards of your deck. Add 1 Digimon card with [Beast], [Animal], or [Sovereign], other than [Sea Animal], in one of its traits and 1 Digimon card with the [Royal Knight] trait among them to the hand. Place the rest at the bottom of the deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.HasBeastTraits)
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanSelectCardCondition1(CardSource cardSource)
  32. {
  33. if (cardSource.IsDigimon)
  34. {
  35. if (cardSource.HasRoyalKnightTraits)
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  45. }
  46. bool CanActivateCondition(Hashtable hashtable)
  47. {
  48. if (CardEffectCommons.IsExistOnBattleArea(card))
  49. {
  50. if (card.Owner.LibraryCards.Count >= 1)
  51. {
  52. return true;
  53. }
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  60. revealCount: 3,
  61. simplifiedSelectCardConditions:
  62. new SimplifiedSelectCardConditionClass[]
  63. {
  64. new SimplifiedSelectCardConditionClass(
  65. canTargetCondition:CanSelectCardCondition,
  66. message: "Select 1 Digimon card with [Beast], [Animal], or [Sovereign], other than [Sea Animal], in one of its traits.",
  67. mode: SelectCardEffect.Mode.AddHand,
  68. maxCount: 1,
  69. selectCardCoroutine: null),
  70. new SimplifiedSelectCardConditionClass(
  71. canTargetCondition:CanSelectCardCondition1,
  72. message: "Select 1 Digimon card with the [Royal Knight] trait.",
  73. mode: SelectCardEffect.Mode.AddHand,
  74. maxCount: 1,
  75. selectCardCoroutine: null),
  76. },
  77. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  78. activateClass: activateClass
  79. ));
  80. }
  81. }
  82. if (timing == EffectTiming.None)
  83. {
  84. bool Condition()
  85. {
  86. if (CardEffectCommons.IsExistOnBattleArea(card))
  87. {
  88. if (CardEffectCommons.IsOwnerTurn(card))
  89. {
  90. if (card.PermanentOfThisCard().TopCard.HasBeastTraits)
  91. {
  92. return true;
  93. }
  94. if (card.PermanentOfThisCard().TopCard.HasRoyalKnightTraits)
  95. {
  96. return true;
  97. }
  98. }
  99. }
  100. return false;
  101. }
  102. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  103. }
  104. return cardEffects;
  105. }
  106. }
  107. }