BT24_025.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Shellmon
  5. namespace DCGO.CardEffects.BT24
  6. {
  7. public class BT24_025 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternative Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.HasLevel
  18. && targetPermanent.TopCard.IsLevel3
  19. && targetPermanent.TopCard.HasTSTraits;
  20. }
  21. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  22. permanentCondition: PermanentCondition,
  23. digivolutionCost: 2,
  24. ignoreDigivolutionRequirement: false,
  25. card: card,
  26. condition: null)
  27. );
  28. }
  29. #endregion
  30. #region Your Turn
  31. if (timing == EffectTiming.OnUnTappedAnyone)
  32. {
  33. ActivateClass activateClass = new ActivateClass();
  34. activateClass.SetUpICardEffect("Digivolve into [Venusmon] in the hand", CanUseCondition, card);
  35. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  36. cardEffects.Add(activateClass);
  37. string EffectDescription()
  38. {
  39. return "[Your Turn] When any of your other blue Digimon with the [TS] trait unsuspend, this Digimon may digivolve into [Venusmon] in the hand, ignoring level.";
  40. }
  41. bool PermanentCondition(Permanent permanent)
  42. {
  43. return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent)
  44. && permanent.TopCard.CardColors.Contains(CardColor.Blue)
  45. && permanent != card.PermanentOfThisCard()
  46. && permanent.TopCard.HasTSTraits;
  47. }
  48. bool CanSelectCardCondition(CardSource cardSource)
  49. {
  50. return cardSource.IsDigimon
  51. && cardSource.EqualsCardName("Venusmon");
  52. }
  53. bool CanUseCondition(Hashtable hashtable)
  54. {
  55. return CardEffectCommons.IsExistOnBattleArea(card)
  56. && CardEffectCommons.IsOwnerTurn(card)
  57. && CardEffectCommons.CanTriggerWhenPermanentUnsuspends(hashtable, PermanentCondition);
  58. }
  59. bool CanActivateCondition(Hashtable hashtable)
  60. {
  61. return CardEffectCommons.IsExistOnBattleArea(card)
  62. && CardEffectCommons.HasMatchConditionPermanent(PermanentCondition);
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  67. targetPermanent: card.PermanentOfThisCard(),
  68. cardCondition: CanSelectCardCondition,
  69. payCost: true,
  70. reduceCostTuple: null,
  71. fixedCostTuple: null,
  72. ignoreDigivolutionRequirementFixedCost: -1,
  73. isHand: true,
  74. activateClass: activateClass,
  75. successProcess: null,
  76. ignoreRequirements: CardEffectCommons.IgnoreRequirement.Level));
  77. }
  78. }
  79. #endregion
  80. #region End of Your Turn - OPT
  81. if (timing == EffectTiming.OnEndTurn)
  82. {
  83. ActivateClass activateClass = new ActivateClass();
  84. activateClass.SetUpICardEffect("Unsuspend 1 other TS Digimon", CanUseCondition, card);
  85. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
  86. activateClass.SetHashString("BT24_025_EOYT");
  87. cardEffects.Add(activateClass);
  88. string EffectDescription()
  89. {
  90. return "[End of Your Turn] [Once Per Turn] 1 of your other Digimon with the [TS] trait may unsuspend.";
  91. }
  92. bool CanUseCondition(Hashtable hashtable)
  93. {
  94. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  95. && CardEffectCommons.IsOwnerTurn(card);
  96. }
  97. bool CanActivateCondition(Hashtable hashtable)
  98. {
  99. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  100. && CardEffectCommons.HasMatchConditionPermanent(CanSelectPermamentCondition);
  101. }
  102. bool CanSelectPermamentCondition(Permanent permanent)
  103. {
  104. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  105. && permanent.TopCard.HasTSTraits
  106. && permanent != card.PermanentOfThisCard();
  107. }
  108. IEnumerator ActivateCoroutine(Hashtable hashtable)
  109. {
  110. List<Permanent> selectedPermanents = new List<Permanent>();
  111. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermamentCondition))
  112. {
  113. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermamentCondition));
  114. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  115. selectPermanentEffect.SetUp(
  116. selectPlayer: card.Owner,
  117. canTargetCondition: CanSelectPermamentCondition,
  118. canTargetCondition_ByPreSelecetedList: null,
  119. canEndSelectCondition: null,
  120. maxCount: maxCount,
  121. canNoSelect: true,
  122. canEndNotMax: false,
  123. selectPermanentCoroutine: null,
  124. afterSelectPermanentCoroutine: null,
  125. mode: SelectPermanentEffect.Mode.UnTap,
  126. cardEffect: activateClass);
  127. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  128. }
  129. }
  130. }
  131. #endregion
  132. #region ESS
  133. if (timing == EffectTiming.None)
  134. {
  135. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  136. }
  137. #endregion
  138. return cardEffects;
  139. }
  140. }
  141. }