BT21_038.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT21
  4. {
  5. public class BT21_038 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.IsLevel4 && targetPermanent.TopCard.EqualsTraits("WG");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 3,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null));
  23. }
  24. #endregion
  25. #region Evade
  26. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  27. {
  28. cardEffects.Add(CardEffectFactory.EvadeSelfEffect(
  29. isInheritedEffect: false,
  30. card: card,
  31. condition: null));
  32. }
  33. #endregion
  34. #region On Play/ When Digivolving Shared
  35. bool CanSelectDigimonPermanentConditionShared(Permanent permanent)
  36. {
  37. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  38. permanent.TopCard.HasWGTraits;
  39. }
  40. bool CanActivateConditionShared(Hashtable hashtable)
  41. {
  42. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  43. }
  44. #endregion
  45. #region On Play
  46. if (timing == EffectTiming.OnEnterFieldAnyone)
  47. {
  48. ActivateClass activateClass = new ActivateClass();
  49. activateClass.SetUpICardEffect("Select 1 of your [WG] trait Digimon to unsuspend", CanUseCondition, card);
  50. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, true, EffectDescription());
  51. cardEffects.Add(activateClass);
  52. string EffectDescription()
  53. {
  54. return
  55. "[On Play] 1 of your Digimon with the [WG] trait may unsuspend.";
  56. }
  57. bool CanUseCondition(Hashtable hashtable)
  58. {
  59. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  60. }
  61. IEnumerator ActivateCoroutine(Hashtable hashtable)
  62. {
  63. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  64. selectPermanentEffect.SetUp(
  65. selectPlayer: card.Owner,
  66. canTargetCondition: CanSelectDigimonPermanentConditionShared,
  67. canTargetCondition_ByPreSelecetedList: null,
  68. canEndSelectCondition: null,
  69. maxCount: 1,
  70. canNoSelect: true,
  71. canEndNotMax: false,
  72. selectPermanentCoroutine: null,
  73. afterSelectPermanentCoroutine: null,
  74. mode: SelectPermanentEffect.Mode.UnTap,
  75. cardEffect: activateClass);
  76. selectPermanentEffect.SetUpCustomMessage(
  77. "Select 1 Digimon that will unsuspend.",
  78. "The opponent is selecting 1 Digimon that will unsuspend.");
  79. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  80. }
  81. }
  82. #endregion
  83. #region When Digivolving
  84. if (timing == EffectTiming.OnEnterFieldAnyone)
  85. {
  86. ActivateClass activateClass = new ActivateClass();
  87. activateClass.SetUpICardEffect("Select 1 of your [WG] trait Digimon to unsuspend", CanUseCondition, card);
  88. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, true, EffectDescription());
  89. cardEffects.Add(activateClass);
  90. string EffectDescription()
  91. {
  92. return
  93. "[When Digivolving] 1 of your Digimon with the [WG] trait may unsuspend.";
  94. }
  95. bool CanUseCondition(Hashtable hashtable)
  96. {
  97. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  98. }
  99. IEnumerator ActivateCoroutine(Hashtable hashtable)
  100. {
  101. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  102. selectPermanentEffect.SetUp(
  103. selectPlayer: card.Owner,
  104. canTargetCondition: CanSelectDigimonPermanentConditionShared,
  105. canTargetCondition_ByPreSelecetedList: null,
  106. canEndSelectCondition: null,
  107. maxCount: 1,
  108. canNoSelect: true,
  109. canEndNotMax: false,
  110. selectPermanentCoroutine: null,
  111. afterSelectPermanentCoroutine: null,
  112. mode: SelectPermanentEffect.Mode.UnTap,
  113. cardEffect: activateClass);
  114. selectPermanentEffect.SetUpCustomMessage(
  115. "Select 1 Digimon that will unsuspend.",
  116. "The opponent is selecting 1 Digimon that will unsuspend.");
  117. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  118. }
  119. }
  120. #endregion
  121. #region Your Turn - ESS
  122. if (timing == EffectTiming.None)
  123. {
  124. CanNotSwitchAttackTargetClass canNotSwitchAttackTargetClass = new CanNotSwitchAttackTargetClass();
  125. canNotSwitchAttackTargetClass.SetUpICardEffect("This Digimon's attack target can't be switched.", CanUseCondition, card);
  126. canNotSwitchAttackTargetClass.SetUpCanNotSwitchAttackTargetClass(PermanentCondition: PermanentCondition);
  127. canNotSwitchAttackTargetClass.SetIsInheritedEffect(true);
  128. cardEffects.Add(canNotSwitchAttackTargetClass);
  129. bool CanUseCondition(Hashtable hashtable)
  130. {
  131. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  132. CardEffectCommons.IsOwnerTurn(card);
  133. }
  134. bool PermanentCondition(Permanent permanent)
  135. {
  136. return permanent != null && permanent.TopCard && permanent == card.PermanentOfThisCard();
  137. }
  138. }
  139. #endregion
  140. return cardEffects;
  141. }
  142. }
  143. }