LM_010.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.LM
  5. {
  6. public class LM_010 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region On Play
  12. if(timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Tamers can't unsuspend", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[On Play] Suspend 1 Tamer. None of your opponent's Tamers can unsuspend until the end of their turn.";
  21. }
  22. bool CanSelectPermanentCondition(Permanent permanent)
  23. {
  24. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  25. {
  26. return permanent.IsTamer;
  27. }
  28. return false;
  29. }
  30. bool CanUseCondition(Hashtable hashtable)
  31. {
  32. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  33. }
  34. bool CanActivateCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.IsExistOnBattleArea(card);
  37. }
  38. IEnumerator ActivateCoroutine(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  41. {
  42. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  43. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  44. selectPermanentEffect.SetUp(
  45. selectPlayer: card.Owner,
  46. canTargetCondition: CanSelectPermanentCondition,
  47. canTargetCondition_ByPreSelecetedList: null,
  48. canEndSelectCondition: null,
  49. maxCount: maxCount,
  50. canNoSelect: false,
  51. canEndNotMax: false,
  52. selectPermanentCoroutine: null,
  53. afterSelectPermanentCoroutine: null,
  54. mode: SelectPermanentEffect.Mode.Tap,
  55. cardEffect: activateClass);
  56. selectPermanentEffect.SetUpCustomMessage("Select 1 Tamer to suspend.", "The opponent is selecting 1 Tamer to suspend.");
  57. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  58. foreach(Permanent permanent in card.Owner.Enemy.GetBattleAreaPermanents())
  59. {
  60. if(permanent.IsTamer)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  63. targetPermanent: permanent,
  64. activateClass: activateClass
  65. ));
  66. }
  67. }
  68. }
  69. }
  70. }
  71. #endregion
  72. #region All Turns - DP Increase
  73. if (timing == EffectTiming.None)
  74. {
  75. bool Condition()
  76. {
  77. if (CardEffectCommons.IsExistOnBattleArea(card))
  78. {
  79. return true;
  80. }
  81. return false;
  82. }
  83. bool CanSelectPermanentCondition(Permanent permanent)
  84. {
  85. if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
  86. {
  87. if (permanent.IsTamer)
  88. {
  89. if (permanent.IsSuspended)
  90. {
  91. return true;
  92. }
  93. }
  94. }
  95. return false;
  96. }
  97. int DPIncrease()
  98. {
  99. return CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition) * 1000;
  100. }
  101. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: DPIncrease(), isInheritedEffect: false, card: card, condition: Condition));
  102. }
  103. #endregion
  104. return cardEffects;
  105. }
  106. }
  107. }