BT15_083.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT15
  4. {
  5. public class BT15_083 : 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, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Gabumon] or [Garurumon] in its name among them to the hand. Return the rest to the bottom of the deck.";
  20. }
  21. bool CanSelectCardCondition(CardSource cardSource)
  22. {
  23. if (cardSource.HasGarurumonName)
  24. {
  25. return true;
  26. }
  27. if (cardSource.ContainsCardName("Gabumon"))
  28. {
  29. return true;
  30. }
  31. return false;
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  36. }
  37. bool CanActivateCondition(Hashtable hashtable)
  38. {
  39. if (CardEffectCommons.IsExistOnBattleArea(card))
  40. {
  41. if (card.Owner.LibraryCards.Count >= 1)
  42. {
  43. return true;
  44. }
  45. }
  46. return false;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  49. {
  50. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  51. revealCount: 3,
  52. simplifiedSelectCardConditions:
  53. new SimplifiedSelectCardConditionClass[]
  54. {
  55. new SimplifiedSelectCardConditionClass(
  56. canTargetCondition:CanSelectCardCondition,
  57. message: "Select 1 Digimon card.",
  58. mode: SelectCardEffect.Mode.AddHand,
  59. maxCount: 1,
  60. selectCardCoroutine: null),
  61. },
  62. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  63. activateClass: activateClass
  64. ));
  65. }
  66. }
  67. #endregion
  68. #region Your Turn
  69. if (timing == EffectTiming.OnAddHand)
  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 one of your Digimon's effects adds cards to your hand, by suspending this Tamer, gain 1 memory.";
  78. }
  79. bool CanUseCondition(Hashtable hashtable)
  80. {
  81. if (CardEffectCommons.IsExistOnBattleArea(card))
  82. {
  83. if (CardEffectCommons.IsOwnerTurn(card))
  84. {
  85. bool CardEffectCondition(ICardEffect cardEffect)
  86. {
  87. if (CardEffectCommons.IsOwnerEffect(cardEffect, card))
  88. {
  89. if (cardEffect.IsDigimonEffect)
  90. {
  91. return true;
  92. }
  93. }
  94. return false;
  95. }
  96. if (CardEffectCommons.CanTriggerWhenAddHand(
  97. hashtable,
  98. player => player == card.Owner,
  99. CardEffectCondition))
  100. {
  101. return true;
  102. }
  103. }
  104. }
  105. return false;
  106. }
  107. bool CanActivateCondition(Hashtable hashtable)
  108. {
  109. if (CardEffectCommons.IsExistOnBattleArea(card))
  110. {
  111. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  112. {
  113. return true;
  114. }
  115. }
  116. return false;
  117. }
  118. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  119. {
  120. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  121. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  122. }
  123. }
  124. #endregion
  125. //Security Effect
  126. if (timing == EffectTiming.SecuritySkill)
  127. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  128. return cardEffects;
  129. }
  130. }
  131. }