BT14_042.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT14
  4. {
  5. public class BT14_042 : 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("Suspend this Digimon to reveal the top 3 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] By suspending this Digimon, reveal the top 3 cards of your deck. Add 1 green card among them to the hand. Return the rest to the bottom of the deck.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. return cardSource.HasCardColor(CardColor.Green);
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  27. }
  28. bool CanActivateCondition(Hashtable hashtable)
  29. {
  30. if (CardEffectCommons.IsExistOnBattleArea(card))
  31. {
  32. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  33. {
  34. return true;
  35. }
  36. }
  37. return false;
  38. }
  39. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  40. {
  41. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  42. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  43. revealCount: 3,
  44. simplifiedSelectCardConditions:
  45. new SimplifiedSelectCardConditionClass[]
  46. {
  47. new SimplifiedSelectCardConditionClass(
  48. canTargetCondition:CanSelectCardCondition,
  49. message: "Select 1 green card.",
  50. mode: SelectCardEffect.Mode.AddHand,
  51. maxCount: 1,
  52. selectCardCoroutine: null),
  53. },
  54. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  55. activateClass: activateClass
  56. ));
  57. }
  58. }
  59. return cardEffects;
  60. }
  61. }
  62. }