BT24_066.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT24
  6. {
  7. public class BT24_066 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternate Digivolution
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.EqualsCardName("Gigimon");
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  20. }
  21. #endregion
  22. #region On Play
  23. if (timing == EffectTiming.OnEnterFieldAnyone)
  24. {
  25. ActivateClass activateClass = new ActivateClass();
  26. activateClass.SetUpICardEffect("Reveal 3 from deck. Add 2. Return the rest to bot deck. Trash 1 from hand.", CanUseCondition, card);
  27. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  28. cardEffects.Add(activateClass);
  29. string EffectDescription()
  30. {
  31. return "[On Play] Reveal the top 3 cards of your deck. Among them, add 1 [Evil], [Dark Dragon], [Evil Dragon] or [Dark Knight] trait card or purple Tamer card to the hand and trash 1 such card. Return the rest to the bottom of the deck. Then, trash 1 card in your hand.";
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.CanTriggerOnPlay(hashtable, card)
  36. && CardEffectCommons.IsExistOnBattleArea(card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.IsExistOnBattleArea(card);
  41. }
  42. bool CanSelectCardCondition(CardSource card)
  43. {
  44. return card.EqualsTraits("Evil")
  45. || card.EqualsTraits("Dark Dragon")
  46. || card.EqualsTraits("Evil Dragon")
  47. || card.EqualsTraits("Dark Knight")
  48. || (card.IsTamer
  49. && card.HasCardColor(CardColor.Purple));
  50. }
  51. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  52. {
  53. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  54. revealCount: 3,
  55. simplifiedSelectCardConditions:
  56. new SimplifiedSelectCardConditionClass[]
  57. {
  58. new SimplifiedSelectCardConditionClass(
  59. canTargetCondition:CanSelectCardCondition,
  60. message: "Select 1 card to add to hand.",
  61. mode: SelectCardEffect.Mode.AddHand,
  62. maxCount: 1,
  63. selectCardCoroutine: null),
  64. new SimplifiedSelectCardConditionClass(
  65. canTargetCondition:CanSelectCardCondition,
  66. message: "Select 1 card to trash.",
  67. mode: SelectCardEffect.Mode.Discard,
  68. maxCount: 1,
  69. selectCardCoroutine: null),
  70. },
  71. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  72. activateClass: activateClass
  73. ));
  74. if (card.Owner.HandCards.Count >= 1)
  75. {
  76. int discardCount = 1;
  77. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  78. selectHandEffect.SetUp(
  79. selectPlayer: card.Owner,
  80. canTargetCondition: (card) => true,
  81. canTargetCondition_ByPreSelecetedList: null,
  82. canEndSelectCondition: null,
  83. maxCount: discardCount,
  84. canNoSelect: false,
  85. canEndNotMax: false,
  86. isShowOpponent: true,
  87. selectCardCoroutine: null,
  88. afterSelectCardCoroutine: null,
  89. mode: SelectHandEffect.Mode.Discard,
  90. cardEffect: activateClass);
  91. selectHandEffect.SetUpCustomMessage("Select 1 Card to trash.", "The opponent is selecting 1 card to trash from their hand.");
  92. yield return StartCoroutine(selectHandEffect.Activate());
  93. }
  94. }
  95. }
  96. #endregion
  97. #region When Attacking - ESS
  98. if (timing == EffectTiming.OnAllyAttack)
  99. {
  100. ActivateClass activateClass = new ActivateClass();
  101. activateClass.SetUpICardEffect("Delete opponents level 3 Digimon", CanUseCondition, card);
  102. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  103. activateClass.SetIsInheritedEffect(true);
  104. activateClass.SetHashString("BT24_066_Inherited");
  105. cardEffects.Add(activateClass);
  106. string EffectDescription()
  107. {
  108. return "[When Attacking] [Once Per Turn] Delete 1 of your opponent's level 3 Digimon.";
  109. }
  110. bool SelectOpponentsLevel3Digimon(Permanent permanent)
  111. {
  112. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
  113. && permanent.TopCard.IsLevel3;
  114. }
  115. bool CanUseCondition(Hashtable hashtable)
  116. {
  117. return CardEffectCommons.CanTriggerOnAttack(hashtable, card)
  118. && CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  119. }
  120. bool CanActivateCondition(Hashtable hashtable)
  121. {
  122. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  123. }
  124. IEnumerator ActivateCoroutine(Hashtable hashtable)
  125. {
  126. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(SelectOpponentsLevel3Digimon));
  127. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  128. selectPermanentEffect.SetUp(
  129. selectPlayer: card.Owner,
  130. canTargetCondition: SelectOpponentsLevel3Digimon,
  131. canTargetCondition_ByPreSelecetedList: null,
  132. canEndSelectCondition: null,
  133. maxCount: maxCount,
  134. canNoSelect: false,
  135. canEndNotMax: false,
  136. selectPermanentCoroutine: null,
  137. afterSelectPermanentCoroutine: null,
  138. mode: SelectPermanentEffect.Mode.Destroy,
  139. cardEffect: activateClass);
  140. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  141. }
  142. }
  143. #endregion
  144. return cardEffects;
  145. }
  146. }
  147. }