EX4_053.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.EX4
  5. {
  6. public class EX4_053 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Play] Reveal the top 3 cards of your deck. Add 1 purple Digimon card with [Ravemon] in its name or [Bird] or [Avian] in one of its traits and 1 [Keenan Crier] among them to your hand. Place the rest at the bottom of your deck in any order.";
  20. }
  21. bool CanSelectCardCondition(CardSource cardSource)
  22. {
  23. if (cardSource.IsDigimon)
  24. {
  25. if (cardSource.CardColors.Contains(CardColor.Purple))
  26. {
  27. if (cardSource.ContainsCardName("Ravemon"))
  28. {
  29. return true;
  30. }
  31. if (cardSource.HasBirdTraits)
  32. {
  33. return true;
  34. }
  35. }
  36. }
  37. return false;
  38. }
  39. bool CanSelectCardCondition1(CardSource cardSource)
  40. {
  41. if (cardSource.CardNames.Contains("Keenan Crier"))
  42. {
  43. return true;
  44. }
  45. if (cardSource.CardNames.Contains("KeenanCrier"))
  46. {
  47. return true;
  48. }
  49. return false;
  50. }
  51. bool CanUseCondition(Hashtable hashtable)
  52. {
  53. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  54. }
  55. bool CanActivateCondition(Hashtable hashtable)
  56. {
  57. if (CardEffectCommons.IsExistOnBattleArea(card))
  58. {
  59. if (card.Owner.LibraryCards.Count >= 1)
  60. {
  61. return true;
  62. }
  63. }
  64. return false;
  65. }
  66. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  67. {
  68. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  69. revealCount: 3,
  70. simplifiedSelectCardConditions:
  71. new SimplifiedSelectCardConditionClass[]
  72. {
  73. new SimplifiedSelectCardConditionClass(
  74. canTargetCondition:CanSelectCardCondition,
  75. message: "Select 1 purple Digimon card with [Ravemon] in its name or [Bird] or [Avian] in one of its traits.",
  76. mode: SelectCardEffect.Mode.AddHand,
  77. maxCount: 1,
  78. selectCardCoroutine: null),
  79. new SimplifiedSelectCardConditionClass(
  80. canTargetCondition:CanSelectCardCondition1,
  81. message: "Select 1 [Keenan Crier].",
  82. mode: SelectCardEffect.Mode.AddHand,
  83. maxCount: 1,
  84. selectCardCoroutine: null),
  85. },
  86. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  87. activateClass: activateClass,
  88. mutualConditions: true
  89. ));
  90. }
  91. }
  92. if (timing == EffectTiming.OnDestroyedAnyone)
  93. {
  94. ActivateClass activateClass = new ActivateClass();
  95. activateClass.SetUpICardEffect("Opponent trashes 1 card from hand", CanUseCondition, card);
  96. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  97. activateClass.SetIsInheritedEffect(true);
  98. cardEffects.Add(activateClass);
  99. string EffectDiscription()
  100. {
  101. return "[On Deletion] If deleted outside of a battle, your opponent trashes 1 card in their hand.";
  102. }
  103. bool CanUseCondition(Hashtable hashtable)
  104. {
  105. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
  106. }
  107. bool CanActivateCondition(Hashtable hashtable)
  108. {
  109. if (CardEffectCommons.CanActivateOnDeletionInherited(hashtable, card))
  110. {
  111. if (!CardEffectCommons.IsByBattle(hashtable))
  112. {
  113. if (card.Owner.Enemy.HandCards.Count >= 1)
  114. {
  115. return true;
  116. }
  117. }
  118. }
  119. return false;
  120. }
  121. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  122. {
  123. if (card.Owner.Enemy.HandCards.Count >= 1)
  124. {
  125. int discardCount = Math.Min(1, card.Owner.HandCards.Count);
  126. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  127. selectHandEffect.SetUp(
  128. selectPlayer: card.Owner.Enemy,
  129. canTargetCondition: (cardSource) => true,
  130. canTargetCondition_ByPreSelecetedList: null,
  131. canEndSelectCondition: null,
  132. maxCount: discardCount,
  133. canNoSelect: false,
  134. canEndNotMax: false,
  135. isShowOpponent: true,
  136. selectCardCoroutine: null,
  137. afterSelectCardCoroutine: null,
  138. mode: SelectHandEffect.Mode.Discard,
  139. cardEffect: activateClass);
  140. yield return StartCoroutine(selectHandEffect.Activate());
  141. }
  142. }
  143. }
  144. return cardEffects;
  145. }
  146. }
  147. }