ST24_09.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Sunflowmon
  5. namespace DCGO.CardEffects.ST24
  6. {
  7. public class ST24_09 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alt Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. static bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.EqualsTraits("DATA SQUAD");
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(level: 3, permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
  20. }
  21. #endregion
  22. #region Shared OP/WD
  23. string SharedEffectName = "May suspend enemy Digimon or Tamer, may place top deck face down under [DATA SQUAD] tamer";
  24. CardEffectFactory.ActivateClassesForSharedEffects
  25. (ref cardEffects, timing, card,
  26. SharedEffectName,
  27. SharedActivateCoroutine,
  28. SharedEffectDescription,
  29. optional: false,
  30. onPlay: true,
  31. whenDigivolving: true);
  32. string SharedEffectDescription(string tag) => $"[{tag}] You may suspend 1 of your opponent's Digimon or Tamers. Then, you may place the top card of your deck face down under any of your [DATA SQUAD] trait Tamers.";
  33. bool CanSelectPermanentCondition(Permanent permanent)
  34. {
  35. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
  36. && (permanent.TopCard.IsDigimon
  37. || permanent.TopCard.IsTamer);
  38. }
  39. bool CanSelectOwnDataSquadTamer(Permanent permanent)
  40. {
  41. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaTamer(permanent, card)
  42. && permanent.TopCard.EqualsTraits("DATA SQUAD");
  43. }
  44. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  45. {
  46. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  47. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  48. selectPermanentEffect.SetUp(
  49. selectPlayer: card.Owner,
  50. canTargetCondition: CanSelectPermanentCondition,
  51. canTargetCondition_ByPreSelecetedList: null,
  52. canEndSelectCondition: null,
  53. maxCount: maxCount,
  54. canNoSelect: true,
  55. canEndNotMax: false,
  56. selectPermanentCoroutine: null,
  57. afterSelectPermanentCoroutine: null,
  58. mode: SelectPermanentEffect.Mode.Tap,
  59. cardEffect: activateClass);
  60. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon/Tamer to suspend.", "The opponent is selecting 1 Digimon/Tamer to suspend.");
  61. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  62. if (card.Owner.LibraryCards.Count > 1 && CardEffectCommons.HasMatchConditionPermanent(CanSelectOwnDataSquadTamer))
  63. {
  64. SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
  65. selectPermanentEffect1.SetUp(
  66. selectPlayer: card.Owner,
  67. canTargetCondition: CanSelectOwnDataSquadTamer,
  68. canTargetCondition_ByPreSelecetedList: null,
  69. canEndSelectCondition: null,
  70. maxCount: 1,
  71. canNoSelect: true,
  72. canEndNotMax: false,
  73. selectPermanentCoroutine: null,
  74. afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
  75. mode: SelectPermanentEffect.Mode.Custom,
  76. cardEffect: activateClass);
  77. selectPermanentEffect1.SetUpCustomMessage("Select 1 [DATA SQUAD] trait Tamer to place the top card of your deck face down under.", "The opponent is selecting 1 [DATA SQUAD] trait Tamer to place the top card of your deck face down under.");
  78. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
  79. IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanent)
  80. {
  81. if (permanent != null)
  82. {
  83. yield return ContinuousController.instance.StartCoroutine(permanent[0].AddDigivolutionCardsBottom(
  84. new List<CardSource> { card.Owner.LibraryCards[0] }, activateClass, isFacedown: true));
  85. }
  86. }
  87. }
  88. }
  89. #endregion
  90. #region Inherited
  91. if (timing == EffectTiming.None)
  92. {
  93. bool Condition()
  94. {
  95. return CardEffectCommons.IsExistOnBattleArea(card);
  96. }
  97. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  98. }
  99. #endregion
  100. return cardEffects;
  101. }
  102. }
  103. }