BT24_044.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Muchomon
  4. namespace DCGO.CardEffects.BT24
  5. {
  6. public class BT24_044 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region On Play
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Suspend 1 Digimon, then maybe search top 3.", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return "[On Play] You may suspend 1 level 6 or lower Digimon. If this effect suspended your Digimon, reveal the top 3 cards of your deck. Add 1 [Shoto Kazama] and 1 card with [Avian] or [Bird] in any of its traits or the [Vortex Warriors] trait among them to the hand. Return the rest to the bottom of the deck.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOnPlay(hashtable, card)
  25. && CardEffectCommons.IsExistOnBattleArea(card);
  26. }
  27. bool CanActivateCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.IsExistOnBattleArea(card);
  30. }
  31. bool CanSelectPermanentCondition(Permanent permanent)
  32. {
  33. return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent)
  34. && permanent.TopCard.HasLevel
  35. && permanent.TopCard.Level <= 6;
  36. }
  37. bool CanSelectCardCondition(CardSource cardSource)
  38. {
  39. return cardSource.ContainsCardName("Shoto Kazama");
  40. }
  41. bool CanSelectCardCondition1(CardSource cardSource)
  42. {
  43. return cardSource.HasBirdTraits
  44. || cardSource.EqualsTraits("Vortex Warriors");
  45. }
  46. IEnumerator ActivateCoroutine(Hashtable hashtable)
  47. {
  48. Permanent selectedPermanent = null;
  49. bool ownDigimon = false;
  50. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  51. selectPermanentEffect.SetUp(
  52. selectPlayer: card.Owner,
  53. canTargetCondition: CanSelectPermanentCondition,
  54. canTargetCondition_ByPreSelecetedList: null,
  55. canEndSelectCondition: null,
  56. maxCount: 1,
  57. canNoSelect: true,
  58. canEndNotMax: false,
  59. selectPermanentCoroutine: SelectPermanentCoroutine,
  60. afterSelectPermanentCoroutine: null,
  61. mode: SelectPermanentEffect.Mode.Custom,
  62. cardEffect: activateClass);
  63. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  64. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  65. {
  66. selectedPermanent = permanent;
  67. yield return null;
  68. }
  69. if (selectedPermanent != null &&
  70. selectedPermanent.TopCard &&
  71. !selectedPermanent.TopCard.CanNotBeAffected(activateClass) &&
  72. !selectedPermanent.IsSuspended && selectedPermanent.CanSuspend)
  73. {
  74. yield return ContinuousController.instance.StartCoroutine(
  75. new SuspendPermanentsClass(new List<Permanent>() { selectedPermanent },
  76. CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  77. ownDigimon = selectedPermanent.IsSuspended &&
  78. CardEffectCommons.IsOwnerPermanent(selectedPermanent, card);
  79. }
  80. if (ownDigimon && card.Owner.LibraryCards.Count >= 1)
  81. {
  82. yield return ContinuousController.instance.StartCoroutine(
  83. CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  84. revealCount: 3,
  85. simplifiedSelectCardConditions:
  86. new SimplifiedSelectCardConditionClass[]
  87. {
  88. new(
  89. canTargetCondition: CanSelectCardCondition,
  90. message: "Select 1 [Shoto Kazama].",
  91. mode: SelectCardEffect.Mode.AddHand,
  92. maxCount: 1,
  93. selectCardCoroutine: null),
  94. new(
  95. canTargetCondition: CanSelectCardCondition1,
  96. message: "Select 1 card with [Avian] or [Bird] in any of its traits or the [Vortex Warriors] trait.",
  97. mode: SelectCardEffect.Mode.AddHand,
  98. maxCount: 1,
  99. selectCardCoroutine: null),
  100. },
  101. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  102. activateClass: activateClass
  103. ));
  104. }
  105. }
  106. }
  107. #endregion
  108. #region All Turns - ESS
  109. if (timing == EffectTiming.OnEndBattle)
  110. {
  111. ActivateClass activateClass = new ActivateClass();
  112. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  113. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  114. activateClass.SetIsInheritedEffect(true);
  115. activateClass.SetHashString("BT24_044_Inherited");
  116. cardEffects.Add(activateClass);
  117. string EffectDescription()
  118. {
  119. return "[All Turns] [Once Per Turn] When this Digimon deletes your opponent's Digimon in battle, gain 1 memory.";
  120. }
  121. bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
  122. bool LoserCondition(Permanent permanent) => CardEffectCommons.IsOpponentPermanent(permanent, card);
  123. bool CanUseCondition(Hashtable hashtable)
  124. {
  125. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  126. CardEffectCommons.CanTriggerWhenDeleteOpponentDigimonByBattle(hashtable: hashtable,
  127. winnerCondition: WinnerCondition, loserCondition: LoserCondition, isOnlyWinnerSurvive: false);
  128. }
  129. bool CanActivateCondition(Hashtable hashtable)
  130. {
  131. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  132. }
  133. IEnumerator ActivateCoroutine(Hashtable hashtable)
  134. {
  135. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  136. }
  137. }
  138. #endregion
  139. return cardEffects;
  140. }
  141. }
  142. }