EX12_023.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Jellymon
  4. namespace DCGO.CardEffects.EX12
  5. {
  6. public class EX12_023 : 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 Cost
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsCardName("Puyoyomon");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. if (timing == EffectTiming.None)
  21. {
  22. bool PermanentCondition(Permanent targetPermanent)
  23. {
  24. return targetPermanent.TopCard.EqualsTraits("DS");
  25. }
  26. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 2));
  27. }
  28. #endregion
  29. #region On Play
  30. if (timing == EffectTiming.OnEnterFieldAnyone)
  31. {
  32. ActivateClass activateClass = new ActivateClass();
  33. activateClass.SetUpICardEffect("Reveal 3, add 1 [Jellymon] in text and 1 [DS] trait, bottom deck the rest", CanUseCondition, card);
  34. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  35. cardEffects.Add(activateClass);
  36. string EffectDescription() => "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Jellymon] in its text and 1 card with the [DS] trait among them to the hand. Return the rest to the bottom of the deck.";
  37. bool FirstCardSelection(CardSource cardSource)
  38. => cardSource.HasText("Jellymon");
  39. bool SecondCardSelection(CardSource cardSource)
  40. => cardSource.EqualsTraits("DS");
  41. bool CanUseCondition(Hashtable hashtable)
  42. => CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
  43. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  44. bool CanActivateCondition(Hashtable hashtable)
  45. => CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
  46. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  49. revealCount: 3,
  50. simplifiedSelectCardConditions:
  51. new SimplifiedSelectCardConditionClass[]
  52. {
  53. new SimplifiedSelectCardConditionClass(
  54. canTargetCondition:FirstCardSelection,
  55. message: "Select 1 card with [Jellymon] in its text.",
  56. mode: SelectCardEffect.Mode.AddHand,
  57. maxCount: 1,
  58. selectCardCoroutine: null),
  59. new SimplifiedSelectCardConditionClass(
  60. canTargetCondition:SecondCardSelection,
  61. message: "Select 1 card with [DS] trait.",
  62. mode: SelectCardEffect.Mode.AddHand,
  63. maxCount: 1,
  64. selectCardCoroutine: null),
  65. },
  66. mutualConditions: true,
  67. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  68. activateClass: activateClass
  69. ));
  70. }
  71. }
  72. #endregion
  73. #region Inherited
  74. if (timing == EffectTiming.OnAllyAttack)
  75. {
  76. ActivateClass activateClass = new ActivateClass();
  77. activateClass.SetUpICardEffect("<Draw 1>, then if 7 or more in hand, trash 1", CanUseCondition, card);
  78. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  79. activateClass.SetIsInheritedEffect(true);
  80. activateClass.SetHashString("EX12_023_Inherited");
  81. cardEffects.Add(activateClass);
  82. string EffectDescription()
  83. => "[When Attacking] [Once Per Turn] <Draw 1>. Then, if your hand has 7 or more cards, trash 1 card in your hand.";
  84. bool CanUseCondition(Hashtable hashtable)
  85. {
  86. return CardEffectCommons.IsExistOnBattleAreaDigimonTrigger(card, activateClass)
  87. && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  88. }
  89. bool CanActivateCondition(Hashtable hashtable)
  90. {
  91. return CardEffectCommons.IsExistOnBattleAreaDigimonActivate(card, activateClass);
  92. }
  93. IEnumerator ActivateCoroutine(Hashtable hashtable)
  94. {
  95. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  96. if (card.Owner.HandCards.Count >= 7)
  97. {
  98. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  99. selectHandEffect.SetUp(
  100. selectPlayer: card.Owner,
  101. canTargetCondition: (cardSource) => true,
  102. canTargetCondition_ByPreSelecetedList: null,
  103. canEndSelectCondition: null,
  104. maxCount: 1,
  105. canNoSelect: false,
  106. canEndNotMax: false,
  107. isShowOpponent: true,
  108. selectCardCoroutine: null,
  109. afterSelectCardCoroutine: null,
  110. mode: SelectHandEffect.Mode.Discard,
  111. cardEffect: activateClass);
  112. yield return StartCoroutine(selectHandEffect.Activate());
  113. }
  114. }
  115. }
  116. #endregion
  117. return cardEffects;
  118. }
  119. }
  120. }