BT13_018.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace DCGO.CardEffects.BT13
  6. {
  7. public class BT13_018 : 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.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.ContainsCardName("RizeGreymon") && targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 5;
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 3, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. if (timing == EffectTiming.OnStartMainPhase)
  21. {
  22. ActivateClass activateClass = new ActivateClass();
  23. activateClass.SetUpICardEffect("Your 1 [Marcus Damon] becomes Digimon", CanUseCondition, card);
  24. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  25. cardEffects.Add(activateClass);
  26. string EffectDiscription()
  27. {
  28. return "[Start of Your Main Phase] Until the end of your opponent's turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon, can't digivolve, and gains <Blocker>.";
  29. }
  30. bool CanSelectPermanentCondition(Permanent permanent)
  31. {
  32. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  33. {
  34. if (permanent.TopCard.CardNames.Contains("Marcus Damon"))
  35. {
  36. return true;
  37. }
  38. if (permanent.TopCard.CardNames.Contains("MarcusDamon"))
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. if (CardEffectCommons.IsExistOnBattleArea(card))
  48. {
  49. if (CardEffectCommons.IsOwnerTurn(card))
  50. {
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. bool CanActivateCondition(Hashtable hashtable)
  57. {
  58. if (CardEffectCommons.IsExistOnBattleArea(card))
  59. {
  60. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  61. {
  62. return true;
  63. }
  64. }
  65. return false;
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  68. {
  69. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  70. {
  71. int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
  72. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  73. selectPermanentEffect.SetUp(
  74. selectPlayer: card.Owner,
  75. canTargetCondition: CanSelectPermanentCondition,
  76. canTargetCondition_ByPreSelecetedList: null,
  77. canEndSelectCondition: null,
  78. maxCount: maxCount,
  79. canNoSelect: false,
  80. canEndNotMax: false,
  81. selectPermanentCoroutine: SelectPermanentCoroutine,
  82. afterSelectPermanentCoroutine: null,
  83. mode: SelectPermanentEffect.Mode.Custom,
  84. cardEffect: activateClass);
  85. selectPermanentEffect.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
  86. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  87. IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
  88. {
  89. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  90. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  91. }
  92. }
  93. }
  94. }
  95. if (timing == EffectTiming.OnEnterFieldAnyone)
  96. {
  97. ActivateClass activateClass = new ActivateClass();
  98. activateClass.SetUpICardEffect("Your 1 [Marcus Damon] becomes Digimon", CanUseCondition, card);
  99. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  100. cardEffects.Add(activateClass);
  101. string EffectDiscription()
  102. {
  103. return "[When Digivolving] Until the end of your opponent's turn, 1 of your [Marcus Damon]s is also treated as a 3000 DP Digimon, can't digivolve, and gains <Blocker>.";
  104. }
  105. bool CanSelectPermanentCondition(Permanent permanent)
  106. {
  107. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  108. {
  109. if (permanent.TopCard.CardNames.Contains("Marcus Damon"))
  110. {
  111. return true;
  112. }
  113. if (permanent.TopCard.CardNames.Contains("MarcusDamon"))
  114. {
  115. return true;
  116. }
  117. }
  118. return false;
  119. }
  120. bool CanUseCondition(Hashtable hashtable)
  121. {
  122. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  123. }
  124. bool CanActivateCondition(Hashtable hashtable)
  125. {
  126. if (CardEffectCommons.IsExistOnBattleArea(card))
  127. {
  128. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  129. {
  130. return true;
  131. }
  132. }
  133. return false;
  134. }
  135. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  136. {
  137. if (card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition) >= 1)
  138. {
  139. int maxCount = Math.Min(1, card.Owner.GetBattleAreaPermanents().Count(CanSelectPermanentCondition));
  140. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  141. selectPermanentEffect.SetUp(
  142. selectPlayer: card.Owner,
  143. canTargetCondition: CanSelectPermanentCondition,
  144. canTargetCondition_ByPreSelecetedList: null,
  145. canEndSelectCondition: null,
  146. maxCount: maxCount,
  147. canNoSelect: false,
  148. canEndNotMax: false,
  149. selectPermanentCoroutine: SelectPermanentCoroutine,
  150. afterSelectPermanentCoroutine: null,
  151. mode: SelectPermanentEffect.Mode.Custom,
  152. cardEffect: activateClass);
  153. selectPermanentEffect.SetUpCustomMessage("Select 1 [Marcus Damon].", "The opponent is selecting 1 [Marcus Damon].");
  154. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  155. IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
  156. {
  157. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  158. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  159. }
  160. }
  161. }
  162. }
  163. if (timing == EffectTiming.OnTappedAnyone)
  164. {
  165. ActivateClass activateClass = new ActivateClass();
  166. activateClass.SetUpICardEffect("DP -6000", CanUseCondition, card);
  167. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  168. activateClass.SetHashString("DP-6000_BT13_018");
  169. cardEffects.Add(activateClass);
  170. string EffectDiscription()
  171. {
  172. return "[All Turns][Once Per Turn] When one of your red or yellow Tamers becomes suspended, 1 of your opponent's Digimon gets -6000 DP for the turn.";
  173. }
  174. bool PermanentCondition(Permanent permanent)
  175. {
  176. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  177. {
  178. if (permanent.IsTamer)
  179. {
  180. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  181. {
  182. return true;
  183. }
  184. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  185. {
  186. return true;
  187. }
  188. }
  189. }
  190. return false;
  191. }
  192. bool CanSelectPermanentCondition(Permanent permanent)
  193. {
  194. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  195. }
  196. bool CanUseCondition(Hashtable hashtable)
  197. {
  198. if (CardEffectCommons.IsExistOnBattleArea(card))
  199. {
  200. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  201. {
  202. return true;
  203. }
  204. }
  205. return false;
  206. }
  207. bool CanActivateCondition(Hashtable hashtable)
  208. {
  209. if (CardEffectCommons.IsExistOnBattleArea(card))
  210. {
  211. return true;
  212. }
  213. return false;
  214. }
  215. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  216. {
  217. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  218. {
  219. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  220. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  221. selectPermanentEffect.SetUp(
  222. selectPlayer: card.Owner,
  223. canTargetCondition: CanSelectPermanentCondition,
  224. canTargetCondition_ByPreSelecetedList: null,
  225. canEndSelectCondition: null,
  226. maxCount: maxCount,
  227. canNoSelect: false,
  228. canEndNotMax: false,
  229. selectPermanentCoroutine: SelectPermanentCoroutine,
  230. afterSelectPermanentCoroutine: null,
  231. mode: SelectPermanentEffect.Mode.Custom,
  232. cardEffect: activateClass);
  233. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -6000.", "The opponent is selecting 1 Digimon that will get DP -6000.");
  234. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  235. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  236. {
  237. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -6000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  238. }
  239. }
  240. }
  241. }
  242. return cardEffects;
  243. }
  244. }
  245. }