BT17_043.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT17
  5. {
  6. public class BT17_043 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Your Turn
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Suspend 1 of your opponent's Digimon", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  17. activateClass.SetHashString("Suspend1_BT17_043");
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn] [Once Per Turn] When an effect plays one of your [Terriermon], [Lopmon] or green Tamers, suspend 1 of your opponent's Digimon.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  26. {
  27. if (permanent.TopCard.CardNames.Contains("Terriermon") || permanent.TopCard.CardNames.Contains("Lopmon"))
  28. {
  29. return true;
  30. }
  31. }
  32. if(CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent,card))
  33. {
  34. if(permanent.IsTamer && permanent.TopCard.CardColors.Contains(CardColor.Green))
  35. {
  36. return true;
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanSelectPermanentCondition(Permanent permanent)
  42. {
  43. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  44. {
  45. return true;
  46. }
  47. return false;
  48. }
  49. bool CanUseCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  54. {
  55. if (CardEffectCommons.IsByEffect(hashtable, null))
  56. {
  57. return true;
  58. }
  59. }
  60. }
  61. return false;
  62. }
  63. bool CanActivateCondition(Hashtable hashtable)
  64. {
  65. if(CardEffectCommons.IsExistOnBattleArea(card))
  66. {
  67. return true;
  68. }
  69. return false;
  70. }
  71. IEnumerator ActivateCoroutine(Hashtable hashtable)
  72. {
  73. if(CardEffectCommons.IsExistOnBattleArea(card))
  74. {
  75. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  76. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  77. selectPermanentEffect.SetUp(
  78. selectPlayer: card.Owner,
  79. canTargetCondition: CanSelectPermanentCondition,
  80. canTargetCondition_ByPreSelecetedList: null,
  81. canEndSelectCondition: null,
  82. maxCount: maxCount,
  83. canNoSelect: false,
  84. canEndNotMax: false,
  85. selectPermanentCoroutine: null,
  86. afterSelectPermanentCoroutine: null,
  87. mode: SelectPermanentEffect.Mode.Tap,
  88. cardEffect: activateClass);
  89. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  90. }
  91. }
  92. }
  93. #endregion
  94. #region Inherit - All Turns
  95. if (timing == EffectTiming.None)
  96. {
  97. bool Condition()
  98. {
  99. if (CardEffectCommons.IsExistOnBattleArea(card))
  100. {
  101. if (card.PermanentOfThisCard().IsSuspended)
  102. {
  103. return true;
  104. }
  105. }
  106. return false;
  107. }
  108. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  109. }
  110. #endregion
  111. return cardEffects;
  112. }
  113. }
  114. }