BT15_055.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT15
  4. {
  5. public class BT15_055 : 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 3 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 3 cards of your deck. Add 1 card with the [Machine] or [Cyborg] trait and 1 black Tamer 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.CardTraits.Contains("Machine") || cardSource.CardTraits.Contains("Cyborg");
  23. }
  24. bool CanSelectCardCondition1(CardSource cardSource)
  25. {
  26. return cardSource.IsTamer && cardSource.HasCardColor(CardColor.Black);
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. if (CardEffectCommons.IsExistOnBattleArea(card))
  35. {
  36. if (card.Owner.LibraryCards.Count >= 1)
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  44. {
  45. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  46. revealCount: 3,
  47. simplifiedSelectCardConditions:
  48. new SimplifiedSelectCardConditionClass[]
  49. {
  50. new SimplifiedSelectCardConditionClass(
  51. canTargetCondition:CanSelectCardCondition,
  52. message: "Select 1 card with [Machine] or [Cyborg] in its traits.",
  53. mode: SelectCardEffect.Mode.AddHand,
  54. maxCount: 1,
  55. selectCardCoroutine: null),
  56. new SimplifiedSelectCardConditionClass(
  57. canTargetCondition:CanSelectCardCondition1,
  58. message: "Select 1 black Tamer card.",
  59. mode: SelectCardEffect.Mode.AddHand,
  60. maxCount: 1,
  61. selectCardCoroutine: null),
  62. },
  63. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  64. activateClass: activateClass
  65. ));
  66. }
  67. }
  68. if (timing == EffectTiming.None)
  69. {
  70. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  71. }
  72. return cardEffects;
  73. }
  74. }
  75. }