BT7_070.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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_070 : 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, true, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[When Digivolving] You may reveal the top 5 cards of your deck. Trash all Tamer cards among them. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. return cardSource.IsTamer;
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerWhenDigivolving(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.RevealDeckTopCardsAndProcessForAll(
  45. revealCount: 5,
  46. simplifiedSelectCardCondition:
  47. new SimplifiedSelectCardConditionClass(
  48. canTargetCondition: CanSelectCardCondition,
  49. message: "",
  50. mode: SelectCardEffect.Mode.Discard,
  51. maxCount: -1,
  52. selectCardCoroutine: null),
  53. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  54. activateClass: activateClass
  55. ));
  56. }
  57. }
  58. if (timing == EffectTiming.OnEnterFieldAnyone)
  59. {
  60. ActivateClass activateClass = new ActivateClass();
  61. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  62. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  63. activateClass.SetIsInheritedEffect(true);
  64. activateClass.SetHashString("Draw1_BT7_070");
  65. cardEffects.Add(activateClass);
  66. string EffectDiscription()
  67. {
  68. return "[Your Turn][Once Per Turn] When you play a Tamer, <Draw 1>. (Draw 1 card from your deck.)";
  69. }
  70. bool PermanentCondition(Permanent permanent)
  71. {
  72. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  73. {
  74. if (permanent.IsTamer)
  75. {
  76. return true;
  77. }
  78. }
  79. return false;
  80. }
  81. bool CanUseCondition(Hashtable hashtable)
  82. {
  83. if (CardEffectCommons.IsExistOnBattleArea(card))
  84. {
  85. if (CardEffectCommons.IsOwnerTurn(card))
  86. {
  87. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  88. {
  89. return true;
  90. }
  91. }
  92. }
  93. return false;
  94. }
  95. bool CanActivateCondition(Hashtable hashtable)
  96. {
  97. if (CardEffectCommons.IsExistOnBattleArea(card))
  98. {
  99. return true;
  100. }
  101. return false;
  102. }
  103. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  104. {
  105. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  106. }
  107. }
  108. return cardEffects;
  109. }
  110. }