BT18_093.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_093 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Start of Your Turn
  11. if (timing == EffectTiming.OnStartTurn)
  12. {
  13. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  14. }
  15. #endregion
  16. #region Start of Your Main Phase
  17. if (timing == EffectTiming.OnStartMainPhase)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Trash 1 Option or [Ghost]/[Three Musketeers] from hand to <Draw 1>", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  22. cardEffects.Add(activateClass);
  23. string EffectDescription()
  24. {
  25. return
  26. "[Start of Your Main Phase] By trashing 1 Option card or 1 card with the [Ghost]/[Three Musketeers] trait in your hand, <Draw 1>.";
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.IsExistOnBattleArea(card) &&
  31. CardEffectCommons.IsOwnerTurn(card);
  32. }
  33. bool CanSelectCardCondition(CardSource cardSource)
  34. {
  35. return cardSource.IsOption ||
  36. cardSource.ContainsTraits("Ghost") ||
  37. cardSource.ContainsTraits("Three Musketeers");
  38. }
  39. bool CanActivateCondition(Hashtable hashtable)
  40. {
  41. return CardEffectCommons.IsExistOnBattleArea(card) &&
  42. CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable hashtable)
  45. {
  46. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  47. selectHandEffect.SetUp(
  48. canTargetCondition: CanSelectCardCondition,
  49. canTargetCondition_ByPreSelecetedList: null,
  50. canEndSelectCondition: null,
  51. canNoSelect: true,
  52. selectCardCoroutine: null,
  53. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  54. maxCount: 1,
  55. canEndNotMax: false,
  56. isShowOpponent: true,
  57. mode: SelectHandEffect.Mode.Discard,
  58. selectPlayer: card.Owner,
  59. cardEffect: activateClass);
  60. selectHandEffect.SetUpCustomMessage(
  61. "Select 1 Option card or 1 card with the [Ghost]/[Three Musketeers] trait to discard.",
  62. "The opponent is selecting 1 Option card or 1 card with the [Ghost]/[Three Musketeers] trait to discard.");
  63. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  64. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  65. {
  66. if (cardSources.Count > 0)
  67. {
  68. yield return ContinuousController.instance.StartCoroutine(
  69. new DrawClass(card.Owner, 1, activateClass).Draw());
  70. }
  71. }
  72. }
  73. }
  74. #endregion
  75. #region Security Effect
  76. if (timing == EffectTiming.SecuritySkill)
  77. {
  78. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  79. }
  80. #endregion
  81. return cardEffects;
  82. }
  83. }
  84. }