EX11_059.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. //Reina Oumi
  4. namespace DCGO.CardEffects.EX11
  5. {
  6. public class EX11_059 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Shared Card Condition
  12. bool IsNSo(CardSource cardSource)
  13. {
  14. return cardSource.EqualsTraits("NSo");
  15. }
  16. #endregion
  17. #region Shared SOYMP / OP
  18. string SharedEffectName = "Trash 1 [NSo] card from hand to Draw 1 and gain Memory +1";
  19. CardEffectFactory.ActivateClassesForSharedEffects
  20. (ref cardEffects, timing, card,
  21. SharedEffectName,
  22. SharedActivateCoroutine,
  23. SharedEffectDescription,
  24. additionalActivateCondition: AdditionalActivateCoroutine,
  25. optional: false,
  26. isSkippable: true,
  27. onPlay: true,
  28. startOfYourMainPhase: true);
  29. string SharedEffectDescription(string tag)=> $"[{tag}] By trashing 1 [NSo] trait card from your hand, <Draw 1> and gain 1 memory.";
  30. bool AdditionalActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  31. {
  32. return CardEffectCommons.HasMatchConditionOwnersHand(card, IsNSo);
  33. }
  34. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  35. {
  36. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  37. selectHandEffect.SetUp(
  38. selectPlayer: card.Owner,
  39. canTargetCondition: IsNSo,
  40. canTargetCondition_ByPreSelecetedList: null,
  41. canEndSelectCondition: null,
  42. maxCount: 1,
  43. canNoSelect: true,
  44. canEndNotMax: false,
  45. isShowOpponent: true,
  46. selectCardCoroutine: null,
  47. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  48. mode: SelectHandEffect.Mode.Discard,
  49. cardEffect: activateClass);
  50. yield return StartCoroutine(selectHandEffect.Activate());
  51. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  52. {
  53. if (cardSources.Count >= 1)
  54. {
  55. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  56. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  57. }
  58. }
  59. }
  60. #endregion
  61. #region All Turns
  62. if (timing == EffectTiming.OnDestroyedAnyone)
  63. {
  64. ActivateClass activateClass = new ActivateClass();
  65. activateClass.SetUpICardEffect("DNA into [NSo] Digimon", CanUseCondition, card);
  66. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  67. cardEffects.Add(activateClass);
  68. string EffectDescription()
  69. {
  70. return "[All Turns] When any of your [NSo] trait Digimon are deleted, by suspending this Tamer, 1 of your [NSo] trait Digimon and 1 [NSo] trait Digimon card in the trash may DNA digivolve into a Digimon card with the [NSo] trait in the hand.";
  71. }
  72. bool IsNSoPermanent(Permanent permanent)
  73. {
  74. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  75. && IsNSo(permanent.TopCard);
  76. }
  77. bool IsNSoDigimonCard(CardSource cardSource)
  78. {
  79. return cardSource.IsDigimon
  80. && IsNSo(cardSource);
  81. }
  82. bool CanUseCondition(Hashtable hashtable)
  83. {
  84. return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
  85. && CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, IsNSoPermanent, activateClass);
  86. }
  87. bool CanActivateCondition(Hashtable hashtable)
  88. {
  89. return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass)
  90. && CardEffectCommons.CanActivateSuspendCostEffect(card);
  91. }
  92. IEnumerator ActivateCoroutine(Hashtable hashtable)
  93. {
  94. yield return ContinuousController.instance.StartCoroutine(
  95. new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() },
  96. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  97. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DNADigivolveWithHandOrTrashCardIntoHandOrTrash(
  98. targetCardCondition: IsNSoDigimonCard,
  99. permanentCondition: IsNSoPermanent,
  100. digivolutionCardCondition: IsNSoDigimonCard,
  101. payCost: true,
  102. isWithHandCard: false,
  103. isIntoHandCard: true,
  104. activateClass: activateClass,
  105. successProcess: null,
  106. failedProcess: null,
  107. isOptional: true));
  108. }
  109. }
  110. #endregion
  111. #region Security
  112. if (timing == EffectTiming.SecuritySkill)
  113. {
  114. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  115. }
  116. #endregion
  117. return cardEffects;
  118. }
  119. }
  120. }