BT12_095.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT12
  5. {
  6. public class BT12_095 : 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.OnStartMainPhase)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Your 1 Digimon with [Agumon] or [Greymon] in its name gets DP +1000 and Blocker", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[Start of Your Main Phase] 1 of your Digimon with [Agumon] or [Greymon] in its name gets +1000 DP and <Blocker> until the end of your opponent's turn.";
  20. }
  21. bool CanSelectPermanentCondition(Permanent permanent)
  22. {
  23. if (permanent != null)
  24. {
  25. if (permanent.TopCard != null)
  26. {
  27. if (permanent.IsDigimon)
  28. {
  29. if (permanent.TopCard.Owner == card.Owner)
  30. {
  31. if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent))
  32. {
  33. if (permanent.TopCard.ContainsCardName("Agumon"))
  34. {
  35. return true;
  36. }
  37. if (permanent.TopCard.HasGreymonName)
  38. {
  39. return true;
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (CardEffectCommons.IsOwnerTurn(card))
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. bool CanActivateCondition(Hashtable hashtable)
  60. {
  61. if (isExistOnField(card))
  62. {
  63. if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard()))
  64. {
  65. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  66. {
  67. return true;
  68. }
  69. }
  70. }
  71. return false;
  72. }
  73. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  74. {
  75. if (isExistOnField(card))
  76. {
  77. if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard()))
  78. {
  79. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  80. {
  81. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  82. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  83. selectPermanentEffect.SetUp(
  84. selectPlayer: card.Owner,
  85. canTargetCondition: CanSelectPermanentCondition,
  86. canTargetCondition_ByPreSelecetedList: null,
  87. canEndSelectCondition: null,
  88. maxCount: maxCount,
  89. canNoSelect: false,
  90. canEndNotMax: false,
  91. selectPermanentCoroutine: SelectPermanentCoroutine,
  92. afterSelectPermanentCoroutine: null,
  93. mode: SelectPermanentEffect.Mode.Custom,
  94. cardEffect: activateClass);
  95. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +1000 and Blocker.", "The opponent is selecting 1 Digimon that will get DP +1000 and Blocker.");
  96. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  97. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  98. {
  99. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  100. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. if (timing == EffectTiming.OnEnterFieldAnyone)
  108. {
  109. ActivateClass activateClass = new ActivateClass();
  110. activateClass.SetUpICardEffect("Your 1 Digimon with [Agumon] or [Greymon] in its name gets DP +1000 and Blocker", CanUseCondition, card);
  111. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  112. cardEffects.Add(activateClass);
  113. string EffectDiscription()
  114. {
  115. return "[On Play] 1 of your Digimon with [Agumon] or [Greymon] in its name gets +1000 DP and <Blocker> until the end of your opponent's turn.";
  116. }
  117. bool CanSelectPermanentCondition(Permanent permanent)
  118. {
  119. if (permanent != null)
  120. {
  121. if (permanent.TopCard != null)
  122. {
  123. if (permanent.IsDigimon)
  124. {
  125. if (permanent.TopCard.Owner == card.Owner)
  126. {
  127. if (permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent))
  128. {
  129. if (permanent.TopCard.ContainsCardName("Agumon"))
  130. {
  131. return true;
  132. }
  133. if (permanent.TopCard.HasGreymonName)
  134. {
  135. return true;
  136. }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. return false;
  143. }
  144. bool CanUseCondition(Hashtable hashtable)
  145. {
  146. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  147. }
  148. bool CanActivateCondition(Hashtable hashtable)
  149. {
  150. if (isExistOnField(card))
  151. {
  152. if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard()))
  153. {
  154. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  155. {
  156. return true;
  157. }
  158. }
  159. }
  160. return false;
  161. }
  162. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  163. {
  164. if (isExistOnField(card))
  165. {
  166. if (card.Owner.GetBattleAreaPermanents().Contains(card.PermanentOfThisCard()))
  167. {
  168. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  169. {
  170. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  171. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  172. selectPermanentEffect.SetUp(
  173. selectPlayer: card.Owner,
  174. canTargetCondition: CanSelectPermanentCondition,
  175. canTargetCondition_ByPreSelecetedList: null,
  176. canEndSelectCondition: null,
  177. maxCount: maxCount,
  178. canNoSelect: false,
  179. canEndNotMax: false,
  180. selectPermanentCoroutine: SelectPermanentCoroutine,
  181. afterSelectPermanentCoroutine: null,
  182. mode: SelectPermanentEffect.Mode.Custom,
  183. cardEffect: activateClass);
  184. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +1000 and Blocker.", "The opponent is selecting 1 Digimon that will get DP +1000 and Blocker.");
  185. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  186. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  187. {
  188. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 1000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  189. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: permanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. if (timing == EffectTiming.OnEnterFieldAnyone)
  197. {
  198. ActivateClass activateClass = new ActivateClass();
  199. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  200. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  201. cardEffects.Add(activateClass);
  202. string EffectDiscription()
  203. {
  204. return "[Your Turn] If one of your Digimon digivolves into a Digimon with [Greymon] or [Omnimon] in its name, by suspending this Tamer, gain 1 memory.";
  205. }
  206. bool PermanentCondition(Permanent permanent)
  207. {
  208. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  209. {
  210. if (permanent.TopCard.HasGreymonName)
  211. {
  212. return true;
  213. }
  214. if (permanent.TopCard.ContainsCardName("Omnimon"))
  215. {
  216. return true;
  217. }
  218. }
  219. return false;
  220. }
  221. bool CanUseCondition(Hashtable hashtable)
  222. {
  223. if (CardEffectCommons.IsExistOnBattleArea(card))
  224. {
  225. if (CardEffectCommons.IsOwnerTurn(card))
  226. {
  227. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition))
  228. {
  229. return true;
  230. }
  231. }
  232. }
  233. return false;
  234. }
  235. bool CanActivateCondition(Hashtable hashtable)
  236. {
  237. return CardEffectCommons.CanActivateSuspendCostEffect(card);
  238. }
  239. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  240. {
  241. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  242. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  243. }
  244. }
  245. if (timing == EffectTiming.SecuritySkill)
  246. {
  247. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  248. }
  249. return cardEffects;
  250. }
  251. }
  252. }