BT12_080.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT12
  4. {
  5. public class BT12_080 : 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 purple or black Digimon card among them to your hand. Place the rest at the top or bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.HasCardColor(CardColor.Black))
  25. {
  26. return true;
  27. }
  28. if (cardSource.HasCardColor(CardColor.Purple))
  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 purple or black Digimon card.",
  60. mode: SelectCardEffect.Mode.AddHand,
  61. maxCount: 1,
  62. selectCardCoroutine: null),
  63. },
  64. remainingCardsPlace: RemainingCardsPlace.DeckTopOrBottom,
  65. activateClass: activateClass
  66. ));
  67. }
  68. }
  69. if (timing == EffectTiming.OnEnterFieldAnyone)
  70. {
  71. ActivateClass activateClass = new ActivateClass();
  72. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  73. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  74. cardEffects.Add(activateClass);
  75. string EffectDiscription()
  76. {
  77. return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 purple or black Digimon card among them to your hand. Place the rest at the top or bottom of your deck in any order.";
  78. }
  79. bool CanSelectCardCondition(CardSource cardSource)
  80. {
  81. if (cardSource.IsDigimon)
  82. {
  83. if (cardSource.HasCardColor(CardColor.Black))
  84. {
  85. return true;
  86. }
  87. if (cardSource.HasCardColor(CardColor.Purple))
  88. {
  89. return true;
  90. }
  91. }
  92. return false;
  93. }
  94. bool CanUseCondition(Hashtable hashtable)
  95. {
  96. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  97. }
  98. bool CanActivateCondition(Hashtable hashtable)
  99. {
  100. if (CardEffectCommons.IsExistOnBattleArea(card))
  101. {
  102. if (card.Owner.LibraryCards.Count >= 1)
  103. {
  104. return true;
  105. }
  106. }
  107. return false;
  108. }
  109. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  110. {
  111. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  112. revealCount: 3,
  113. simplifiedSelectCardConditions:
  114. new SimplifiedSelectCardConditionClass[]
  115. {
  116. new SimplifiedSelectCardConditionClass(
  117. canTargetCondition:CanSelectCardCondition,
  118. message: "Select 1 purple or black Digimon card.",
  119. mode: SelectCardEffect.Mode.AddHand,
  120. maxCount: 1,
  121. selectCardCoroutine: null),
  122. },
  123. remainingCardsPlace: RemainingCardsPlace.DeckTopOrBottom,
  124. activateClass: activateClass
  125. ));
  126. }
  127. }
  128. if (timing == EffectTiming.None)
  129. {
  130. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  131. }
  132. return cardEffects;
  133. }
  134. }
  135. }