BT1_010.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. public class BT1_010 : CEntity_Effect
  4. {
  5. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  6. {
  7. List<ICardEffect> cardEffects = new List<ICardEffect>();
  8. if (timing == EffectTiming.OnEnterFieldAnyone)
  9. {
  10. ActivateClass activateClass = new ActivateClass();
  11. activateClass.SetUpICardEffect("Reveal the top 5 cards of deck", CanUseCondition, card);
  12. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  13. cardEffects.Add(activateClass);
  14. string EffectDiscription()
  15. {
  16. return "[On Play] Reveal 5 cards from the top of your deck. Add 1 Tamer card among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  17. }
  18. bool CanSelectCardCondition(CardSource cardSource)
  19. {
  20. return cardSource.IsTamer;
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  25. }
  26. bool CanActivateCondition(Hashtable hashtable)
  27. {
  28. if (CardEffectCommons.IsExistOnBattleArea(card))
  29. {
  30. if (card.Owner.LibraryCards.Count >= 1)
  31. {
  32. return true;
  33. }
  34. }
  35. return false;
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  38. {
  39. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  40. revealCount: 5,
  41. simplifiedSelectCardConditions:
  42. new SimplifiedSelectCardConditionClass[]
  43. {
  44. new SimplifiedSelectCardConditionClass(
  45. canTargetCondition:CanSelectCardCondition,
  46. message: "Select 1 Tamer card.",
  47. mode: SelectCardEffect.Mode.AddHand,
  48. maxCount: 1,
  49. selectCardCoroutine: null),
  50. },
  51. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  52. activateClass: activateClass
  53. ));
  54. }
  55. }
  56. return cardEffects;
  57. }
  58. }