BT12_007.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT12
  4. {
  5. public class BT12_007 : 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 all of the [Takato Matsuki] cards 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.CardNames.Contains("Takato Matsuki"))
  23. {
  24. return true;
  25. }
  26. if (cardSource.CardNames.Contains("TakatoMatsuki"))
  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.RevealDeckTopCardsAndProcessForAll(
  50. revealCount: 4,
  51. simplifiedSelectCardCondition:
  52. new SimplifiedSelectCardConditionClass(
  53. canTargetCondition: CanSelectCardCondition,
  54. message: "",
  55. mode: SelectCardEffect.Mode.AddHand,
  56. maxCount: -1,
  57. selectCardCoroutine: null),
  58. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  59. activateClass: activateClass
  60. ));
  61. }
  62. }
  63. if (timing == EffectTiming.None)
  64. {
  65. bool Condition()
  66. {
  67. if (CardEffectCommons.IsExistOnBattleArea(card))
  68. {
  69. if (CardEffectCommons.IsOwnerTurn(card))
  70. {
  71. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Growlmon"))
  72. {
  73. return true;
  74. }
  75. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Gallantmon"))
  76. {
  77. return true;
  78. }
  79. }
  80. }
  81. return false;
  82. }
  83. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  84. }
  85. return cardEffects;
  86. }
  87. }
  88. }