P_100.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class P_100 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Opponent's 1 Digimon or Tamer can't unsuspend", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] 1 of your opponent's Digimon or Tamers cannot unsuspend until the end of your opponent's turn.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
  26. {
  27. if (permanent.IsDigimon || permanent.IsTamer)
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanUseCondition(Hashtable hashtable)
  35. {
  36. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. if (CardEffectCommons.IsExistOnBattleArea(card))
  41. {
  42. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  52. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  53. selectPermanentEffect.SetUp(
  54. selectPlayer: card.Owner,
  55. canTargetCondition: CanSelectPermanentCondition,
  56. canTargetCondition_ByPreSelecetedList: null,
  57. canEndSelectCondition: null,
  58. maxCount: maxCount,
  59. canNoSelect: false,
  60. canEndNotMax: false,
  61. selectPermanentCoroutine: SelectPermanentCoroutine,
  62. afterSelectPermanentCoroutine: null,
  63. mode: SelectPermanentEffect.Mode.Custom,
  64. cardEffect: activateClass);
  65. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to unsuspend.", "The opponent is selecting 1 Digimon or Tamer that will get unable to unsuspend.");
  66. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  67. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  68. {
  69. Permanent selectedPermanent = permanent;
  70. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  71. targetPermanent: selectedPermanent,
  72. activateClass: activateClass
  73. ));
  74. }
  75. }
  76. }
  77. if (timing == EffectTiming.OnEnterFieldAnyone)
  78. {
  79. ActivateClass activateClass = new ActivateClass();
  80. activateClass.SetUpICardEffect("Opponent's 1 Digimon or Tamer can't unsuspend", CanUseCondition, card);
  81. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  82. cardEffects.Add(activateClass);
  83. string EffectDiscription()
  84. {
  85. return "[When Digivolving] 1 of your opponent's Digimon or Tamers cannot unsuspend until the end of your opponent's turn.";
  86. }
  87. bool CanSelectPermanentCondition(Permanent permanent)
  88. {
  89. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
  90. {
  91. if (permanent.IsDigimon || permanent.IsTamer)
  92. {
  93. return true;
  94. }
  95. }
  96. return false;
  97. }
  98. bool CanUseCondition(Hashtable hashtable)
  99. {
  100. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  101. }
  102. bool CanActivateCondition(Hashtable hashtable)
  103. {
  104. if (CardEffectCommons.IsExistOnBattleArea(card))
  105. {
  106. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  107. {
  108. return true;
  109. }
  110. }
  111. return false;
  112. }
  113. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  114. {
  115. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  116. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  117. selectPermanentEffect.SetUp(
  118. selectPlayer: card.Owner,
  119. canTargetCondition: CanSelectPermanentCondition,
  120. canTargetCondition_ByPreSelecetedList: null,
  121. canEndSelectCondition: null,
  122. maxCount: maxCount,
  123. canNoSelect: false,
  124. canEndNotMax: false,
  125. selectPermanentCoroutine: SelectPermanentCoroutine,
  126. afterSelectPermanentCoroutine: null,
  127. mode: SelectPermanentEffect.Mode.Custom,
  128. cardEffect: activateClass);
  129. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon or Tamer that will get unable to unsuspend.", "The opponent is selecting 1 Digimon or Tamer that will get unable to unsuspend.");
  130. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  131. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  132. {
  133. Permanent selectedPermanent = permanent;
  134. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCantUnsuspendUntilOpponentTurnEnd(
  135. targetPermanent: selectedPermanent,
  136. activateClass: activateClass
  137. ));
  138. }
  139. }
  140. }
  141. if (timing == EffectTiming.None)
  142. {
  143. bool Condition()
  144. {
  145. if (CardEffectCommons.IsExistOnBattleArea(card))
  146. {
  147. if (CardEffectCommons.IsOwnerTurn(card))
  148. {
  149. return true;
  150. }
  151. }
  152. return false;
  153. }
  154. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  155. }
  156. return cardEffects;
  157. }
  158. }