EX1_024.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_024 : 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 4 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 4 cards of your deck. Add 1 Digimon card with [Angel], [Archangel], or [Three Great Angels] in its traits among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.CardTraits.Contains("Angel"))
  25. {
  26. return true;
  27. }
  28. if (cardSource.CardTraits.Contains("Archangel"))
  29. {
  30. return true;
  31. }
  32. if (cardSource.CardTraits.Contains("Three Great Angels"))
  33. {
  34. return true;
  35. }
  36. if (cardSource.CardTraits.Contains("ThreeGreatAngels"))
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. bool CanUseCondition(Hashtable hashtable)
  44. {
  45. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  46. }
  47. bool CanActivateCondition(Hashtable hashtable)
  48. {
  49. if (CardEffectCommons.IsExistOnBattleArea(card))
  50. {
  51. if (card.Owner.LibraryCards.Count >= 1)
  52. {
  53. return true;
  54. }
  55. }
  56. return false;
  57. }
  58. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  59. {
  60. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  61. revealCount: 4,
  62. simplifiedSelectCardConditions:
  63. new SimplifiedSelectCardConditionClass[]
  64. {
  65. new SimplifiedSelectCardConditionClass(
  66. canTargetCondition:CanSelectCardCondition,
  67. message: "Select 1 Digimon card with [Angel], [Archangel], or [Three Great Angels] in its traits.",
  68. mode: SelectCardEffect.Mode.AddHand,
  69. maxCount: 1,
  70. selectCardCoroutine: null),
  71. },
  72. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  73. activateClass: activateClass
  74. ));
  75. }
  76. }
  77. return cardEffects;
  78. }
  79. }
  80. }