BT14_088.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT14
  4. {
  5. public class BT14_088 : 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 5 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] You may reveal the top 5 cards of your deck. Add 1 level 3 Digimon card and 1 non-white Tamer card 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.Level == 3)
  25. {
  26. if (cardSource.HasLevel)
  27. {
  28. return true;
  29. }
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanSelectCardCondition1(CardSource cardSource)
  35. {
  36. if (cardSource.IsTamer)
  37. {
  38. if (!cardSource.HasCardColor(CardColor.White))
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (card.Owner.LibraryCards.Count >= 1)
  54. {
  55. return true;
  56. }
  57. }
  58. return false;
  59. }
  60. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  63. revealCount: 5,
  64. simplifiedSelectCardConditions:
  65. new SimplifiedSelectCardConditionClass[]
  66. {
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition,
  69. message: "Select 1 level 3 Digimon card.",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. new SimplifiedSelectCardConditionClass(
  74. canTargetCondition:CanSelectCardCondition1,
  75. message: "Select 1 non-white Tamer card.",
  76. mode: SelectCardEffect.Mode.AddHand,
  77. maxCount: 1,
  78. selectCardCoroutine: null),
  79. },
  80. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  81. activateClass: activateClass
  82. ));
  83. }
  84. }
  85. if (timing == EffectTiming.OnAllyAttack)
  86. {
  87. ActivateClass activateClass = new ActivateClass();
  88. activateClass.SetUpICardEffect("Move your Digimon", CanUseCondition, card);
  89. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  90. cardEffects.Add(activateClass);
  91. string EffectDiscription()
  92. {
  93. return "[Opponent's Turn] When an opponent's level 5 or higher Digimon attacks, by suspending this Tamer, move 1 of your Digimon from the breeding area to the battle area.";
  94. }
  95. bool PermanentCondition(Permanent permanent)
  96. {
  97. if (CardEffectCommons.IsOpponentPermanent(permanent, card))
  98. {
  99. if (permanent.TopCard.HasLevel)
  100. {
  101. if (permanent.TopCard.Level >= 5)
  102. {
  103. return true;
  104. }
  105. }
  106. }
  107. return false;
  108. }
  109. bool CanUseCondition(Hashtable hashtable)
  110. {
  111. if (CardEffectCommons.IsExistOnBattleArea(card))
  112. {
  113. if (CardEffectCommons.IsOpponentTurn(card))
  114. {
  115. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  116. {
  117. return true;
  118. }
  119. }
  120. }
  121. return false;
  122. }
  123. bool CanActivateCondition(Hashtable hashtable)
  124. {
  125. if (CardEffectCommons.IsExistOnBattleArea(card))
  126. {
  127. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  128. {
  129. return true;
  130. }
  131. }
  132. return false;
  133. }
  134. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  135. {
  136. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  137. if (card.Owner.CanMove)
  138. {
  139. yield return ContinuousController.instance.StartCoroutine(CardObjectController.MovePermanent(card.Owner.GetBreedingAreaPermanents()[0].PermanentFrame));
  140. }
  141. }
  142. }
  143. if (timing == EffectTiming.SecuritySkill)
  144. {
  145. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  146. }
  147. return cardEffects;
  148. }
  149. }
  150. }