BT19_021.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT19
  4. {
  5. public class BT19_021 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region On Play/ When Digivolving Shared
  11. bool CanSelectDigimonPermanentConditionShared(Permanent permanent)
  12. {
  13. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  14. permanent.TopCard.HasLevel && permanent.Level == 3;
  15. }
  16. bool CanActivateConditionShared(Hashtable hashtable)
  17. {
  18. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  19. CardEffectCommons.HasMatchConditionPermanent(CanSelectDigimonPermanentConditionShared);
  20. }
  21. #endregion
  22. #region On Play
  23. if (timing == EffectTiming.OnEnterFieldAnyone)
  24. {
  25. ActivateClass activateClass = new ActivateClass();
  26. activateClass.SetUpICardEffect("Return 1 of your opponent's level 3 Digimon to the hand", CanUseCondition, card);
  27. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  28. cardEffects.Add(activateClass);
  29. string EffectDescription()
  30. {
  31. return
  32. "[On Play] Return 1 of your opponent's level 3 Digimon to the hand.";
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable hashtable)
  39. {
  40. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  41. selectPermanentEffect.SetUp(
  42. selectPlayer: card.Owner,
  43. canTargetCondition: CanSelectDigimonPermanentConditionShared,
  44. canTargetCondition_ByPreSelecetedList: null,
  45. canEndSelectCondition: null,
  46. maxCount: 1,
  47. canNoSelect: false,
  48. canEndNotMax: false,
  49. selectPermanentCoroutine: null,
  50. afterSelectPermanentCoroutine: null,
  51. mode: SelectPermanentEffect.Mode.Bounce,
  52. cardEffect: activateClass);
  53. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to return to hand.",
  54. "The opponent is selecting 1 Digimon to return to hand.");
  55. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  56. }
  57. }
  58. #endregion
  59. #region When Digivolving
  60. if (timing == EffectTiming.OnEnterFieldAnyone)
  61. {
  62. ActivateClass activateClass = new ActivateClass();
  63. activateClass.SetUpICardEffect("Return 1 of your opponent's level 3 Digimon to the hand", CanUseCondition, card);
  64. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
  65. cardEffects.Add(activateClass);
  66. string EffectDescription()
  67. {
  68. return
  69. "[When Digivolving] Return 1 of your opponent's level 3 Digimon to the hand.";
  70. }
  71. bool CanUseCondition(Hashtable hashtable)
  72. {
  73. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  74. }
  75. IEnumerator ActivateCoroutine(Hashtable hashtable)
  76. {
  77. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  78. selectPermanentEffect.SetUp(
  79. selectPlayer: card.Owner,
  80. canTargetCondition: CanSelectDigimonPermanentConditionShared,
  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.Bounce,
  89. cardEffect: activateClass);
  90. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to return to hand.",
  91. "The opponent is selecting 1 Digimon to return to hand.");
  92. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  93. }
  94. }
  95. #endregion
  96. #region Jamming - ESS
  97. if (timing == EffectTiming.None)
  98. {
  99. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(
  100. isInheritedEffect: true,
  101. card: card,
  102. condition: null));
  103. }
  104. #endregion
  105. return cardEffects;
  106. }
  107. }
  108. }