BT11_012.cs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT11
  4. {
  5. public class BT11_012 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  11. {
  12. cardEffects.Add(CardEffectFactory.MaterialSaveEffect(card: card, materialSaveCount: 2));
  13. }
  14. if (timing == EffectTiming.OnStartTurn)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Delete this Digimon to gain Memory +1", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[Start of Your Turn] By deleting this Digimon, gain 1 memory.";
  23. }
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleArea(card))
  27. {
  28. if (CardEffectCommons.IsOwnerTurn(card))
  29. {
  30. return true;
  31. }
  32. }
  33. return false;
  34. }
  35. bool CanActivateCondition(Hashtable hashtable)
  36. {
  37. if (CardEffectCommons.IsExistOnBattleArea(card))
  38. {
  39. if (card.PermanentOfThisCard().CanBeDestroyedBySkill(activateClass))
  40. {
  41. return true;
  42. }
  43. }
  44. return false;
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DeletePeremanentAndProcessAccordingToResult(targetPermanents: new List<Permanent>() { card.PermanentOfThisCard() }, activateClass: activateClass, successProcess: permanents => SuccessProcess(), failureProcess: null));
  49. IEnumerator SuccessProcess()
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  52. }
  53. }
  54. }
  55. if (timing == EffectTiming.OnEnterFieldAnyone)
  56. {
  57. ActivateClass activateClass = new ActivateClass();
  58. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  59. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  60. cardEffects.Add(activateClass);
  61. string EffectDiscription()
  62. {
  63. return "[On Play] Reveal the top 3 cards of your deck. Add 2 cards with [Xros Heart] and [Blue Flare] in their traits among them to your hand. Place the rest at the bottom of your deck in any order.";
  64. }
  65. bool CanSelectCardCondition(CardSource cardSource)
  66. {
  67. if (cardSource.CardTraits.Contains("Xros Heart"))
  68. {
  69. return true;
  70. }
  71. if (cardSource.CardTraits.Contains("XrosHeart"))
  72. {
  73. return true;
  74. }
  75. if (cardSource.CardTraits.Contains("Blue Flare"))
  76. {
  77. return true;
  78. }
  79. if (cardSource.CardTraits.Contains("BlueFlare"))
  80. {
  81. return true;
  82. }
  83. return false;
  84. }
  85. bool CanUseCondition(Hashtable hashtable)
  86. {
  87. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  88. }
  89. bool CanActivateCondition(Hashtable hashtable)
  90. {
  91. if (CardEffectCommons.IsExistOnBattleArea(card))
  92. {
  93. if (card.Owner.LibraryCards.Count >= 1)
  94. {
  95. return true;
  96. }
  97. }
  98. return false;
  99. }
  100. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  101. {
  102. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  103. revealCount: 3,
  104. simplifiedSelectCardConditions:
  105. new SimplifiedSelectCardConditionClass[]
  106. {
  107. new SimplifiedSelectCardConditionClass(
  108. canTargetCondition:CanSelectCardCondition,
  109. message: "Select 2 cards with [Xros Heart] and [Blue Flare] in their traits.",
  110. mode: SelectCardEffect.Mode.AddHand,
  111. maxCount: 2,
  112. selectCardCoroutine: null),
  113. },
  114. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  115. activateClass: activateClass
  116. ));
  117. }
  118. }
  119. if (timing == EffectTiming.None)
  120. {
  121. AddDigiXrosConditionClass addDigiXrosConditionClass = new AddDigiXrosConditionClass();
  122. addDigiXrosConditionClass.SetUpICardEffect($"DigiXros", CanUseCondition, card);
  123. addDigiXrosConditionClass.SetUpAddDigiXrosConditionClass(getDigiXrosCondition: GetDigiXros);
  124. addDigiXrosConditionClass.SetNotShowUI(true);
  125. cardEffects.Add(addDigiXrosConditionClass);
  126. bool CanUseCondition(Hashtable hashtable)
  127. {
  128. return true;
  129. }
  130. DigiXrosCondition GetDigiXros(CardSource cardSource)
  131. {
  132. if (cardSource == card)
  133. {
  134. DigiXrosConditionElement element = new DigiXrosConditionElement(CanSelectCardCondition, "Shoutmon");
  135. bool CanSelectCardCondition(CardSource cardSource)
  136. {
  137. if (cardSource != null)
  138. {
  139. if (cardSource.Owner == card.Owner)
  140. {
  141. if (cardSource.IsDigimon)
  142. {
  143. if (cardSource.CardNames_DigiXros.Contains("Shoutmon"))
  144. {
  145. return true;
  146. }
  147. }
  148. }
  149. }
  150. return false;
  151. }
  152. DigiXrosConditionElement element1 = new DigiXrosConditionElement(CanSelectCardCondition1, "Ballistamon");
  153. bool CanSelectCardCondition1(CardSource cardSource)
  154. {
  155. if (cardSource != null)
  156. {
  157. if (cardSource.Owner == card.Owner)
  158. {
  159. if (cardSource.IsDigimon)
  160. {
  161. if (cardSource.CardNames_DigiXros.Contains("Ballistamon"))
  162. {
  163. return true;
  164. }
  165. }
  166. }
  167. }
  168. return false;
  169. }
  170. DigiXrosConditionElement element2 = new DigiXrosConditionElement(CanSelectCardCondition2, "Dorulumon");
  171. bool CanSelectCardCondition2(CardSource cardSource)
  172. {
  173. if (cardSource != null)
  174. {
  175. if (cardSource.Owner == card.Owner)
  176. {
  177. if (cardSource.IsDigimon)
  178. {
  179. if (cardSource.CardNames_DigiXros.Contains("Dorulumon"))
  180. {
  181. return true;
  182. }
  183. }
  184. }
  185. }
  186. return false;
  187. }
  188. List<DigiXrosConditionElement> elements = new List<DigiXrosConditionElement>() { element, element1, element2 };
  189. DigiXrosCondition digiXrosCondition = new DigiXrosCondition(elements, null, 2);
  190. return digiXrosCondition;
  191. }
  192. return null;
  193. }
  194. }
  195. return cardEffects;
  196. }
  197. }
  198. }