ST18_06.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST18
  4. {
  5. public class ST18_06 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region On Play/ On Deletion Shared
  11. bool CanSelectPermanentSharedCondition(Permanent permanent)
  12. {
  13. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  14. permanent.CanSuspend;
  15. }
  16. #endregion
  17. #region On Play
  18. if (timing == EffectTiming.OnEnterFieldAnyone)
  19. {
  20. ActivateClass activateClass = new ActivateClass();
  21. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  22. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  23. cardEffects.Add(activateClass);
  24. string EffectDescription()
  25. {
  26. return
  27. "[On Play] Suspend 1 of your opponent's Digimon.";
  28. }
  29. bool CanUseCondition(Hashtable hashtable)
  30. {
  31. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  36. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentSharedCondition);
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable hashtable)
  39. {
  40. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  41. selectPermanentEffect.SetUp(
  42. selectPlayer: card.Owner,
  43. canTargetCondition: CanSelectPermanentSharedCondition,
  44. canTargetCondition_ByPreSelecetedList: null,
  45. canEndSelectCondition: null,
  46. maxCount: 1,
  47. canNoSelect: false,
  48. canEndNotMax: false,
  49. selectPermanentCoroutine: null,
  50. afterSelectPermanentCoroutine: null,
  51. mode: SelectPermanentEffect.Mode.Tap,
  52. cardEffect: activateClass);
  53. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  54. }
  55. }
  56. #endregion
  57. #region On Deletion
  58. if (timing == EffectTiming.OnDestroyedAnyone)
  59. {
  60. ActivateClass activateClass = new ActivateClass();
  61. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  62. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  63. cardEffects.Add(activateClass);
  64. string EffectDescription()
  65. {
  66. return
  67. "[On Deletion] Suspend 1 of your opponent's Digimon.";
  68. }
  69. bool CanUseCondition(Hashtable hashtable)
  70. {
  71. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  72. }
  73. bool CanActivateCondition(Hashtable hashtable)
  74. {
  75. return CardEffectCommons.CanActivateOnDeletion(card, activateClass) &&
  76. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentSharedCondition);
  77. }
  78. IEnumerator ActivateCoroutine(Hashtable hashtable)
  79. {
  80. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  81. selectPermanentEffect.SetUp(
  82. selectPlayer: card.Owner,
  83. canTargetCondition: CanSelectPermanentSharedCondition,
  84. canTargetCondition_ByPreSelecetedList: null,
  85. canEndSelectCondition: null,
  86. maxCount: 1,
  87. canNoSelect: false,
  88. canEndNotMax: false,
  89. selectPermanentCoroutine: null,
  90. afterSelectPermanentCoroutine: null,
  91. mode: SelectPermanentEffect.Mode.Tap,
  92. cardEffect: activateClass);
  93. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  94. }
  95. }
  96. #endregion
  97. return cardEffects;
  98. }
  99. }
  100. }