EX6_020.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. namespace DCGO.CardEffects.EX6
  5. {
  6. public class EX6_020 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region On Play/When Digivolving Shared
  12. bool CanSelectDigimonCardSharedCondition(CardSource cardSource)
  13. {
  14. if (cardSource.IsDigimon)
  15. {
  16. if (cardSource.CardTraits.Contains("Angel") ||
  17. cardSource.CardTraits.Contains("Archangel") ||
  18. cardSource.CardTraits.Contains("Fallen Angel") ||
  19. cardSource.CardTraits.Contains("FallenAngel"))
  20. {
  21. return true;
  22. }
  23. }
  24. return false;
  25. }
  26. bool CanSelectTamerCardSharedCondition(CardSource cardSource)
  27. {
  28. if (cardSource.IsTamer)
  29. {
  30. if (cardSource.CardNames.Contains("Mirei Mikagura") ||
  31. cardSource.CardNames.Contains("MireiMikagura"))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanActivateSharedCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (card.Owner.LibraryCards.Count >= 1)
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. #endregion
  50. #region On Play
  51. if (timing == EffectTiming.OnEnterFieldAnyone)
  52. {
  53. ActivateClass activateClass = new ActivateClass();
  54. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  55. activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, false,
  56. EffectDescription());
  57. cardEffects.Add(activateClass);
  58. bool CanUseCondition(Hashtable hashtable)
  59. {
  60. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  61. }
  62. string EffectDescription()
  63. {
  64. return
  65. "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Angel]/[Archangel]/[Fallen Angel] trait and 1 [Mirei Mikagura] among them to the hand. Return the rest to the bottom of the deck.";
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable hashtable)
  68. {
  69. yield return ContinuousController.instance.StartCoroutine(
  70. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  71. revealCount: 3,
  72. simplifiedSelectCardConditions:
  73. new[]
  74. {
  75. new SimplifiedSelectCardConditionClass(
  76. canTargetCondition: CanSelectDigimonCardSharedCondition,
  77. message: "Select 1 Digimon card with the [Angel]/[Archangel]/[Fallen Angel] trait.",
  78. mode: SelectCardEffect.Mode.AddHand,
  79. maxCount: 1,
  80. selectCardCoroutine: null),
  81. new SimplifiedSelectCardConditionClass(
  82. canTargetCondition: CanSelectTamerCardSharedCondition,
  83. message: "Select 1 Tamer card with [Mirei Mikagura] in its name.",
  84. mode: SelectCardEffect.Mode.AddHand,
  85. maxCount: 1,
  86. selectCardCoroutine: null),
  87. },
  88. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  89. activateClass: activateClass
  90. ));
  91. }
  92. }
  93. #endregion
  94. #region When Digivolving
  95. if (timing == EffectTiming.OnEnterFieldAnyone)
  96. {
  97. ActivateClass activateClass = new ActivateClass();
  98. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  99. activateClass.SetUpActivateClass(CanActivateSharedCondition, ActivateCoroutine, -1, false,
  100. EffectDescription());
  101. cardEffects.Add(activateClass);
  102. bool CanUseCondition(Hashtable hashtable)
  103. {
  104. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  105. }
  106. string EffectDescription()
  107. {
  108. return
  109. "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with the [Angel]/[Archangel]/[Fallen Angel] trait and 1 [Mirei Mikagura] among them to the hand. Return the rest to the bottom of the deck.";
  110. }
  111. IEnumerator ActivateCoroutine(Hashtable hashtable)
  112. {
  113. yield return ContinuousController.instance.StartCoroutine(
  114. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  115. revealCount: 3,
  116. simplifiedSelectCardConditions:
  117. new[]
  118. {
  119. new SimplifiedSelectCardConditionClass(
  120. canTargetCondition: CanSelectDigimonCardSharedCondition,
  121. message: "Select 1 Digimon card with the [Angel]/[Archangel]/[Fallen Angel] trait.",
  122. mode: SelectCardEffect.Mode.AddHand,
  123. maxCount: 1,
  124. selectCardCoroutine: null),
  125. new SimplifiedSelectCardConditionClass(
  126. canTargetCondition: CanSelectTamerCardSharedCondition,
  127. message: "Select 1 Tamer card with [Mirei Mikagura] in its name.",
  128. mode: SelectCardEffect.Mode.AddHand,
  129. maxCount: 1,
  130. selectCardCoroutine: null),
  131. },
  132. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  133. activateClass: activateClass
  134. ));
  135. }
  136. }
  137. #endregion
  138. #region When Attacking - ESS
  139. if (timing == EffectTiming.OnAllyAttack)
  140. {
  141. ActivateClass activateClass = new ActivateClass();
  142. activateClass.SetUpICardEffect("DP -2000", CanUseCondition, card);
  143. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
  144. EffectDescription());
  145. activateClass.SetIsInheritedEffect(true);
  146. activateClass.SetHashString("DP-2000_EX6-020");
  147. cardEffects.Add(activateClass);
  148. string EffectDescription()
  149. {
  150. return "[When Attacking][Once Per Turn] 1 of your opponent's Digimon gets -2000 DP for the turn.";
  151. }
  152. bool CanSelectPermanentCondition(Permanent permanent)
  153. {
  154. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  155. }
  156. bool CanUseCondition(Hashtable hashtable)
  157. {
  158. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  159. }
  160. bool CanActivateCondition(Hashtable hashtable)
  161. {
  162. if (CardEffectCommons.IsExistOnBattleArea(card))
  163. {
  164. return true;
  165. }
  166. return false;
  167. }
  168. IEnumerator ActivateCoroutine(Hashtable hashtable)
  169. {
  170. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  171. {
  172. int maxCount = Math.Min(1,
  173. CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  174. SelectPermanentEffect selectPermanentEffect =
  175. GManager.instance.GetComponent<SelectPermanentEffect>();
  176. selectPermanentEffect.SetUp(
  177. selectPlayer: card.Owner,
  178. canTargetCondition: CanSelectPermanentCondition,
  179. canTargetCondition_ByPreSelecetedList: null,
  180. canEndSelectCondition: null,
  181. maxCount: maxCount,
  182. canNoSelect: false,
  183. canEndNotMax: false,
  184. selectPermanentCoroutine: SelectPermanentCoroutine,
  185. afterSelectPermanentCoroutine: null,
  186. mode: SelectPermanentEffect.Mode.Custom,
  187. cardEffect: activateClass);
  188. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -2000.",
  189. "The opponent is selecting 1 Digimon that will get DP -2000.");
  190. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  191. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  192. {
  193. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  194. targetPermanent: permanent,
  195. changeValue: -2000,
  196. effectDuration: EffectDuration.UntilEachTurnEnd,
  197. activateClass: activateClass));
  198. }
  199. }
  200. }
  201. }
  202. #endregion
  203. return cardEffects;
  204. }
  205. }
  206. }