BT8_072.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 BT8_072 : 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 3 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 3 cards of your deck. Add 1 Tamer card among them to your hand, and trash 1 purple Digimon card 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 CanSelectCardCondition1(CardSource cardSource)
  28. {
  29. if (cardSource.IsDigimon)
  30. {
  31. if (cardSource.HasCardColor(CardColor.Purple))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanUseCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  41. }
  42. bool CanActivateCondition(Hashtable hashtable)
  43. {
  44. if (CardEffectCommons.IsExistOnBattleArea(card))
  45. {
  46. if (card.Owner.LibraryCards.Count >= 1)
  47. {
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  54. {
  55. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  56. revealCount: 3,
  57. simplifiedSelectCardConditions:
  58. new SimplifiedSelectCardConditionClass[]
  59. {
  60. new SimplifiedSelectCardConditionClass(
  61. canTargetCondition:CanSelectCardCondition,
  62. message: "Select 1 Tamer card.",
  63. mode: SelectCardEffect.Mode.AddHand,
  64. maxCount: 1,
  65. selectCardCoroutine: null),
  66. new SimplifiedSelectCardConditionClass(
  67. canTargetCondition:CanSelectCardCondition1,
  68. message: "Select 1 purple Digimon card.",
  69. mode: SelectCardEffect.Mode.Discard,
  70. maxCount: 1,
  71. selectCardCoroutine: null),
  72. },
  73. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  74. activateClass: activateClass
  75. ));
  76. }
  77. }
  78. return cardEffects;
  79. }
  80. }