BT25_064.cs 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // ToyAgumon
  4. namespace DCGO.CardEffects.BT25
  5. {
  6. public class BT25_064 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alt Digivolution
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent permanent)
  15. {
  16. return permanent.TopCard.HasTSTraits;
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 0, false, card, null, level: 2));
  19. }
  20. #endregion
  21. #region On Play
  22. if (timing == EffectTiming.OnEnterFieldAnyone)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Reveal top 3, add 1 option & 1 [TS] trait to hand. bottom deck the rest", 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 Option card and 1 [TS] trait 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.IsExistOnBattleAreaDigimon(card)
  35. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  36. }
  37. bool CanActivateCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  40. }
  41. bool CanSelectOptionCardCondition(CardSource cardSource)
  42. {
  43. return cardSource.IsOption;
  44. }
  45. bool CanSelectTSTraitCardCondition(CardSource cardSource)
  46. {
  47. return cardSource.HasTSTraits;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  52. revealCount: 3,
  53. simplifiedSelectCardConditions:
  54. new SimplifiedSelectCardConditionClass[]
  55. {
  56. new SimplifiedSelectCardConditionClass(
  57. canTargetCondition:CanSelectOptionCardCondition,
  58. message: "Select 1 Option card.",
  59. mode: SelectCardEffect.Mode.AddHand,
  60. maxCount: 1,
  61. selectCardCoroutine: null),
  62. new SimplifiedSelectCardConditionClass(
  63. canTargetCondition:CanSelectTSTraitCardCondition,
  64. message: "Select 1 [TS] trait card.",
  65. mode: SelectCardEffect.Mode.AddHand,
  66. maxCount: 1,
  67. selectCardCoroutine: null),
  68. },
  69. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  70. mutualConditions: true,
  71. activateClass: activateClass
  72. ));
  73. }
  74. }
  75. #endregion
  76. #region Reboot
  77. if (timing == EffectTiming.None)
  78. {
  79. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  80. }
  81. #endregion
  82. return cardEffects;
  83. }
  84. }
  85. }