BT23_077.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. //Sistermon Ciel
  5. namespace DCGO.CardEffects.BT23
  6. {
  7. public class BT23_077 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Also Named
  13. if (timing == EffectTiming.None)
  14. {
  15. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  16. changeCardNamesClass.SetUpICardEffect("Also treated as [Sistermon Noir]", CanUseCondition, card);
  17. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
  18. cardEffects.Add(changeCardNamesClass);
  19. bool CanUseCondition(Hashtable hashtable)
  20. {
  21. return true;
  22. }
  23. List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
  24. {
  25. if (cardSource == card)
  26. {
  27. CardNames.Add("Sistermon Noir");
  28. }
  29. return CardNames;
  30. }
  31. }
  32. #endregion
  33. #region Blocker
  34. if (timing == EffectTiming.None)
  35. {
  36. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(
  37. isInheritedEffect: false,
  38. card: card,
  39. condition: null));
  40. }
  41. #endregion
  42. #region On Play
  43. if (timing == EffectTiming.OnEnterFieldAnyone)
  44. {
  45. ActivateClass activateClass = new ActivateClass();
  46. activateClass.SetUpICardEffect("Delete 1 Digimon with a play cost of 4 or less", CanUseCondition, card);
  47. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  48. cardEffects.Add(activateClass);
  49. string EffectDiscription()
  50. {
  51. return "[On Play] Delete 1 of your opponent's Digimon with a play cost of 4 or less.";
  52. }
  53. bool IsOpponenetsDigimon(Permanent permanent)
  54. {
  55. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  56. permanent.TopCard.HasPlayCost &&
  57. permanent.TopCard.GetCostItself <= 4;
  58. }
  59. bool CanUseCondition(Hashtable hashtable)
  60. {
  61. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  62. }
  63. bool CanActivateCondition(Hashtable hashtable)
  64. {
  65. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable hashtable)
  68. {
  69. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  70. selectPermanentEffect.SetUp(
  71. selectPlayer: card.Owner,
  72. canTargetCondition: IsOpponenetsDigimon,
  73. canTargetCondition_ByPreSelecetedList: null,
  74. canEndSelectCondition: null,
  75. maxCount: 1,
  76. canNoSelect: false,
  77. canEndNotMax: false,
  78. selectPermanentCoroutine: null,
  79. afterSelectPermanentCoroutine: null,
  80. mode: SelectPermanentEffect.Mode.Destroy,
  81. cardEffect: activateClass);
  82. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  83. }
  84. }
  85. #endregion
  86. #region All Turns
  87. if (timing == EffectTiming.OnTappedAnyone)
  88. {
  89. ActivateClass activateClass = new ActivateClass();
  90. activateClass.SetUpICardEffect("<De-Digivolve 1> 1 of your opponent's Digimon", CanUseCondition, card);
  91. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  92. cardEffects.Add(activateClass);
  93. string EffectDescription()
  94. {
  95. return "[All Turns] When this Digimon suspends, <De-Digivolve 1> 1 of your opponent's Digimon.";
  96. }
  97. bool OpponentsDigimon(Permanent permanent)
  98. {
  99. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  100. }
  101. bool CanUseCondition(Hashtable hashtable)
  102. {
  103. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  104. CardEffectCommons.CanTriggerWhenSelfPermanentSuspends(hashtable, card);
  105. }
  106. bool CanActivateCondition(Hashtable hashtable)
  107. {
  108. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  109. CardEffectCommons.HasMatchConditionPermanent(OpponentsDigimon);
  110. }
  111. IEnumerator ActivateCoroutine(Hashtable hashtable)
  112. {
  113. Permanent selectedPermanent = null;
  114. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  115. selectPermanentEffect.SetUp(
  116. selectPlayer: card.Owner,
  117. canTargetCondition: OpponentsDigimon,
  118. canTargetCondition_ByPreSelecetedList: null,
  119. canEndSelectCondition: null,
  120. maxCount: 1,
  121. canNoSelect: true,
  122. canEndNotMax: false,
  123. selectPermanentCoroutine: SelectPermanentCoroutine,
  124. afterSelectPermanentCoroutine: null,
  125. mode: SelectPermanentEffect.Mode.Custom,
  126. cardEffect: activateClass);
  127. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to de-digivolve.",
  128. "The opponent is selecting 1 Digimon to de-digivolve.");
  129. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  130. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  131. {
  132. selectedPermanent = permanent;
  133. yield return null;
  134. }
  135. if (selectedPermanent != null)
  136. {
  137. yield return ContinuousController.instance.StartCoroutine(new IDegeneration(selectedPermanent, 1, activateClass).Degeneration());
  138. }
  139. }
  140. }
  141. #endregion
  142. return cardEffects;
  143. }
  144. }
  145. }