BT14_085.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT14
  4. {
  5. public class BT14_085 : 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 Digimon card with [Vegetation], [Plant] or [Fairy] in one of its traits among them to the hand. Return the rest to the bottom of the deck.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.HasPlantTraits)
  25. {
  26. return true;
  27. }
  28. if (cardSource.HasFairyTraits)
  29. {
  30. return true;
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  38. }
  39. bool CanActivateCondition(Hashtable hashtable)
  40. {
  41. if (CardEffectCommons.IsExistOnBattleArea(card))
  42. {
  43. if (card.Owner.LibraryCards.Count >= 1)
  44. {
  45. return true;
  46. }
  47. }
  48. return false;
  49. }
  50. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  51. {
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  53. revealCount: 3,
  54. simplifiedSelectCardConditions:
  55. new SimplifiedSelectCardConditionClass[]
  56. {
  57. new SimplifiedSelectCardConditionClass(
  58. canTargetCondition:CanSelectCardCondition,
  59. message: "Select 1 Digimon card with [Vegetation], [Plant] or [Fairy] in one of its traits.",
  60. mode: SelectCardEffect.Mode.AddHand,
  61. maxCount: 1,
  62. selectCardCoroutine: null),
  63. },
  64. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  65. activateClass: activateClass
  66. ));
  67. }
  68. }
  69. if (timing == EffectTiming.OnTappedAnyone)
  70. {
  71. ActivateClass activateClass = new ActivateClass();
  72. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  73. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  74. cardEffects.Add(activateClass);
  75. string EffectDiscription()
  76. {
  77. return "[Your Turn] When an effect suspends a Digimon, by suspending this Tamer, gain 1 memory.";
  78. }
  79. bool PermanentCondition(Permanent permanent)
  80. {
  81. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  82. {
  83. if (permanent.IsDigimon)
  84. {
  85. return true;
  86. }
  87. }
  88. return false;
  89. }
  90. bool CanUseCondition(Hashtable hashtable)
  91. {
  92. if (CardEffectCommons.IsExistOnBattleArea(card))
  93. {
  94. if (CardEffectCommons.IsOwnerTurn(card))
  95. {
  96. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  97. {
  98. if (CardEffectCommons.IsByEffect(hashtable, null))
  99. {
  100. return true;
  101. }
  102. }
  103. }
  104. }
  105. return false;
  106. }
  107. bool CanActivateCondition(Hashtable hashtable)
  108. {
  109. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  110. {
  111. return true;
  112. }
  113. return false;
  114. }
  115. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  116. {
  117. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  118. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  119. }
  120. }
  121. if (timing == EffectTiming.SecuritySkill)
  122. {
  123. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  124. }
  125. return cardEffects;
  126. }
  127. }
  128. }