BT11_023.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_023 : 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 [Veedramon] in its name and 1 blue Tamer card among them to your hand. Place the rest at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.ContainsCardName("Veedramon"))
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanSelectCardCondition1(CardSource cardSource)
  32. {
  33. if (cardSource.IsTamer)
  34. {
  35. if (cardSource.HasCardColor(CardColor.Blue))
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  45. }
  46. bool CanActivateCondition(Hashtable hashtable)
  47. {
  48. if (CardEffectCommons.IsExistOnBattleArea(card))
  49. {
  50. if (card.Owner.LibraryCards.Count >= 1)
  51. {
  52. return true;
  53. }
  54. }
  55. return false;
  56. }
  57. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  58. {
  59. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  60. revealCount: 3,
  61. simplifiedSelectCardConditions:
  62. new SimplifiedSelectCardConditionClass[]
  63. {
  64. new SimplifiedSelectCardConditionClass(
  65. canTargetCondition:CanSelectCardCondition,
  66. message: "Select 1 Digimon card with [Veedramon] in its name.",
  67. mode: SelectCardEffect.Mode.AddHand,
  68. maxCount: 1,
  69. selectCardCoroutine: null),
  70. new SimplifiedSelectCardConditionClass(
  71. canTargetCondition:CanSelectCardCondition1,
  72. message: "Select 1 blue Tamer card.",
  73. mode: SelectCardEffect.Mode.AddHand,
  74. maxCount: 1,
  75. selectCardCoroutine: null),
  76. },
  77. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  78. activateClass: activateClass,
  79. mutualConditions: true
  80. ));
  81. }
  82. }
  83. if (timing == EffectTiming.OnEnterFieldAnyone)
  84. {
  85. ActivateClass activateClass = new ActivateClass();
  86. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  87. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  88. activateClass.SetIsInheritedEffect(true);
  89. activateClass.SetHashString("Memory+1_BT11_023");
  90. cardEffects.Add(activateClass);
  91. string EffectDiscription()
  92. {
  93. return "[Your Turn][Once Per Turn] When you play a blue Tamer, gain 1 memory.";
  94. }
  95. bool PermanentCondition(Permanent permanent)
  96. {
  97. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  98. {
  99. if (permanent.TopCard.CardColors.Contains(CardColor.Blue))
  100. {
  101. if (permanent.IsTamer)
  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.IsOwnerTurn(card))
  114. {
  115. if (CardEffectCommons.CanTriggerOnPermanentPlay(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. return true;
  128. }
  129. return false;
  130. }
  131. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  132. {
  133. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  134. }
  135. }
  136. return cardEffects;
  137. }
  138. }
  139. }