BT15_012.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT15
  5. {
  6. public class BT15_012 : 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 [Ballistamon]", 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("Ballistamon");
  45. }
  46. return CardNames;
  47. }
  48. }
  49. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  50. {
  51. cardEffects.Add(CardEffectFactory.MaterialSaveEffect(card: card, materialSaveCount: 2));
  52. }
  53. if (timing == EffectTiming.OnStartTurn)
  54. {
  55. ActivateClass activateClass = new ActivateClass();
  56. activateClass.SetUpICardEffect("Delete this Digimon to gain Memory +1", CanUseCondition, card);
  57. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  58. cardEffects.Add(activateClass);
  59. string EffectDiscription()
  60. {
  61. return "[Start of Your Turn] By deleting this Digimon, gain 1 memory.";
  62. }
  63. bool CanUseCondition(Hashtable hashtable)
  64. {
  65. if (CardEffectCommons.IsExistOnBattleArea(card))
  66. {
  67. if (CardEffectCommons.IsOwnerTurn(card))
  68. {
  69. return true;
  70. }
  71. }
  72. return false;
  73. }
  74. bool CanActivateCondition(Hashtable hashtable)
  75. {
  76. if (CardEffectCommons.IsExistOnBattleArea(card))
  77. {
  78. if (card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass))
  79. {
  80. return true;
  81. }
  82. }
  83. return false;
  84. }
  85. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  86. {
  87. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
  88. IEnumerator SuccessProcess()
  89. {
  90. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  91. }
  92. }
  93. }
  94. if (timing == EffectTiming.OnEnterFieldAnyone)
  95. {
  96. ActivateClass activateClass = new ActivateClass();
  97. activateClass.SetUpICardEffect("Suspend 1 Digimon and it can't unsuspend", CanUseCondition, card);
  98. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  99. cardEffects.Add(activateClass);
  100. string EffectDiscription()
  101. {
  102. return "[On Play] Suspend 1 of your opponent's Digimon. If DigiXrosing with 2 cards, that Digimon can't unsuspend during your opponent's next unsuspend phase.";
  103. }
  104. bool CanSelectPermanentCondition(Permanent permanent)
  105. {
  106. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  107. }
  108. bool CanUseCondition(Hashtable hashtable)
  109. {
  110. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  111. }
  112. bool CanActivateCondition(Hashtable hashtable)
  113. {
  114. if (CardEffectCommons.IsExistOnBattleArea(card))
  115. {
  116. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  117. {
  118. return true;
  119. }
  120. }
  121. return false;
  122. }
  123. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  124. {
  125. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  126. {
  127. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  128. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  129. selectPermanentEffect.SetUp(
  130. selectPlayer: card.Owner,
  131. canTargetCondition: CanSelectPermanentCondition,
  132. canTargetCondition_ByPreSelecetedList: null,
  133. canEndSelectCondition: null,
  134. maxCount: maxCount,
  135. canNoSelect: false,
  136. canEndNotMax: false,
  137. selectPermanentCoroutine: null,
  138. afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
  139. mode: SelectPermanentEffect.Mode.Tap,
  140. cardEffect: activateClass);
  141. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  142. IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
  143. {
  144. if (CardEffectCommons.IsDijiXros(_hashtable, card, count => count == 2))
  145. {
  146. foreach (Permanent selectedPermanent in permanents)
  147. {
  148. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendNextActivePhase(
  149. targetPermanent: selectedPermanent,
  150. activateClass: activateClass
  151. ));
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. if (timing == EffectTiming.None)
  159. {
  160. AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
  161. addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
  162. addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
  163. addDigiXrosConditionClass.SetNotShowUI(true);
  164. cardEffects.Add(addDigiXrosConditionClass);
  165. bool CanUseCondition(Hashtable hashtable)
  166. {
  167. return true;
  168. }
  169. DigiXrosCondition GetDigiXros(CardSource cardSource)
  170. {
  171. if (cardSource == card)
  172. {
  173. DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "Shoutmon");
  174. bool CanSelectCardCondition(CardSource cardSource)
  175. {
  176. if (cardSource != null)
  177. {
  178. if (cardSource.Owner == card.Owner)
  179. {
  180. if (cardSource.IsDigimon)
  181. {
  182. if (cardSource.CardNames_DigiXros.Contains("Shoutmon"))
  183. {
  184. return true;
  185. }
  186. }
  187. }
  188. }
  189. return false;
  190. }
  191. DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "Ballistamon");
  192. bool CanSelectCardCondition1(CardSource cardSource)
  193. {
  194. if (cardSource != null)
  195. {
  196. if (cardSource.Owner == card.Owner)
  197. {
  198. if (cardSource.IsDigimon)
  199. {
  200. if (cardSource.CardNames_DigiXros.Contains("Ballistamon"))
  201. {
  202. return true;
  203. }
  204. }
  205. }
  206. }
  207. return false;
  208. }
  209. List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1 };
  210. DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 1);
  211. return digiXrosCondition;
  212. }
  213. return null;
  214. }
  215. }
  216. return cardEffects;
  217. }
  218. }
  219. }