BT10_061.cs 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_061 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.None)
  16. {
  17. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  18. changeCardNamesClass.SetUpICardEffect("Also treated as [SkullKnightmon]", CanUseCondition, card);
  19. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
  20. cardEffects.Add(changeCardNamesClass);
  21. bool CanUseCondition(Hashtable hashtable)
  22. {
  23. return true;
  24. }
  25. List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
  26. {
  27. if (cardSource == card)
  28. {
  29. CardNames.Add("SkullKnightmon");
  30. }
  31. return CardNames;
  32. }
  33. }
  34. if (timing == EffectTiming.None)
  35. {
  36. ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
  37. changeCardNamesClass.SetUpICardEffect("Also treated as [DeadlyAxemon]", CanUseCondition, card);
  38. changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: changeCardNames);
  39. cardEffects.Add(changeCardNamesClass);
  40. bool CanUseCondition(Hashtable hashtable)
  41. {
  42. return true;
  43. }
  44. List<string> changeCardNames(CardSource cardSource, List<string> CardNames)
  45. {
  46. if (cardSource == card)
  47. {
  48. CardNames.Add("DeadlyAxemon");
  49. }
  50. return CardNames;
  51. }
  52. }
  53. if (timing == EffectTiming.OnEnterFieldAnyone)
  54. {
  55. ActivateClass activateClass = new ActivateClass();
  56. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck and delete 1 Digimon with 4 or less Cost", CanUseCondition, card);
  57. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  58. cardEffects.Add(activateClass);
  59. string EffectDiscription()
  60. {
  61. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Knightmon] in its name, 1 [DeadlyAxemon], or 1 [Nene Amano] among them to your hand. Trash the rest. Then, if DigiXrosing with 2 cards, delete 1 of your opponent's Digimon with a play cost of 4 or less.";
  62. }
  63. bool CanSelectCardCondition(CardSource cardSource)
  64. {
  65. if (cardSource.ContainsCardName("Knightmon"))
  66. {
  67. return true;
  68. }
  69. if (cardSource.CardNames.Contains("DeadlyAxemon"))
  70. {
  71. return true;
  72. }
  73. if (cardSource.CardNames.Contains("Nene Amano"))
  74. {
  75. return true;
  76. }
  77. if (cardSource.CardNames.Contains("NeneAmano"))
  78. {
  79. return true;
  80. }
  81. return false;
  82. }
  83. bool CanSelectPermanentCondition(Permanent permanent)
  84. {
  85. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  86. {
  87. if (permanent.TopCard.GetCostItself <= 4)
  88. {
  89. return true;
  90. }
  91. }
  92. return false;
  93. }
  94. bool CanUseCondition(Hashtable hashtable)
  95. {
  96. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  97. }
  98. bool CanActivateCondition(Hashtable hashtable)
  99. {
  100. if (CardEffectCommons.IsExistOnBattleArea(card))
  101. {
  102. return true;
  103. }
  104. return false;
  105. }
  106. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  107. {
  108. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  109. revealCount: 3,
  110. simplifiedSelectCardConditions:
  111. new SimplifiedSelectCardConditionClass[]
  112. {
  113. new SimplifiedSelectCardConditionClass(
  114. canTargetCondition:CanSelectCardCondition,
  115. message: "Select 1 card with [Knightmon] in its name, 1 [DeadlyAxemon], or 1 [Nene Amano].",
  116. mode: SelectCardEffect.Mode.AddHand,
  117. maxCount: 1,
  118. selectCardCoroutine: null),
  119. },
  120. remainingCardsPlace: RemainingCardsPlace.Trash,
  121. activateClass: activateClass
  122. ));
  123. if (CardEffectCommons.IsDijiXros(_hashtable, card, (count) => count == 2))
  124. {
  125. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  126. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  127. selectPermanentEffect.SetUp(
  128. selectPlayer: card.Owner,
  129. canTargetCondition: CanSelectPermanentCondition,
  130. canTargetCondition_ByPreSelecetedList: null,
  131. canEndSelectCondition: null,
  132. maxCount: maxCount,
  133. canNoSelect: false,
  134. canEndNotMax: false,
  135. selectPermanentCoroutine: null,
  136. afterSelectPermanentCoroutine: null,
  137. mode: SelectPermanentEffect.Mode.Destroy,
  138. cardEffect: activateClass);
  139. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  140. }
  141. }
  142. }
  143. if (timing == EffectTiming.None)
  144. {
  145. AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
  146. addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
  147. addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
  148. addDigiXrosConditionClass.SetNotShowUI(true);
  149. cardEffects.Add(addDigiXrosConditionClass);
  150. bool CanUseCondition(Hashtable hashtable)
  151. {
  152. return true;
  153. }
  154. DigiXrosCondition GetDigiXros(CardSource cardSource)
  155. {
  156. if (cardSource == card)
  157. {
  158. DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "SkullKnightmon");
  159. bool CanSelectCardCondition(CardSource cardSource)
  160. {
  161. if (cardSource != null)
  162. {
  163. if (cardSource.Owner == card.Owner)
  164. {
  165. if (cardSource.IsDigimon)
  166. {
  167. if (cardSource.CardNames_DigiXros.Contains("SkullKnightmon"))
  168. {
  169. return true;
  170. }
  171. }
  172. }
  173. }
  174. return false;
  175. }
  176. DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "DeadlyAxemon");
  177. bool CanSelectCardCondition1(CardSource cardSource)
  178. {
  179. if (cardSource != null)
  180. {
  181. if (cardSource.Owner == card.Owner)
  182. {
  183. if (cardSource.IsDigimon)
  184. {
  185. if (cardSource.CardNames_DigiXros.Contains("DeadlyAxemon"))
  186. {
  187. return true;
  188. }
  189. }
  190. }
  191. }
  192. return false;
  193. }
  194. List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1 };
  195. DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 1);
  196. return digiXrosCondition;
  197. }
  198. return null;
  199. }
  200. }
  201. return cardEffects;
  202. }
  203. }
  204. }