BT3_063.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 BT3_063 : 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.OnDestroyedAnyone)
  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 Deletion] Reveal the top 3 cards of your deck. You may play 1 [Chuumon] among them without paying its memory cost. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
  26. {
  27. if (cardSource.CardNames.Contains("Chuumon"))
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.CanActivateOnDeletion(card, activateClass))
  41. {
  42. if (card.Owner.LibraryCards.Count >= 1)
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. List<CardSource> selectedCards = new List<CardSource>();
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  53. revealCount: 3,
  54. simplifiedSelectCardConditions:
  55. new SimplifiedSelectCardConditionClass[]
  56. {
  57. new SimplifiedSelectCardConditionClass(
  58. canTargetCondition:CanSelectCardCondition,
  59. message: "Select 1 [Chuumon].",
  60. mode: SelectCardEffect.Mode.Custom,
  61. maxCount: 1,
  62. selectCardCoroutine: SelectCardCoroutine),
  63. },
  64. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  65. activateClass: activateClass,
  66. canNoSelect: true
  67. ));
  68. IEnumerator SelectCardCoroutine(CardSource cardSource)
  69. {
  70. selectedCards.Add(cardSource);
  71. yield return null;
  72. }
  73. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  74. cardSources: selectedCards,
  75. activateClass: activateClass,
  76. payCost: false,
  77. isTapped: false,
  78. root: SelectCardEffect.Root.Library,
  79. activateETB: true));
  80. }
  81. }
  82. return cardEffects;
  83. }
  84. }