EX2_062.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX2
  4. {
  5. public class EX2_062 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] Reveal the top 4 cards of your deck. Add 1 card with [Dramon] or [Justimon] in its name among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.HasDramonName)
  23. {
  24. return true;
  25. }
  26. if (cardSource.ContainsCardName("Justimon"))
  27. {
  28. return true;
  29. }
  30. return false;
  31. }
  32. bool CanUseCondition(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  35. }
  36. bool CanActivateCondition(Hashtable hashtable)
  37. {
  38. if (CardEffectCommons.IsExistOnBattleArea(card))
  39. {
  40. if (card.Owner.LibraryCards.Count >= 1)
  41. {
  42. return true;
  43. }
  44. }
  45. return false;
  46. }
  47. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  48. {
  49. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  50. revealCount: 4,
  51. simplifiedSelectCardConditions:
  52. new SimplifiedSelectCardConditionClass[]
  53. {
  54. new SimplifiedSelectCardConditionClass(
  55. canTargetCondition:CanSelectCardCondition,
  56. message: "Select 1 card with [Dramon] or [Justimon] in its name.",
  57. mode: SelectCardEffect.Mode.AddHand,
  58. maxCount: 1,
  59. selectCardCoroutine: null),
  60. },
  61. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  62. activateClass: activateClass
  63. ));
  64. }
  65. }
  66. if (timing == EffectTiming.OnAllyAttack)
  67. {
  68. ActivateClass activateClass = new ActivateClass();
  69. activateClass.SetUpICardEffect("Your attacking Digimon gains DP +1000", CanUseCondition, card);
  70. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  71. cardEffects.Add(activateClass);
  72. string EffectDiscription()
  73. {
  74. return "[Your Turn] When you attack with a black Digimon, you may suspend this Tamer to have that Digimon get +1000 DP until the end of your opponent's turn.";
  75. }
  76. bool PermanentCondition(Permanent permanent)
  77. {
  78. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  79. {
  80. if (permanent.TopCard.CardColors.Contains(CardColor.Black))
  81. {
  82. return true;
  83. }
  84. }
  85. return false;
  86. }
  87. bool CanUseCondition(Hashtable hashtable)
  88. {
  89. if (CardEffectCommons.IsExistOnBattleArea(card))
  90. {
  91. if (CardEffectCommons.IsOwnerTurn(card))
  92. {
  93. if (CardEffectCommons.CanTriggerOnPermanentAttack(hashtable, PermanentCondition))
  94. {
  95. return true;
  96. }
  97. }
  98. }
  99. return false;
  100. }
  101. bool CanActivateCondition(Hashtable hashtable)
  102. {
  103. if (CardEffectCommons.IsExistOnBattleArea(card))
  104. {
  105. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  106. {
  107. return true;
  108. }
  109. }
  110. return false;
  111. }
  112. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  113. {
  114. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(
  115. new List<Permanent>() { card.PermanentOfThisCard() },
  116. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  117. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  118. targetPermanent: GManager.instance.attackProcess.AttackingPermanent,
  119. changeValue: 1000,
  120. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  121. activateClass: activateClass));
  122. }
  123. }
  124. if (timing == EffectTiming.SecuritySkill)
  125. {
  126. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  127. }
  128. return cardEffects;
  129. }
  130. }
  131. }