EX7_007.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX7
  4. {
  5. public class EX7_007 : 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 the deck", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "Reveal the top 3 cards of your deck. Add 1 card with the [Rock Dragon]/[Earth Dragon]/[Machine Dragon]/[Sky Dragon] trait and 1 [Hina Kurihara] among them to the hand. Return the rest to the bottom of the deck.";
  20. }
  21. bool CanSelectCardCondition(CardSource cardSource)
  22. {
  23. if (cardSource.ContainsTraits("Rock Dragon") || cardSource.ContainsTraits("Earth Dragon") || cardSource.ContainsTraits("Machine Dragon") || cardSource.ContainsTraits("Sky Dragon"))
  24. {
  25. return true;
  26. }
  27. return false;
  28. }
  29. bool CanSelectCardCondition1(CardSource cardSource)
  30. {
  31. if (cardSource.EqualsCardName("Hina Kurihara"))
  32. {
  33. return true;
  34. }
  35. return false;
  36. }
  37. bool CanUseCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  40. }
  41. bool CanActivateCondition(Hashtable hashtable)
  42. {
  43. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  44. {
  45. if (card.Owner.LibraryCards.Count >= 1)
  46. {
  47. return true;
  48. }
  49. }
  50. return false;
  51. }
  52. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  53. {
  54. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  55. revealCount: 3,
  56. simplifiedSelectCardConditions:
  57. new SimplifiedSelectCardConditionClass[]
  58. {
  59. new SimplifiedSelectCardConditionClass(
  60. canTargetCondition:CanSelectCardCondition,
  61. message: "Select 1 card with the [Rock Dragon]/[Earth Dragon]/[Machine Dragon]/[Sky Dragon] trait.",
  62. mode: SelectCardEffect.Mode.AddHand,
  63. maxCount: 1,
  64. selectCardCoroutine: null),
  65. new SimplifiedSelectCardConditionClass(
  66. canTargetCondition:CanSelectCardCondition1,
  67. message: "Select 1 [Hina Kurihara].",
  68. mode: SelectCardEffect.Mode.AddHand,
  69. maxCount: 1,
  70. selectCardCoroutine: null),
  71. },
  72. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  73. activateClass: activateClass
  74. ));
  75. }
  76. }
  77. #endregion
  78. #region Inherit
  79. if (timing == EffectTiming.None)
  80. {
  81. bool Condition()
  82. {
  83. if (CardEffectCommons.IsOwnerTurn(card))
  84. {
  85. return true;
  86. }
  87. return false;
  88. }
  89. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  90. changeValue: 2000,
  91. isInheritedEffect: true,
  92. card: card,
  93. condition: Condition));
  94. }
  95. #endregion
  96. return cardEffects;
  97. }
  98. }
  99. }