BT17_072.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT17
  4. {
  5. public class BT17_072 : 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 CanSelectPermanentSharedCondition(Permanent permanent)
  12. {
  13. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  14. !permanent.IsSuspended;
  15. }
  16. #endregion
  17. #region On Play
  18. if (timing == EffectTiming.OnEnterFieldAnyone)
  19. {
  20. ActivateClass activateClass = new ActivateClass();
  21. activateClass.SetUpICardEffect("Delete unsuspended Digimon", CanUseCondition, card);
  22. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  23. cardEffects.Add(activateClass);
  24. string EffectDescription()
  25. {
  26. return
  27. "[When Digivolving] Delete 1 of your opponent's unsuspended Digimon.";
  28. }
  29. bool CanUseCondition(Hashtable hashtable)
  30. {
  31. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable hashtable)
  38. {
  39. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentSharedCondition))
  40. {
  41. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  42. selectPermanentEffect.SetUp(
  43. selectPlayer: card.Owner,
  44. canTargetCondition: CanSelectPermanentSharedCondition,
  45. canTargetCondition_ByPreSelecetedList: null,
  46. canEndSelectCondition: null,
  47. maxCount: 1,
  48. canNoSelect: false,
  49. canEndNotMax: false,
  50. selectPermanentCoroutine: null,
  51. afterSelectPermanentCoroutine: null,
  52. mode: SelectPermanentEffect.Mode.Destroy,
  53. cardEffect: activateClass);
  54. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  55. }
  56. yield return null;
  57. }
  58. }
  59. #endregion
  60. #region When Digivolving
  61. if (timing == EffectTiming.OnEnterFieldAnyone)
  62. {
  63. ActivateClass activateClass = new ActivateClass();
  64. activateClass.SetUpICardEffect("Delete unsuspended Digimon", CanUseCondition, card);
  65. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  66. cardEffects.Add(activateClass);
  67. string EffectDescription()
  68. {
  69. return
  70. "[When Digivolving] Delete 1 of your opponent's unsuspended Digimon.";
  71. }
  72. bool CanUseCondition(Hashtable hashtable)
  73. {
  74. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  75. }
  76. bool CanActivateCondition(Hashtable hashtable)
  77. {
  78. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  79. }
  80. IEnumerator ActivateCoroutine(Hashtable hashtable)
  81. {
  82. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentSharedCondition))
  83. {
  84. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  85. selectPermanentEffect.SetUp(
  86. selectPlayer: card.Owner,
  87. canTargetCondition: CanSelectPermanentSharedCondition,
  88. canTargetCondition_ByPreSelecetedList: null,
  89. canEndSelectCondition: null,
  90. maxCount: 1,
  91. canNoSelect: false,
  92. canEndNotMax: false,
  93. selectPermanentCoroutine: null,
  94. afterSelectPermanentCoroutine: null,
  95. mode: SelectPermanentEffect.Mode.Destroy,
  96. cardEffect: activateClass);
  97. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  98. }
  99. yield return null;
  100. }
  101. }
  102. #endregion
  103. #region All Turns
  104. if (timing == EffectTiming.None)
  105. {
  106. bool PermanentCondition()
  107. {
  108. return CardEffectCommons.IsExistOnBattleArea(card) &&
  109. CardEffectCommons.HasMatchConditionOwnersPermanent(card,
  110. permanent =>
  111. permanent != card.PermanentOfThisCard() &&
  112. permanent.TopCard.HasLevel &&
  113. permanent.Level == 6);
  114. }
  115. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: false, card: card,
  116. condition: PermanentCondition));
  117. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card,
  118. condition: PermanentCondition));
  119. }
  120. #endregion
  121. return cardEffects;
  122. }
  123. }
  124. }