EX8_040.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX8
  4. {
  5. public class EX8_040 : 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.IsLevel3 && targetPermanent.TopCard.EqualsTraits("NSp");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 2,
  20. ignoreDigivolutionRequirement: false,
  21. card: card,
  22. condition: null)
  23. );
  24. }
  25. #endregion
  26. #region On Play/When Digivolving Shared
  27. bool CanSelectPermanentConditionShared(Permanent permanent)
  28. {
  29. return CardEffectCommons.IsPermanentExistsOnBattleArea(permanent) &&
  30. permanent.IsDigimon;
  31. }
  32. bool CanActivateConditionShared(Hashtable hashtable)
  33. {
  34. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  35. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
  36. }
  37. #endregion
  38. #region On Play
  39. if (timing == EffectTiming.OnEnterFieldAnyone)
  40. {
  41. ActivateClass activateClass = new ActivateClass();
  42. activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
  43. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, true, EffectDescription());
  44. cardEffects.Add(activateClass);
  45. string EffectDescription()
  46. {
  47. return
  48. "[On Play] You may suspend 1 Digimon.";
  49. }
  50. bool CanUseCondition(Hashtable hashtable)
  51. {
  52. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable hashtable)
  55. {
  56. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  57. selectPermanentEffect.SetUp(
  58. selectPlayer: card.Owner,
  59. canTargetCondition: CanSelectPermanentConditionShared,
  60. canTargetCondition_ByPreSelecetedList: null,
  61. canEndSelectCondition: null,
  62. maxCount: 1,
  63. canNoSelect: true,
  64. canEndNotMax: false,
  65. selectPermanentCoroutine: null,
  66. afterSelectPermanentCoroutine: null,
  67. mode: SelectPermanentEffect.Mode.Tap,
  68. cardEffect: activateClass);
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. }
  71. }
  72. #endregion
  73. #region When Digivolving
  74. if (timing == EffectTiming.OnEnterFieldAnyone)
  75. {
  76. ActivateClass activateClass = new ActivateClass();
  77. activateClass.SetUpICardEffect("Suspend 1 Digimon", CanUseCondition, card);
  78. activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, true, EffectDescription());
  79. cardEffects.Add(activateClass);
  80. string EffectDescription()
  81. {
  82. return
  83. "[When Digivolving] You may suspend 1 Digimon.";
  84. }
  85. bool CanUseCondition(Hashtable hashtable)
  86. {
  87. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  88. }
  89. IEnumerator ActivateCoroutine(Hashtable hashtable)
  90. {
  91. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  92. selectPermanentEffect.SetUp(
  93. selectPlayer: card.Owner,
  94. canTargetCondition: CanSelectPermanentConditionShared,
  95. canTargetCondition_ByPreSelecetedList: null,
  96. canEndSelectCondition: null,
  97. maxCount: 1,
  98. canNoSelect: true,
  99. canEndNotMax: false,
  100. selectPermanentCoroutine: null,
  101. afterSelectPermanentCoroutine: null,
  102. mode: SelectPermanentEffect.Mode.Tap,
  103. cardEffect: activateClass);
  104. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  105. }
  106. }
  107. #endregion
  108. #region Your Turn - ESS
  109. if (timing == EffectTiming.None)
  110. {
  111. bool Condition()
  112. {
  113. return CardEffectCommons.IsOwnerTurn(card);
  114. }
  115. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  116. changeValue: 2000,
  117. isInheritedEffect: true,
  118. card: card,
  119. condition: Condition));
  120. }
  121. #endregion
  122. return cardEffects;
  123. }
  124. }
  125. }