BT12_034.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT12
  5. {
  6. public class BT12_034 : 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.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.CardNames.Contains("Koromon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  18. }
  19. if (timing == EffectTiming.OnEnterFieldAnyone)
  20. {
  21. ActivateClass activateClass = new ActivateClass();
  22. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  23. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  24. cardEffects.Add(activateClass);
  25. string EffectDiscription()
  26. {
  27. return "[On Play] Reveal the top 4 cards of your deck. Add 1 Digimon card with [Greymon] in its name and 1 [Marcus Damon] card among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  28. }
  29. bool CanSelectCardCondition(CardSource cardSource)
  30. {
  31. if (cardSource.IsDigimon)
  32. {
  33. if (cardSource.HasGreymonName)
  34. {
  35. return true;
  36. }
  37. }
  38. return false;
  39. }
  40. bool CanSelectCardCondition1(CardSource cardSource)
  41. {
  42. if (cardSource.CardNames.Contains("Marcus Damon"))
  43. {
  44. return true;
  45. }
  46. if (cardSource.CardNames.Contains("MarcusDamon"))
  47. {
  48. return true;
  49. }
  50. return false;
  51. }
  52. bool CanUseCondition(Hashtable hashtable)
  53. {
  54. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  55. }
  56. bool CanActivateCondition(Hashtable hashtable)
  57. {
  58. if (CardEffectCommons.IsExistOnBattleArea(card))
  59. {
  60. if (card.Owner.LibraryCards.Count >= 1)
  61. {
  62. return true;
  63. }
  64. }
  65. return false;
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  68. {
  69. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  70. revealCount: 4,
  71. simplifiedSelectCardConditions:
  72. new SimplifiedSelectCardConditionClass[]
  73. {
  74. new SimplifiedSelectCardConditionClass(
  75. canTargetCondition:CanSelectCardCondition,
  76. message: "Select 1 Digimon card with [Greymon] in its name.",
  77. mode: SelectCardEffect.Mode.AddHand,
  78. maxCount: 1,
  79. selectCardCoroutine: null),
  80. new SimplifiedSelectCardConditionClass(
  81. canTargetCondition:CanSelectCardCondition1,
  82. message: "Select 1 [Marcus Damon] card.",
  83. mode: SelectCardEffect.Mode.AddHand,
  84. maxCount: 1,
  85. selectCardCoroutine: null),
  86. },
  87. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  88. activateClass: activateClass,
  89. mutualConditions: true
  90. ));
  91. }
  92. }
  93. if (timing == EffectTiming.OnTappedAnyone)
  94. {
  95. ActivateClass activateClass = new ActivateClass();
  96. activateClass.SetUpICardEffect("DP -2000", CanUseCondition, card);
  97. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  98. activateClass.SetIsInheritedEffect(true);
  99. activateClass.SetHashString("DP-2000_BT12_034");
  100. cardEffects.Add(activateClass);
  101. string EffectDiscription()
  102. {
  103. return "[Your Turn][Once Per Turn] If one of your yellow or red Tamers becomes suspended, 1 of your opponent's Digimon gets -2000 DP for the turn.";
  104. }
  105. bool PermanentCondition(Permanent permanent)
  106. {
  107. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  108. {
  109. if (permanent.IsTamer)
  110. {
  111. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  112. {
  113. return true;
  114. }
  115. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  116. {
  117. return true;
  118. }
  119. }
  120. }
  121. return false;
  122. }
  123. bool CanSelectPermanentCondition(Permanent permanent)
  124. {
  125. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  126. }
  127. bool CanUseCondition(Hashtable hashtable)
  128. {
  129. if (CardEffectCommons.IsExistOnBattleArea(card))
  130. {
  131. if (CardEffectCommons.IsOwnerTurn(card))
  132. {
  133. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  134. {
  135. return true;
  136. }
  137. }
  138. }
  139. return false;
  140. }
  141. bool CanActivateCondition(Hashtable hashtable)
  142. {
  143. if (CardEffectCommons.IsExistOnBattleArea(card))
  144. {
  145. return true;
  146. }
  147. return false;
  148. }
  149. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  150. {
  151. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  152. {
  153. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  154. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  155. selectPermanentEffect.SetUp(
  156. selectPlayer: card.Owner,
  157. canTargetCondition: CanSelectPermanentCondition,
  158. canTargetCondition_ByPreSelecetedList: null,
  159. canEndSelectCondition: null,
  160. maxCount: maxCount,
  161. canNoSelect: false,
  162. canEndNotMax: false,
  163. selectPermanentCoroutine: SelectPermanentCoroutine,
  164. afterSelectPermanentCoroutine: null,
  165. mode: SelectPermanentEffect.Mode.Custom,
  166. cardEffect: activateClass);
  167. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -2000.", "The opponent is selecting 1 Digimon that will get DP -2000.");
  168. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  169. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  170. {
  171. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -2000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  172. }
  173. }
  174. }
  175. }
  176. return cardEffects;
  177. }
  178. }
  179. }