BT11_009.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT11
  5. {
  6. public class BT11_009 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.None)
  12. {
  13. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  14. changeCardNamesClass.SetUpICardEffect("Also treated as [Shoutmon]", CanUseCondition, card);
  15. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
  16. cardEffects.Add(changeCardNamesClass);
  17. bool CanUseCondition(Hashtable hashtable)
  18. {
  19. return true;
  20. }
  21. List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
  22. {
  23. if (cardSource == card)
  24. {
  25. CardNames.Add("Shoutmon");
  26. }
  27. return CardNames;
  28. }
  29. }
  30. if (timing == EffectTiming.None)
  31. {
  32. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  33. changeCardNamesClass.SetUpICardEffect("Also treated as [Starmons]", CanUseCondition, card);
  34. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
  35. cardEffects.Add(changeCardNamesClass);
  36. bool CanUseCondition(Hashtable hashtable)
  37. {
  38. return true;
  39. }
  40. List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
  41. {
  42. if (cardSource == card)
  43. {
  44. CardNames.Add("Starmons");
  45. }
  46. return CardNames;
  47. }
  48. }
  49. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  50. {
  51. cardEffects.Add(CardEffectFactory.MaterialSaveEffect(card: card, materialSaveCount: 1));
  52. }
  53. if (timing == EffectTiming.OnEnterFieldAnyone)
  54. {
  55. ActivateClass activateClass = new ActivateClass();
  56. activateClass.SetUpICardEffect("DP -3000 and delete 1 Digimon with 2000 DP or less", CanUseCondition, card);
  57. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  58. cardEffects.Add(activateClass);
  59. string EffectDiscription()
  60. {
  61. return "[On Play] 1 of your opponent's Digimon gets -3000 DP for the turn. Then, if DigiXrosing with 2 cards, delete 1 of your opponent's Digimon with 2000 DP or less.";
  62. }
  63. bool CanSelectPermanentCondition(Permanent permanent)
  64. {
  65. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  66. }
  67. bool CanSelectPermanentCondition1(Permanent permanent)
  68. {
  69. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  70. {
  71. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(2000, activateClass))
  72. {
  73. return true;
  74. }
  75. }
  76. return false;
  77. }
  78. bool CanUseCondition(Hashtable hashtable)
  79. {
  80. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  81. }
  82. bool CanActivateCondition(Hashtable hashtable)
  83. {
  84. return CardEffectCommons.IsExistOnBattleArea(card);
  85. }
  86. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  87. {
  88. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  89. {
  90. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  91. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  92. selectPermanentEffect.SetUp(
  93. selectPlayer: card.Owner,
  94. canTargetCondition: CanSelectPermanentCondition,
  95. canTargetCondition_ByPreSelecetedList: null,
  96. canEndSelectCondition: null,
  97. maxCount: maxCount,
  98. canNoSelect: false,
  99. canEndNotMax: false,
  100. selectPermanentCoroutine: SelectPermanentCoroutine,
  101. afterSelectPermanentCoroutine: null,
  102. mode: SelectPermanentEffect.Mode.Custom,
  103. cardEffect: activateClass);
  104. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -3000.", "The opponent is selecting 1 Digimon that will get DP -3000.");
  105. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  106. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  107. {
  108. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -3000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  109. }
  110. }
  111. if (CardEffectCommons.IsDijiXros(_hashtable, card, count => count == 2))
  112. {
  113. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  114. {
  115. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  116. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  117. selectPermanentEffect.SetUp(
  118. selectPlayer: card.Owner,
  119. canTargetCondition: CanSelectPermanentCondition1,
  120. canTargetCondition_ByPreSelecetedList: null,
  121. canEndSelectCondition: null,
  122. maxCount: maxCount,
  123. canNoSelect: false,
  124. canEndNotMax: false,
  125. selectPermanentCoroutine: null,
  126. afterSelectPermanentCoroutine: null,
  127. mode: SelectPermanentEffect.Mode.Destroy,
  128. cardEffect: activateClass);
  129. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  130. }
  131. }
  132. }
  133. }
  134. if (timing == EffectTiming.None)
  135. {
  136. AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
  137. addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
  138. addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
  139. addDigiXrosConditionClass.SetNotShowUI(true);
  140. cardEffects.Add(addDigiXrosConditionClass);
  141. bool CanUseCondition(Hashtable hashtable)
  142. {
  143. return true;
  144. }
  145. DigiXrosCondition GetDigiXros(CardSource cardSource)
  146. {
  147. if (cardSource == card)
  148. {
  149. DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "Shoutmon");
  150. bool CanSelectCardCondition(CardSource cardSource)
  151. {
  152. if (cardSource != null)
  153. {
  154. if (cardSource.Owner == card.Owner)
  155. {
  156. if (cardSource.IsDigimon)
  157. {
  158. if (cardSource.CardNames_DigiXros.Contains("Shoutmon"))
  159. {
  160. return true;
  161. }
  162. }
  163. }
  164. }
  165. return false;
  166. }
  167. DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "Starmons");
  168. bool CanSelectCardCondition1(CardSource cardSource)
  169. {
  170. if (cardSource != null)
  171. {
  172. if (cardSource.Owner == card.Owner)
  173. {
  174. if (cardSource.IsDigimon)
  175. {
  176. if (cardSource.CardNames_DigiXros.Contains("Starmons"))
  177. {
  178. return true;
  179. }
  180. }
  181. }
  182. }
  183. return false;
  184. }
  185. List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1 };
  186. DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 1);
  187. return digiXrosCondition;
  188. }
  189. return null;
  190. }
  191. }
  192. return cardEffects;
  193. }
  194. }
  195. }