BT14_058.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT14
  6. {
  7. public class BT14_058 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Place 1 card to digivolution cards and your 1 Digimon gains Rush", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[On Play] By placing 1 [Satsuki Tamahime] from your hand as this Digimon's bottom digivolution card, 1 of your Digimon gains <Rush> for the turn.";
  21. }
  22. bool CanSelectCardCondition(CardSource cardSource)
  23. {
  24. if (cardSource.CardNames.Contains("Satsuki Tamahime"))
  25. {
  26. return true;
  27. }
  28. if (cardSource.CardNames.Contains("SatsukiTamahime"))
  29. {
  30. return true;
  31. }
  32. return false;
  33. }
  34. bool CanSelectPermanentCondition(Permanent permanent)
  35. {
  36. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  37. }
  38. bool CanUseCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  41. }
  42. bool CanActivateCondition(Hashtable hashtable)
  43. {
  44. if (CardEffectCommons.IsExistOnBattleArea(card))
  45. {
  46. if (card.Owner.HandCards.Count >= 1)
  47. {
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  58. {
  59. List<CardSource> selectedCards = new List<CardSource>();
  60. int maxCount = 1;
  61. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  62. selectHandEffect.SetUp(
  63. selectPlayer: card.Owner,
  64. canTargetCondition: CanSelectCardCondition,
  65. canTargetCondition_ByPreSelecetedList: null,
  66. canEndSelectCondition: null,
  67. maxCount: maxCount,
  68. canNoSelect: true,
  69. canEndNotMax: false,
  70. isShowOpponent: true,
  71. selectCardCoroutine: SelectCardCoroutine,
  72. afterSelectCardCoroutine: null,
  73. mode: SelectHandEffect.Mode.Custom,
  74. cardEffect: activateClass);
  75. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  76. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  77. yield return StartCoroutine(selectHandEffect.Activate());
  78. IEnumerator SelectCardCoroutine(CardSource cardSource)
  79. {
  80. selectedCards.Add(cardSource);
  81. yield return null;
  82. }
  83. if (selectedCards.Count >= 1)
  84. {
  85. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  86. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  87. {
  88. maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  89. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  90. selectPermanentEffect.SetUp(
  91. selectPlayer: card.Owner,
  92. canTargetCondition: CanSelectPermanentCondition,
  93. canTargetCondition_ByPreSelecetedList: null,
  94. canEndSelectCondition: null,
  95. maxCount: maxCount,
  96. canNoSelect: false,
  97. canEndNotMax: false,
  98. selectPermanentCoroutine: SelectPermanentCoroutine,
  99. afterSelectPermanentCoroutine: null,
  100. mode: SelectPermanentEffect.Mode.Custom,
  101. cardEffect: activateClass);
  102. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Rush.", "The opponent is selecting 1 Digimon that will get Rush.");
  103. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  104. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  105. {
  106. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
  107. targetPermanent: permanent,
  108. effectDuration: EffectDuration.UntilEachTurnEnd,
  109. activateClass: activateClass));
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. if (timing == EffectTiming.OnEnterFieldAnyone)
  118. {
  119. ActivateClass activateClass = new ActivateClass();
  120. activateClass.SetUpICardEffect("Place 1 card to digivolution cards and your 1 Digimon gains Rush", CanUseCondition, card);
  121. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  122. cardEffects.Add(activateClass);
  123. string EffectDiscription()
  124. {
  125. return "[When Digivolving] By placing 1 [Satsuki Tamahime] from your hand as this Digimon's bottom digivolution card, 1 of your Digimon gains <Rush> for the turn.";
  126. }
  127. bool CanSelectCardCondition(CardSource cardSource)
  128. {
  129. if (cardSource.CardNames.Contains("Satsuki Tamahime"))
  130. {
  131. return true;
  132. }
  133. if (cardSource.CardNames.Contains("SatsukiTamahime"))
  134. {
  135. return true;
  136. }
  137. return false;
  138. }
  139. bool CanSelectPermanentCondition(Permanent permanent)
  140. {
  141. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  142. }
  143. bool CanUseCondition(Hashtable hashtable)
  144. {
  145. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  146. }
  147. bool CanActivateCondition(Hashtable hashtable)
  148. {
  149. if (CardEffectCommons.IsExistOnBattleArea(card))
  150. {
  151. if (card.Owner.HandCards.Count >= 1)
  152. {
  153. return true;
  154. }
  155. }
  156. return false;
  157. }
  158. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  159. {
  160. if (CardEffectCommons.IsExistOnBattleArea(card))
  161. {
  162. if (card.Owner.HandCards.Count(CanSelectCardCondition) >= 1)
  163. {
  164. List<CardSource> selectedCards = new List<CardSource>();
  165. int maxCount = 1;
  166. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  167. selectHandEffect.SetUp(
  168. selectPlayer: card.Owner,
  169. canTargetCondition: CanSelectCardCondition,
  170. canTargetCondition_ByPreSelecetedList: null,
  171. canEndSelectCondition: null,
  172. maxCount: maxCount,
  173. canNoSelect: true,
  174. canEndNotMax: false,
  175. isShowOpponent: true,
  176. selectCardCoroutine: SelectCardCoroutine,
  177. afterSelectCardCoroutine: null,
  178. mode: SelectHandEffect.Mode.Custom,
  179. cardEffect: activateClass);
  180. selectHandEffect.SetUpCustomMessage("Select 1 card to place on bottom of digivolution cards.", "The opponent is selecting 1 card to place on bottom of digivolution cards.");
  181. selectHandEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
  182. yield return StartCoroutine(selectHandEffect.Activate());
  183. IEnumerator SelectCardCoroutine(CardSource cardSource)
  184. {
  185. selectedCards.Add(cardSource);
  186. yield return null;
  187. }
  188. if (selectedCards.Count >= 1)
  189. {
  190. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(selectedCards, activateClass));
  191. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  192. {
  193. maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  194. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  195. selectPermanentEffect.SetUp(
  196. selectPlayer: card.Owner,
  197. canTargetCondition: CanSelectPermanentCondition,
  198. canTargetCondition_ByPreSelecetedList: null,
  199. canEndSelectCondition: null,
  200. maxCount: maxCount,
  201. canNoSelect: false,
  202. canEndNotMax: false,
  203. selectPermanentCoroutine: SelectPermanentCoroutine,
  204. afterSelectPermanentCoroutine: null,
  205. mode: SelectPermanentEffect.Mode.Custom,
  206. cardEffect: activateClass);
  207. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Rush.", "The opponent is selecting 1 Digimon that will get Rush.");
  208. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  209. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  210. {
  211. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRush(
  212. targetPermanent: permanent,
  213. effectDuration: EffectDuration.UntilEachTurnEnd,
  214. activateClass: activateClass));
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. if (timing == EffectTiming.None)
  223. {
  224. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  225. }
  226. return cardEffects;
  227. }
  228. }
  229. }