BT13_061.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT13
  4. {
  5. public class BT13_061 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.None)
  11. {
  12. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  13. }
  14. if (timing == EffectTiming.OnDestroyedAnyone)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return "[On Deletion] If it's your opponent's turn, reveal the top 3 cards of your deck. Add 1 black card among them to the hand. Place the rest at the bottom of the deck in any order.";
  23. }
  24. bool CanSelectCardCondition(CardSource cardSource)
  25. {
  26. return cardSource.HasCardColor(CardColor.Black);
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. if (CardEffectCommons.CanActivateOnDeletion(card, activateClass))
  35. {
  36. if (card.Owner.LibraryCards.Count >= 1)
  37. {
  38. if (CardEffectCommons.IsOpponentTurn(card))
  39. {
  40. return true;
  41. }
  42. }
  43. }
  44. return false;
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  47. {
  48. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  49. revealCount: 3,
  50. simplifiedSelectCardConditions:
  51. new SimplifiedSelectCardConditionClass[]
  52. {
  53. new SimplifiedSelectCardConditionClass(
  54. canTargetCondition:CanSelectCardCondition,
  55. message: "Select 1 black card to add to your hand.",
  56. mode: SelectCardEffect.Mode.AddHand,
  57. maxCount: 1,
  58. selectCardCoroutine: null),
  59. },
  60. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  61. activateClass: activateClass
  62. ));
  63. }
  64. }
  65. return cardEffects;
  66. }
  67. }
  68. }