EX3_003.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX3
  4. {
  5. public class EX3_003 : 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.OnAllyAttack)
  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 "[When Attacking] Reveal the top 3 cards of your deck. Add 1 Digimon card with [Dragon], [saur] or [Ceratopsian] in one of 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.IsDigimon)
  23. {
  24. if (cardSource.HasDragonTraits)
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanUseCondition(Hashtable hashtable)
  32. {
  33. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  34. }
  35. bool CanActivateCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleArea(card))
  38. {
  39. if (card.Owner.LibraryCards.Count >= 1)
  40. {
  41. return true;
  42. }
  43. }
  44. return false;
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  49. revealCount: 3,
  50. simplifiedSelectCardConditions:
  51. new SimplifiedSelectCardConditionClass[]
  52. {
  53. new SimplifiedSelectCardConditionClass(
  54. canTargetCondition:CanSelectCardCondition,
  55. message: "Select 1 Digimon card with [Dragon], [saur] or [Ceratopsian] in one of its traits.",
  56. mode: SelectCardEffect.Mode.AddHand,
  57. maxCount: 1,
  58. selectCardCoroutine: null),
  59. },
  60. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  61. activateClass: activateClass
  62. ));
  63. }
  64. }
  65. return cardEffects;
  66. }
  67. }
  68. }