EX7_068.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX7
  4. {
  5. public class EX7_068 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Main Effect
  11. if (timing == EffectTiming.OptionSkill)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  15. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  16. cardEffects.Add(activateClass);
  17. string EffectDescription()
  18. {
  19. return
  20. "[Main] <Draw 1>. Then, you may play 1 level 3 Digimon card with the [Puppet] trait from your hand without paying the cost.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  25. }
  26. bool IsLevel3PuppetCardCondition(CardSource cardSource)
  27. {
  28. return cardSource.IsDigimon &&
  29. cardSource.HasLevel &&
  30. cardSource.IsLevel3 &&
  31. cardSource.ContainsTraits("Puppet") &&
  32. CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
  33. }
  34. IEnumerator ActivateCoroutine(Hashtable hashtable)
  35. {
  36. if (card.Owner.LibraryCards.Count >= 1)
  37. {
  38. yield return ContinuousController.instance.StartCoroutine(
  39. new DrawClass(card.Owner, 1, activateClass).Draw());
  40. }
  41. if (CardEffectCommons.HasMatchConditionOwnersHand(card, IsLevel3PuppetCardCondition))
  42. {
  43. List<CardSource> selectedCards = new List<CardSource>();
  44. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  45. selectHandEffect.SetUp(
  46. selectPlayer: card.Owner,
  47. canTargetCondition: IsLevel3PuppetCardCondition,
  48. canTargetCondition_ByPreSelecetedList: null,
  49. canEndSelectCondition: null,
  50. maxCount: 1,
  51. canNoSelect: true,
  52. canEndNotMax: false,
  53. isShowOpponent: true,
  54. selectCardCoroutine: SelectCardCoroutine,
  55. afterSelectCardCoroutine: null,
  56. mode: SelectHandEffect.Mode.Custom,
  57. cardEffect: activateClass);
  58. selectHandEffect.SetUpCustomMessage("Select 1 Digimon card to play.",
  59. "The opponent is selecting 1 Digimon card to play.");
  60. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  61. yield return StartCoroutine(selectHandEffect.Activate());
  62. IEnumerator SelectCardCoroutine(CardSource cardSource)
  63. {
  64. selectedCards.Add(cardSource);
  65. yield return null;
  66. }
  67. yield return ContinuousController.instance.StartCoroutine(
  68. CardEffectCommons.PlayPermanentCards(cardSources: selectedCards, activateClass: activateClass,
  69. payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
  70. }
  71. }
  72. }
  73. #endregion
  74. #region Security Effect
  75. if (timing == EffectTiming.SecuritySkill)
  76. {
  77. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects,
  78. effectName:
  79. $"<Draw 1>. Then, you may play 1 level 3 Digimon card with the [Puppet] trait from your hand without paying the cost.");
  80. }
  81. #endregion
  82. return cardEffects;
  83. }
  84. }
  85. }