EX7_008.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX7
  4. {
  5. public class EX7_008 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Digivolution Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.HasText("Three Musketeers") && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 2;
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  18. }
  19. #endregion
  20. #region On Play
  21. if (timing == EffectTiming.OnEnterFieldAnyone)
  22. {
  23. ActivateClass activateClass = new ActivateClass();
  24. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  25. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  26. cardEffects.Add(activateClass);
  27. string EffectDiscription()
  28. {
  29. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Three Musketeers] in its text and 1 Option card with a cost of 6 among them to the hand. Return the rest to the bottom of the deck.";
  30. }
  31. bool CanSelectCardCondition(CardSource cardSource)
  32. {
  33. return cardSource.HasText("Three Musketeers");
  34. }
  35. bool CanSelectCardCondition1(CardSource cardSource)
  36. {
  37. if (cardSource.IsOption)
  38. {
  39. if (cardSource.GetCostItself == 6)
  40. {
  41. return true;
  42. }
  43. }
  44. return false;
  45. }
  46. bool CanUseCondition(Hashtable hashtable)
  47. {
  48. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  49. }
  50. bool CanActivateCondition(Hashtable hashtable)
  51. {
  52. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  53. {
  54. if (card.Owner.LibraryCards.Count >= 1)
  55. {
  56. return true;
  57. }
  58. }
  59. return false;
  60. }
  61. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  62. {
  63. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  64. revealCount: 3,
  65. simplifiedSelectCardConditions:
  66. new SimplifiedSelectCardConditionClass[]
  67. {
  68. new SimplifiedSelectCardConditionClass(
  69. canTargetCondition:CanSelectCardCondition,
  70. message: "Select 1 Digimon card with [Three Musketeers] in its Text.",
  71. mode: SelectCardEffect.Mode.AddHand,
  72. maxCount: 1,
  73. selectCardCoroutine: null),
  74. new SimplifiedSelectCardConditionClass(
  75. canTargetCondition:CanSelectCardCondition1,
  76. message: "Select 1 Option card with a memory cost of 6.",
  77. mode: SelectCardEffect.Mode.AddHand,
  78. maxCount: 1,
  79. selectCardCoroutine: null),
  80. },
  81. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  82. activateClass: activateClass
  83. ));
  84. }
  85. }
  86. #endregion
  87. #region Inherit
  88. if (timing == EffectTiming.None)
  89. {
  90. bool Condition()
  91. {
  92. if (CardEffectCommons.IsOwnerTurn(card))
  93. {
  94. return true;
  95. }
  96. return false;
  97. }
  98. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  99. changeValue: 2000,
  100. isInheritedEffect: true,
  101. card: card,
  102. condition: Condition));
  103. }
  104. #endregion
  105. return cardEffects;
  106. }
  107. }
  108. }