BT10_058.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. namespace DCGO.CardEffects.BT10
  9. {
  10. public class BT10_058 : CEntity_Effect
  11. {
  12. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  13. {
  14. List<ICardEffect> cardEffects = new List<ICardEffect>();
  15. if (timing == EffectTiming.OnEnterFieldAnyone)
  16. {
  17. ActivateClass activateClass = new ActivateClass();
  18. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  19. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  20. cardEffects.Add(activateClass);
  21. string EffectDiscription()
  22. {
  23. return "[On Play] Reveal the top 4 cards of your deck. Add 2 cards that are either black with [Knightmon] or [DeadlyAxemon] in their names or with [Twilight] in their traits among them to your hand. Place the rest at the bottom of your deck in any order.";
  24. }
  25. bool CanSelectCardCondition(CardSource cardSource)
  26. {
  27. if (cardSource.CardTraits.Contains("Twilight"))
  28. {
  29. return true;
  30. }
  31. if (cardSource.HasCardColor(CardColor.Black))
  32. {
  33. if (cardSource.ContainsCardName("Knightmon"))
  34. {
  35. return true;
  36. }
  37. if (cardSource.ContainsCardName("DeadlyAxemon"))
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. bool CanUseCondition(Hashtable hashtable)
  45. {
  46. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. if (card.Owner.LibraryCards.Count >= 1)
  53. {
  54. return true;
  55. }
  56. }
  57. return false;
  58. }
  59. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  62. revealCount: 4,
  63. simplifiedSelectCardConditions:
  64. new SimplifiedSelectCardConditionClass[]
  65. {
  66. new SimplifiedSelectCardConditionClass(
  67. canTargetCondition:CanSelectCardCondition,
  68. message: "Select 2 cards that are either black with [Knightmon] or [DeadlyAxemon] in their names or with [Twilight] in their traits.",
  69. mode: SelectCardEffect.Mode.AddHand,
  70. maxCount: 2,
  71. selectCardCoroutine: null),
  72. },
  73. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  74. activateClass: activateClass
  75. ));
  76. }
  77. }
  78. return cardEffects;
  79. }
  80. }
  81. }