BT23_097.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Seventh Penetration
  5. namespace DCGO.CardEffects.BT23
  6. {
  7. public class BT23_097 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region [Trash] Your Turn
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("By returning this card to deck, Activate [Main] effect", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Trash] [Your Turn] When any of your Digimon digivolve into [Belphemon (X Antibody)], by returning this card to the bottom of the deck, activate this card's [Main] effects.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  26. && permanent.TopCard.EqualsCardName("Belphemon (X Antibody)");
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.IsExistOnTrash(card)
  31. && CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition);
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnTrash(card);
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  38. {
  39. List<CardSource> cardSources = new List<CardSource>() { card };
  40. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(cardSources));
  41. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(cardSources, "Deck Bottom Card", true, true));
  42. if (card.Owner.LibraryCards.Contains(card))
  43. {
  44. ActivateClass mainActivateClass = CardEffectCommons.OptionMainEffect(card);
  45. if (mainActivateClass != null)
  46. {
  47. yield return ContinuousController.instance.StartCoroutine(mainActivateClass.Activate(CardEffectCommons.OptionMainCheckHashtable(card)));
  48. }
  49. }
  50. }
  51. }
  52. #endregion
  53. #region Main
  54. if (timing == EffectTiming.OptionSkill)
  55. {
  56. ActivateClass activateClass = new ActivateClass();
  57. activateClass.SetUpICardEffect("Delete 1 digimon with equal or high level then cards in hand", CanUseCondition, card);
  58. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  59. cardEffects.Add(activateClass);
  60. string EffectDiscription()
  61. {
  62. return "[Main] Delete 1 of your opponent's Digimon with a level as high or higher as the number of cards in your hand.";
  63. }
  64. bool CanUseCondition(Hashtable hashtable)
  65. {
  66. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  67. }
  68. bool CanSelectPermament(Permanent permanent)
  69. {
  70. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
  71. && permanent.TopCard.HasLevel && permanent.TopCard.Level >= card.Owner.HandCards.Count;
  72. }
  73. IEnumerator ActivateCoroutine(Hashtable hashtable)
  74. {
  75. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermament))
  76. {
  77. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  78. selectPermanentEffect.SetUp(
  79. selectPlayer: card.Owner,
  80. canTargetCondition: CanSelectPermament,
  81. canTargetCondition_ByPreSelecetedList: null,
  82. canEndSelectCondition: null,
  83. maxCount: 1,
  84. canNoSelect: false,
  85. canEndNotMax: false,
  86. selectPermanentCoroutine: null,
  87. afterSelectPermanentCoroutine: null,
  88. mode: SelectPermanentEffect.Mode.Destroy,
  89. cardEffect: activateClass);
  90. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
  91. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  92. }
  93. }
  94. }
  95. #endregion
  96. #region Security
  97. if (timing == EffectTiming.SecuritySkill)
  98. {
  99. CardEffectCommons.AddActivateMainOptionSecurityEffect(
  100. card: card,
  101. cardEffects: ref cardEffects,
  102. effectName: "Delete 1 digimon with equal or high level then cards in hand");
  103. }
  104. #endregion
  105. return cardEffects;
  106. }
  107. }
  108. }