BT24_020.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. // Gomamon
  6. namespace DCGO.CardEffects.BT24
  7. {
  8. public class BT24_020 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Alt Digivolution Condition
  14. if (timing == EffectTiming.None)
  15. {
  16. static bool PermanentCondition(Permanent targetPermanent)
  17. {
  18. return targetPermanent.TopCard.IsLevel2 && targetPermanent.TopCard.HasTSTraits;
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  21. }
  22. #endregion
  23. #region On Play - Search 3
  24. if (timing == EffectTiming.OnEnterFieldAnyone)
  25. {
  26. ActivateClass activateClass = new ActivateClass();
  27. activateClass.SetUpICardEffect("Reveal 3 from deck. Add 1 [Sea Beast], [Shaman], [Aqua] or [Sea Animal] and 1 [TS].", CanUseCondition, card);
  28. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  29. cardEffects.Add(activateClass);
  30. string EffectDescription()
  31. {
  32. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with the [Sea Beast] or [Shaman] trait or [Aqua] or [Sea Animal] in any of its traits and 1 card with the [TS] trait among them to the hand. Return the rest to the bottom of the deck.";
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.IsExistOnBattleArea(card);
  41. }
  42. bool CanSelectCardCondition(CardSource card)
  43. {
  44. return card.IsDigimon &&
  45. (card.EqualsTraits("Sea Beast") ||
  46. card.EqualsTraits("Shaman") ||
  47. card.ContainsTraits("Aqua") ||
  48. card.ContainsTraits("Sea Animal")
  49. );
  50. }
  51. bool CanSelectCardCondition1(CardSource card)
  52. {
  53. return card.HasTSTraits;
  54. }
  55. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  56. {
  57. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  58. revealCount: 3,
  59. simplifiedSelectCardConditions:
  60. new SimplifiedSelectCardConditionClass[]
  61. {
  62. new SimplifiedSelectCardConditionClass(
  63. canTargetCondition:CanSelectCardCondition,
  64. message: "Select 1 Digimon with [Sea Beast] or [Shaman] trait or [Aqua] or [Sea Animal] in any of its traits.",
  65. mode: SelectCardEffect.Mode.AddHand,
  66. maxCount: 1,
  67. selectCardCoroutine: null),
  68. new SimplifiedSelectCardConditionClass(
  69. canTargetCondition:CanSelectCardCondition1,
  70. message: "Select 1 card with the [TS] trait.",
  71. mode: SelectCardEffect.Mode.AddHand,
  72. maxCount: 1,
  73. selectCardCoroutine: null),
  74. },
  75. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  76. activateClass: activateClass
  77. ));
  78. }
  79. }
  80. #endregion
  81. #region ESS
  82. if (timing == EffectTiming.OnUnTappedAnyone)
  83. {
  84. ActivateClass activateClass = new ActivateClass();
  85. activateClass.SetUpICardEffect("If you have 7 or fewer cards in hand, <Draw 1>.", CanUseCondition, card);
  86. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  87. activateClass.SetIsInheritedEffect(true);
  88. activateClass.SetHashString("BT24_020_YT_Draw1");
  89. cardEffects.Add(activateClass);
  90. string EffectDiscription()
  91. => "[Your Turn] [Once Per Turn] When this Digimon unsuspends, if you have 7 or fewer cards in your hand, <Draw 1>.";
  92. bool CanUseCondition(Hashtable hashtable)
  93. {
  94. return CardEffectCommons.IsExistOnBattleArea(card) &&
  95. CardEffectCommons.IsOwnerTurn(card) &&
  96. CardEffectCommons.CanTriggerWhenPermanentUnsuspends(hashtable, permanent => permanent == card.PermanentOfThisCard());
  97. }
  98. bool CanActivateCondition(Hashtable hashtable)
  99. {
  100. return CardEffectCommons.IsExistOnBattleArea(card) &&
  101. card.Owner.HandCards.Count <= 7;
  102. }
  103. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  104. {
  105. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  106. }
  107. }
  108. #endregion
  109. return cardEffects;
  110. }
  111. }
  112. }