ST23_09.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Atratusmon/Eclipse Impact
  5. namespace DCGO.CardEffects.ST23
  6. {
  7. public class ST23_09 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Digimon Effects
  13. #region Alt Digivolution
  14. if (timing == EffectTiming.None)
  15. {
  16. bool PermanentCondition(Permanent permanent)
  17. {
  18. return permanent.TopCard.HasGlowingDawnTraits;
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 3, false, card, null, level: 5));
  21. }
  22. #endregion
  23. #region Security Attack +1
  24. if (timing == EffectTiming.None)
  25. {
  26. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
  27. }
  28. #endregion
  29. #region Blocker
  30. if (timing == EffectTiming.None)
  31. {
  32. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  33. }
  34. #endregion
  35. #region Reboot
  36. if (timing == EffectTiming.None)
  37. {
  38. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  39. }
  40. #endregion
  41. #region Shared WD / WA
  42. string SharedHashString = "ST23_09_WD_WA";
  43. string SharedEffectName = "immune to digimon effects, delete 1 lowest DP digimon";
  44. string SharedEffectDescription(string tag) => $"[{tag}] [Once Per Turn] Your opponent's Digimon effects don't affect this Digimon until their turn ends. Then, delete 1 of your opponent's Digimon with the lowest DP.";
  45. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  46. {
  47. #region Give Digimon Effect Immunity
  48. Permanent thisPermanent = card.PermanentOfThisCard();
  49. thisPermanent.UntilOpponentTurnEndEffects.Add((_timing) => PermanentEffectFactory.DigimonEffectImmunity(thisPermanent));
  50. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateBuffEffect(thisPermanent));
  51. #endregion
  52. #region Delete 1 Lowest DP Digimon
  53. bool PermanentCondition(Permanent permanent)
  54. {
  55. return CardEffectCommons.IsMinDP(permanent, card.Owner.Enemy);
  56. }
  57. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, PermanentCondition))
  58. {
  59. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, PermanentCondition));
  60. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  61. selectPermanentEffect.SetUp(
  62. selectPlayer: card.Owner,
  63. canTargetCondition: PermanentCondition,
  64. canTargetCondition_ByPreSelecetedList: null,
  65. canEndSelectCondition: null,
  66. maxCount: maxCount,
  67. canNoSelect: false,
  68. canEndNotMax: false,
  69. selectPermanentCoroutine: null,
  70. afterSelectPermanentCoroutine: null,
  71. mode: SelectPermanentEffect.Mode.Destroy,
  72. cardEffect: activateClass);
  73. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
  74. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  75. }
  76. #endregion
  77. }
  78. CardEffectFactory.ActivateClassesForSharedEffects
  79. (ref cardEffects, timing, card,
  80. SharedEffectName,
  81. SharedActivateCoroutine,
  82. SharedEffectDescription,
  83. optional: false,
  84. maxCountPerTurn: 1,
  85. hashValue: SharedHashString,
  86. whenDigivolving: true,
  87. whenAttacking: true);
  88. #endregion
  89. #endregion
  90. #region Option Effects
  91. #region Ignore Colour Requirement
  92. if (timing == EffectTiming.None)
  93. {
  94. cardEffects.Add(CardEffectFactory.UseRequirements(card, CardCondition));
  95. bool CardCondition(CardSource cardSource)
  96. {
  97. return cardSource.HasBeatBreakTraits;
  98. }
  99. }
  100. #endregion
  101. #region Main
  102. if (timing == EffectTiming.OptionSkill)
  103. {
  104. ActivateClass activateClass = new ActivateClass();
  105. activateClass.SetUpICardEffect("Suspend 1 opponent's digimon, bounce 1 of their highest DP suspended digimon to bottom deck", CanUseCondition, card);
  106. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  107. cardEffects.Add(activateClass);
  108. string EffectDiscription()
  109. => "[Main] Suspend 1 of your opponent's Digimon. Then, return 1 of your opponent's suspended Digimon with the highest DP to the bottom of the deck.";
  110. bool CanUseCondition(Hashtable hashtable)
  111. => CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  112. bool CanSelectSuspendPermamentCondition(Permanent permanent)
  113. => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  114. bool CanSelectBouncePermamentCondition(Permanent permanent)
  115. => CardEffectCommons.IsMaxDP(permanent, card.Owner.Enemy, CanBouncePermamentCondition);
  116. bool CanBouncePermamentCondition(Permanent permanent)
  117. => permanent.IsSuspended;
  118. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  119. {
  120. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectSuspendPermamentCondition))
  121. {
  122. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, CanSelectSuspendPermamentCondition));
  123. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  124. selectPermanentEffect.SetUp(
  125. selectPlayer: card.Owner,
  126. canTargetCondition: CanSelectSuspendPermamentCondition,
  127. canTargetCondition_ByPreSelecetedList: null,
  128. canEndSelectCondition: null,
  129. maxCount: maxCount,
  130. canNoSelect: false,
  131. canEndNotMax: false,
  132. selectPermanentCoroutine: null,
  133. afterSelectPermanentCoroutine: null,
  134. mode: SelectPermanentEffect.Mode.Tap,
  135. cardEffect: activateClass);
  136. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to suspend", "The opponent is selecting 1 Digimon to suspend");
  137. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  138. }
  139. if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectBouncePermamentCondition))
  140. {
  141. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOpponentsPermanentCount(card, CanSelectBouncePermamentCondition));
  142. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  143. selectPermanentEffect.SetUp(
  144. selectPlayer: card.Owner,
  145. canTargetCondition: CanSelectBouncePermamentCondition,
  146. canTargetCondition_ByPreSelecetedList: null,
  147. canEndSelectCondition: null,
  148. maxCount: maxCount,
  149. canNoSelect: false,
  150. canEndNotMax: false,
  151. selectPermanentCoroutine: null,
  152. afterSelectPermanentCoroutine: null,
  153. mode: SelectPermanentEffect.Mode.PutLibraryBottom,
  154. cardEffect: activateClass);
  155. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to bottom deck", "The opponent is selecting 1 Digimon to bottom deck");
  156. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  157. }
  158. }
  159. }
  160. #endregion
  161. #region Arts Digivolution
  162. if (timing == EffectTiming.None)
  163. {
  164. cardEffects.Add(CardEffectFactory.ArtsDigivolveEffect(card));
  165. }
  166. #endregion
  167. #endregion
  168. return cardEffects;
  169. }
  170. }
  171. }