BT7_059.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. public class BT7_059 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Reveal the top 5 cards of deck", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] Reveal the top 5 cards of your deck. Add up to 2 cards with [Knightmon] in their names among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. return cardSource.ContainsCardName("Knightmon");
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  30. }
  31. bool CanActivateCondition(Hashtable hashtable)
  32. {
  33. if (CardEffectCommons.IsExistOnBattleArea(card))
  34. {
  35. if (card.Owner.LibraryCards.Count >= 1)
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  43. {
  44. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  45. revealCount: 5,
  46. simplifiedSelectCardConditions:
  47. new SimplifiedSelectCardConditionClass[]
  48. {
  49. new SimplifiedSelectCardConditionClass(
  50. canTargetCondition:CanSelectCardCondition,
  51. message: "Select up to 2 cards with [Knightmon] in their names.",
  52. mode: SelectCardEffect.Mode.AddHand,
  53. maxCount: 2,
  54. selectCardCoroutine: null),
  55. },
  56. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  57. activateClass: activateClass,
  58. canEndSelectCondition: CanEndSelectCondition,
  59. canEndNotMax: true
  60. ));
  61. bool CanEndSelectCondition(List<CardSource> cardSources)
  62. {
  63. if (cardSources.Count <= 0)
  64. {
  65. return false;
  66. }
  67. return true;
  68. }
  69. }
  70. }
  71. if (timing == EffectTiming.None)
  72. {
  73. bool Condition()
  74. {
  75. if (CardEffectCommons.IsExistOnBattleArea(card))
  76. {
  77. if (CardEffectCommons.IsOwnerTurn(card))
  78. {
  79. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Knightmon"))
  80. {
  81. return true;
  82. }
  83. if (card.PermanentOfThisCard().TopCard.ContainsCardName("Bagramon"))
  84. {
  85. return true;
  86. }
  87. }
  88. }
  89. return false;
  90. }
  91. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  92. }
  93. return cardEffects;
  94. }
  95. }