P_131.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.P
  4. {
  5. public class P_131 : 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
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Play] Suspend 1 of your opponent's Digimon.";
  20. }
  21. bool SelectOpponentDigimon(Permanent permanent)
  22. {
  23. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  24. }
  25. bool CanUseCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  28. }
  29. bool CanActivateCondition(Hashtable hashtable)
  30. {
  31. if (CardEffectCommons.IsExistOnBattleArea(card))
  32. {
  33. return CardEffectCommons.HasMatchConditionOpponentsPermanent(card, SelectOpponentDigimon);
  34. }
  35. return false;
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable hashtable)
  38. {
  39. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  40. selectPermanentEffect.SetUp(
  41. selectPlayer: card.Owner,
  42. canTargetCondition: SelectOpponentDigimon,
  43. canTargetCondition_ByPreSelecetedList: null,
  44. canEndSelectCondition: null,
  45. maxCount: 1,
  46. canNoSelect: false,
  47. canEndNotMax: false,
  48. selectPermanentCoroutine: null,
  49. afterSelectPermanentCoroutine: null,
  50. mode: SelectPermanentEffect.Mode.Tap,
  51. cardEffect: activateClass);
  52. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  53. }
  54. }
  55. #endregion
  56. #region Your Turn - ESS
  57. if (timing == EffectTiming.None)
  58. {
  59. bool Condition()
  60. {
  61. if (CardEffectCommons.IsOwnerTurn(card))
  62. {
  63. return true;
  64. }
  65. return false;
  66. }
  67. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  68. changeValue: 2000,
  69. isInheritedEffect: true,
  70. card: card,
  71. condition: Condition));
  72. }
  73. #endregion
  74. return cardEffects;
  75. }
  76. }
  77. }