P_163.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.P
  4. {
  5. public class P_163 : 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("NSo");
  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
  27. if (timing == EffectTiming.OnEnterFieldAnyone)
  28. {
  29. ActivateClass activateClass = new ActivateClass();
  30. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  31. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  32. cardEffects.Add(activateClass);
  33. string EffectDescription()
  34. {
  35. return "[On Play] Suspend 1 of your opponent's Digimon.";
  36. }
  37. bool SelectOpponentDigimon(Permanent permanent)
  38. {
  39. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  40. }
  41. bool CanUseCondition(Hashtable hashtable)
  42. {
  43. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  44. }
  45. bool CanActivateCondition(Hashtable hashtable)
  46. {
  47. if (CardEffectCommons.IsExistOnBattleArea(card))
  48. {
  49. return CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SelectOpponentDigimon);
  50. }
  51. return false;
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable hashtable)
  54. {
  55. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  56. selectPermanentEffect.SetUp(
  57. selectPlayer: card.Owner,
  58. canTargetCondition: SelectOpponentDigimon,
  59. canTargetCondition_ByPreSelecetedList: null,
  60. canEndSelectCondition: null,
  61. maxCount: 1,
  62. canNoSelect: false,
  63. canEndNotMax: false,
  64. selectPermanentCoroutine: null,
  65. afterSelectPermanentCoroutine: null,
  66. mode: SelectPermanentEffect.Mode.Tap,
  67. cardEffect: activateClass);
  68. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  69. }
  70. }
  71. #endregion
  72. #region On Deletion
  73. if (timing == EffectTiming.OnDestroyedAnyone)
  74. {
  75. ActivateClass activateClass = new ActivateClass();
  76. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  77. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  78. cardEffects.Add(activateClass);
  79. string EffectDescription()
  80. {
  81. return "[On Deletion] Suspend 1 of your opponent's Digimon.";
  82. }
  83. bool SelectOpponentDigimon(Permanent permanent)
  84. {
  85. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  86. }
  87. bool CanUseCondition(Hashtable hashtable)
  88. {
  89. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  90. }
  91. bool CanActivateCondition(Hashtable hashtable)
  92. {
  93. return CardEffectCommons.CanActivateOnDeletion(card, activateClass);
  94. }
  95. IEnumerator ActivateCoroutine(Hashtable hashtable)
  96. {
  97. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  98. selectPermanentEffect.SetUp(
  99. selectPlayer: card.Owner,
  100. canTargetCondition: SelectOpponentDigimon,
  101. canTargetCondition_ByPreSelecetedList: null,
  102. canEndSelectCondition: null,
  103. maxCount: 1,
  104. canNoSelect: false,
  105. canEndNotMax: false,
  106. selectPermanentCoroutine: null,
  107. afterSelectPermanentCoroutine: null,
  108. mode: SelectPermanentEffect.Mode.Tap,
  109. cardEffect: activateClass);
  110. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  111. }
  112. }
  113. #endregion
  114. return cardEffects;
  115. }
  116. }
  117. }