BT24_068.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // DemiDevi
  4. namespace DCGO.CardEffects.BT24
  5. {
  6. public class BT24_068 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region On Play
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Reveal 3 from deck. Add 2. Return the rest to bot deck. Trash 1 from hand.", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Evil] or [Fallen Angel] trait and 1 card with the [Seven Great Demon Lords] trait among them to the hand. Return the rest to the bottom of the deck. Then, trash 1 card in your hand.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOnPlay(hashtable, card)
  25. && CardEffectCommons.IsExistOnBattleArea(card);
  26. }
  27. bool CanActivateCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.IsExistOnBattleArea(card);
  30. }
  31. bool CanSelectCardCondition(CardSource card)
  32. {
  33. return card.EqualsTraits("Evil")
  34. || card.EqualsTraits("Fallen Angel");
  35. }
  36. bool CanSelectCardCondition1(CardSource card)
  37. {
  38. return card.EqualsTraits("Seven Great Demon Lords");
  39. }
  40. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  41. {
  42. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  43. revealCount: 3,
  44. simplifiedSelectCardConditions:
  45. new SimplifiedSelectCardConditionClass[]
  46. {
  47. new SimplifiedSelectCardConditionClass(
  48. canTargetCondition:CanSelectCardCondition,
  49. message: "Select 1 Digimon with [Evil] or [Fallen Angel] in its traits.",
  50. mode: SelectCardEffect.Mode.AddHand,
  51. maxCount: 1,
  52. selectCardCoroutine: null),
  53. new SimplifiedSelectCardConditionClass(
  54. canTargetCondition:CanSelectCardCondition1,
  55. message: "Select 1 card with [Seven Great Demon Lords] in its traits.",
  56. mode: SelectCardEffect.Mode.AddHand,
  57. maxCount: 1,
  58. selectCardCoroutine: null),
  59. },
  60. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  61. activateClass: activateClass
  62. ));
  63. if (card.Owner.HandCards.Count >= 1)
  64. {
  65. int discardCount = 1;
  66. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  67. selectHandEffect.SetUp(
  68. selectPlayer: card.Owner,
  69. canTargetCondition: (card) => true,
  70. canTargetCondition_ByPreSelecetedList: null,
  71. canEndSelectCondition: null,
  72. maxCount: discardCount,
  73. canNoSelect: false,
  74. canEndNotMax: false,
  75. isShowOpponent: true,
  76. selectCardCoroutine: null,
  77. afterSelectCardCoroutine: null,
  78. mode: SelectHandEffect.Mode.Discard,
  79. cardEffect: activateClass);
  80. selectHandEffect.SetUpCustomMessage("Select 1 Card to trash.", "The opponent is selecting 1 card to trash from their hand.");
  81. yield return StartCoroutine(selectHandEffect.Activate());
  82. }
  83. }
  84. }
  85. #endregion
  86. #region ESS
  87. if (timing == EffectTiming.OnAllyAttack)
  88. {
  89. ActivateClass activateClass = new ActivateClass();
  90. activateClass.SetUpICardEffect("Trash top card from both players deck", CanUseCondition, card);
  91. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  92. activateClass.SetHashString("BT24_068_TrashTopDeck");
  93. activateClass.SetIsInheritedEffect(true);
  94. cardEffects.Add(activateClass);
  95. string EffectDescription()
  96. {
  97. return "[When Attacking] [Once Per Turn] Trash the top card of both players' decks.";
  98. }
  99. bool CanUseCondition(Hashtable hashtable)
  100. {
  101. return CardEffectCommons.IsExistOnField(card)
  102. && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  103. }
  104. bool CanActivateCondition(Hashtable hashtable)
  105. {
  106. return CardEffectCommons.IsExistOnField(card);
  107. }
  108. IEnumerator ActivateCoroutine(Hashtable hashtable)
  109. {
  110. yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(
  111. addTrashCount: 1,
  112. player: card.Owner,
  113. cardEffect: activateClass).AddTrashCardsFromLibraryTop());
  114. yield return ContinuousController.instance.StartCoroutine(new IAddTrashCardsFromLibraryTop(
  115. addTrashCount: 1,
  116. player: card.Owner.Enemy,
  117. cardEffect: activateClass).AddTrashCardsFromLibraryTop());
  118. }
  119. }
  120. #endregion
  121. return cardEffects;
  122. }
  123. }
  124. }