EX7_072.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Seventh Fascination
  4. namespace DCGO.CardEffects.EX7
  5. {
  6. public class EX7_072 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Trash Your Turn
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Return this to bottom of deck, Activate Main", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return "[Trash] [Your Turn] When your Digimon digivolves into [Lilithmon (X Antibody)], by returning this card to the bottom of the deck, activate this card's [Main] effect.";
  21. }
  22. bool PermanentCondition(Permanent permanent)
  23. {
  24. return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
  25. && (permanent.TopCard.CardNames.Contains("Lilithmon (X Antibody)")
  26. || permanent.TopCard.CardNames.Contains("Lilithmon(XAntibody)"));
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.IsExistOnTrashTrigger(card, activateClass)
  31. && CardEffectCommons.IsOwnerTurn(card)
  32. && CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition);
  33. }
  34. bool CanActivateCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.IsExistOnTrashActivate(card, activateClass);
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable hashtable)
  39. {
  40. List<CardSource> cardSources = new List<CardSource>() { card };
  41. yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddLibraryBottomCards(cardSources));
  42. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().ShowCardEffect2(cardSources, "Deck Bottom Card", true, true));
  43. ActivateClass mainActivateClass = CardEffectCommons.OptionMainEffect(card);
  44. if (mainActivateClass != null)
  45. {
  46. yield return ContinuousController.instance.StartCoroutine(mainActivateClass.Activate(CardEffectCommons.OptionMainCheckHashtable(card)));
  47. }
  48. }
  49. }
  50. #endregion
  51. #region Main
  52. if (timing == EffectTiming.OptionSkill)
  53. {
  54. ActivateClass activateClass = new ActivateClass();
  55. activateClass.SetUpICardEffect("All Opponents Digimon gain \"Delete 1 of your Digimon\"", CanUseCondition, card);
  56. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  57. cardEffects.Add(activateClass);
  58. string EffectDescription()
  59. {
  60. return "[Main] All your opponent's Digimon gain \" [End of Your Turn] Delete 1 of your Digimon.\" until the end of their turn.";
  61. }
  62. bool CanUseCondition(Hashtable hashtable)
  63. {
  64. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  65. }
  66. IEnumerator ActivateCoroutine(Hashtable hashtable)
  67. {
  68. bool PermanentCondition(Permanent permanent)
  69. {
  70. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
  71. && !permanent.TopCard.CanNotBeAffected(activateClass);
  72. }
  73. AddSkillClass addSkillClass = new AddSkillClass();
  74. addSkillClass.SetUpICardEffect("Your opponent's Digimon gain [End of your Turn] Delete 1 of your Digimon", CanUseCondition, card);
  75. addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
  76. card.Owner.UntilOpponentTurnEndEffects.Add((_timing) => addSkillClass);
  77. bool CanUseCondition(Hashtable hashtable)
  78. {
  79. return true;
  80. }
  81. bool CardSourceCondition(CardSource cardSource)
  82. {
  83. return PermanentCondition(cardSource.PermanentOfThisCard())
  84. && cardSource == cardSource.PermanentOfThisCard().TopCard;
  85. }
  86. List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
  87. {
  88. if (_timing == EffectTiming.OnEndTurn)
  89. {
  90. ActivateClass activateClass1 = new ActivateClass();
  91. activateClass1.SetUpICardEffect("Delete 1 of your Digimon", CanUseCondition1, cardSource);
  92. activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDescription1());
  93. cardEffects.Add(activateClass1);
  94. string EffectDescription1()
  95. {
  96. return "[End of Your Turn] Delete 1 of your Digimon.";
  97. }
  98. bool CanUseCondition1(Hashtable hashtable)
  99. {
  100. return CardEffectCommons.IsExistOnBattleAreaTrigger(cardSource, activateClass1)
  101. && CardEffectCommons.IsOwnerTurn(cardSource)
  102. && !cardSource.CanNotBeAffected(activateClass);
  103. }
  104. bool CanActivateCondition1(Hashtable hashtable)
  105. {
  106. return CardEffectCommons.IsExistOnBattleAreaActivate(cardSource, activateClass1)
  107. && !cardSource.CanNotBeAffected(activateClass);
  108. }
  109. bool CanSelectPermanentCondition(Permanent permanent)
  110. {
  111. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, cardSource);
  112. }
  113. IEnumerator ActivateCoroutine1(Hashtable hashtable)
  114. {
  115. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  116. selectPermanentEffect.SetUp(
  117. selectPlayer: cardSource.Owner,
  118. canTargetCondition: CanSelectPermanentCondition,
  119. canTargetCondition_ByPreSelecetedList: null,
  120. canEndSelectCondition: null,
  121. maxCount: 1,
  122. canNoSelect: false,
  123. canEndNotMax: false,
  124. selectPermanentCoroutine: null,
  125. afterSelectPermanentCoroutine: null,
  126. mode: SelectPermanentEffect.Mode.Destroy,
  127. cardEffect: activateClass1);
  128. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  129. }
  130. }
  131. if (_timing == EffectTiming.None)
  132. {
  133. cardEffects.Add(PermanentEffectFactory.AddDetailClass(cardSource.PermanentOfThisCard(), "[End of Your Turn] Delete 1 of your Digimon.", true, activateClass));
  134. }
  135. return cardEffects;
  136. }
  137. foreach (Permanent permanent in card.Owner.Enemy.GetBattleAreaDigimons())
  138. {
  139. if (!permanent.TopCard.CanNotBeAffected(activateClass))
  140. {
  141. yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(permanent));
  142. }
  143. }
  144. }
  145. }
  146. #endregion
  147. #region Security
  148. if (timing == EffectTiming.SecuritySkill)
  149. {
  150. ActivateClass activateClass = new ActivateClass();
  151. activateClass.SetUpICardEffect("Delete 1 Opponents unsuspended Digimon", CanUseCondition, card);
  152. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  153. activateClass.SetIsSecurityEffect(true);
  154. cardEffects.Add(activateClass);
  155. string EffectDescription()
  156. {
  157. return "[Main] Delete 1 of your opponent's unsuspended Digimon.";
  158. }
  159. bool CanSelectPermanentCondition(Permanent permanent)
  160. {
  161. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
  162. && !permanent.IsSuspended;
  163. }
  164. bool CanUseCondition(Hashtable hashtable)
  165. {
  166. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  167. }
  168. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  169. {
  170. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  171. {
  172. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  173. selectPermanentEffect.SetUp(
  174. selectPlayer: card.Owner,
  175. canTargetCondition: CanSelectPermanentCondition,
  176. canTargetCondition_ByPreSelecetedList: null,
  177. canEndSelectCondition: null,
  178. maxCount: 1,
  179. canNoSelect: false,
  180. canEndNotMax: false,
  181. selectPermanentCoroutine: null,
  182. afterSelectPermanentCoroutine: null,
  183. mode: SelectPermanentEffect.Mode.Destroy,
  184. cardEffect: activateClass);
  185. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  186. }
  187. }
  188. }
  189. #endregion
  190. return cardEffects;
  191. }
  192. }
  193. }