Neemon_BT18_031.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class Neemon_BT18_031 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region On Play
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false,
  16. EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return
  21. "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Hybrid]/[Ten Warriors] trait and 1 yellow Tamer card with an inherited effect among them to the hand. Return the rest to the bottom of the deck.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  26. }
  27. bool CanSelectHybridCardCondition(CardSource cardSource)
  28. {
  29. return cardSource.HasHybridTenWarriorsTraits;
  30. }
  31. bool CanSelectTamerCardCondition(CardSource cardSource)
  32. {
  33. return cardSource.CardColors.Contains(CardColor.Yellow) && cardSource.IsTamer && cardSource.HasInheritedEffect;
  34. }
  35. bool CanActivateCondition(Hashtable hashtable)
  36. {
  37. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  38. card.Owner.LibraryCards.Count >= 1;
  39. }
  40. IEnumerator ActivateCoroutine(Hashtable hashtable)
  41. {
  42. yield return ContinuousController.instance.StartCoroutine(
  43. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  44. revealCount: 3,
  45. simplifiedSelectCardConditions:
  46. new SimplifiedSelectCardConditionClass[]
  47. {
  48. new(
  49. canTargetCondition: CanSelectHybridCardCondition,
  50. message: "Select 1 card with the [Hybrid]/[Ten Warriors] trait.",
  51. mode: SelectCardEffect.Mode.AddHand,
  52. maxCount: 1,
  53. selectCardCoroutine: null),
  54. new(
  55. canTargetCondition: CanSelectTamerCardCondition,
  56. message: "Select 1 yellow Tamer card with an inherited effect.",
  57. mode: SelectCardEffect.Mode.AddHand,
  58. maxCount: 1,
  59. selectCardCoroutine: null),
  60. },
  61. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  62. activateClass: activateClass
  63. ));
  64. }
  65. }
  66. #endregion
  67. #region Your Turn
  68. if (timing == EffectTiming.OnEnterFieldAnyone)
  69. {
  70. ActivateClass activateClass = new ActivateClass();
  71. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  72. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  73. activateClass.SetHashString("Memory+1_BT18_031");
  74. cardEffects.Add(activateClass);
  75. string EffectDescription()
  76. {
  77. return "[Your Turn] (Once Per Turn) When any of your Tamers with inherited effects are played, gain 1 memory.";
  78. }
  79. bool CanUseCondition(Hashtable hashtable)
  80. {
  81. return CardEffectCommons.IsExistOnBattleArea(card) &&
  82. CardEffectCommons.IsOwnerTurn(card) &&
  83. CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, TamerPermanentCondition);
  84. }
  85. bool TamerPermanentCondition(Permanent permanent)
  86. {
  87. return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card) &&
  88. permanent.IsTamer && permanent.TopCard.HasInheritedEffect;
  89. }
  90. bool CanActivateCondition(Hashtable hashtable)
  91. {
  92. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  93. }
  94. IEnumerator ActivateCoroutine(Hashtable hashtable)
  95. {
  96. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  97. }
  98. }
  99. #endregion
  100. return cardEffects;
  101. }
  102. }
  103. }