ST20_02.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // ST20-02 biyomon
  4. namespace DCGO.CardEffects.ST20
  5. {
  6. public class ST20_02 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternate Digivolution Requirement
  12. if (timing == EffectTiming.None)
  13. {
  14. static bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.HasAdventureTraits && targetPermanent.TopCard.Level == 2;
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. #endregion
  21. #region On Play
  22. if (timing == EffectTiming.OnEnterFieldAnyone)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Reveal 3, add 1 adventure digimon and 1 adventure option or tamer", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  27. cardEffects.Add(activateClass);
  28. string EffectDiscription()
  29. {
  30. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with the [ADVENTURE] trait and 1 such Tamer or Option card among them to the hand. Return the rest to the bottom of the deck.";
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  35. }
  36. bool CanActivateCondition(Hashtable hashtable)
  37. {
  38. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card)) {
  39. return card.Owner.LibraryCards.Count >= 1;
  40. }
  41. return false;
  42. }
  43. bool selectAdventureDigimon(CardSource source)
  44. {
  45. return source.HasAdventureTraits && source.IsDigimon;
  46. }
  47. bool selectAdventureTorO(CardSource source)
  48. {
  49. return source.HasAdventureTraits && (source.IsOption || source.IsTamer);
  50. }
  51. IEnumerator ActivateCoroutine(Hashtable hashtable)
  52. {
  53. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  54. revealCount: 3,
  55. simplifiedSelectCardConditions:
  56. new SimplifiedSelectCardConditionClass[]
  57. {
  58. new SimplifiedSelectCardConditionClass(
  59. canTargetCondition:selectAdventureDigimon,
  60. message: "Select 1 Digimon with the [ADVENTURE] trait.",
  61. mode: SelectCardEffect.Mode.AddHand,
  62. maxCount: 1,
  63. selectCardCoroutine: null),
  64. new SimplifiedSelectCardConditionClass(
  65. canTargetCondition:selectAdventureTorO,
  66. message: "Select 1 Option or Tamer with the [ADVENTURE] trait",
  67. mode: SelectCardEffect.Mode.AddHand,
  68. maxCount: 1,
  69. selectCardCoroutine: null),
  70. },
  71. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  72. activateClass: activateClass
  73. ));
  74. }
  75. }
  76. #endregion
  77. #region Your Turn - ESS
  78. if (timing == EffectTiming.None)
  79. {
  80. bool Condition()
  81. {
  82. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  83. CardEffectCommons.IsOwnerTurn(card);
  84. }
  85. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  86. changeValue: 2000,
  87. isInheritedEffect: true,
  88. card: card,
  89. condition: Condition));
  90. }
  91. #endregion
  92. return cardEffects;
  93. }
  94. }
  95. }