HimiTomoki_BT7_086.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 HimiTomoki_BT7_086 : 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.SecuritySkill)
  14. {
  15. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  16. }
  17. if (timing == EffectTiming.OnEnterFieldAnyone)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Trash digivolution cards", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  22. cardEffects.Add(activateClass);
  23. string EffectDiscription()
  24. {
  25. return "[On Play] Trash 3 digivolution cards at the bottom of 1 of your opponent's Digimon.";
  26. }
  27. bool CanSelectPermanentCondition(Permanent permanent)
  28. {
  29. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  30. {
  31. return true;
  32. }
  33. return false;
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  38. }
  39. bool CanActivateCondition(Hashtable hashtable)
  40. {
  41. if (isExistOnField(card))
  42. {
  43. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  44. {
  45. return true;
  46. }
  47. }
  48. return false;
  49. }
  50. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  51. {
  52. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  53. {
  54. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  55. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  56. selectPermanentEffect.SetUp(
  57. selectPlayer: card.Owner,
  58. canTargetCondition: CanSelectPermanentCondition,
  59. canTargetCondition_ByPreSelecetedList: null,
  60. canEndSelectCondition: null,
  61. maxCount: maxCount,
  62. canNoSelect: false,
  63. canEndNotMax: false,
  64. selectPermanentCoroutine: SelectPermanentCoroutine,
  65. afterSelectPermanentCoroutine: null,
  66. mode: SelectPermanentEffect.Mode.Custom,
  67. cardEffect: activateClass);
  68. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will trash digivolution cards.", "The opponent is selecting 1 Digimon that will trash digivolution cards.");
  69. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  70. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  71. {
  72. Permanent selectedPermanent = permanent;
  73. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.TrashDigivolutionCardsFromTopOrBottom(targetPermanent: selectedPermanent, trashCount: 3, isFromTop: false, activateClass: activateClass));
  74. }
  75. }
  76. }
  77. }
  78. if (timing == EffectTiming.OnAllyAttack)
  79. {
  80. ActivateClass activateClass = new ActivateClass();
  81. activateClass.SetUpICardEffect("Opponent's 1 Digimon with no digivolution cards can't attack", CanUseCondition, card);
  82. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  83. activateClass.SetIsInheritedEffect(true);
  84. activateClass.SetHashString("Freeze_BT7_086");
  85. cardEffects.Add(activateClass);
  86. string EffectDiscription()
  87. {
  88. return "[When Attacking][Once Per Turn] Until the end of your opponent's next turn, 1 of your opponent's Digimon with no digivolution cards can't attack or block.";
  89. }
  90. bool CanSelectPermanentCondition(Permanent permanent)
  91. {
  92. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  93. {
  94. if (permanent.HasNoDigivolutionCards)
  95. {
  96. return true;
  97. }
  98. }
  99. return false;
  100. }
  101. bool CanUseCondition(Hashtable hashtable)
  102. {
  103. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  104. }
  105. bool CanActivateCondition(Hashtable hashtable)
  106. {
  107. if (CardEffectCommons.IsExistOnBattleArea(card))
  108. {
  109. return true;
  110. }
  111. return false;
  112. }
  113. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  114. {
  115. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  116. {
  117. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  118. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  119. selectPermanentEffect.SetUp(
  120. selectPlayer: card.Owner,
  121. canTargetCondition: CanSelectPermanentCondition,
  122. canTargetCondition_ByPreSelecetedList: null,
  123. canEndSelectCondition: null,
  124. maxCount: maxCount,
  125. canNoSelect: false,
  126. canEndNotMax: false,
  127. selectPermanentCoroutine: SelectPermanentCoroutine,
  128. afterSelectPermanentCoroutine: null,
  129. mode: SelectPermanentEffect.Mode.Custom,
  130. cardEffect: activateClass);
  131. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  132. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  133. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  134. {
  135. Permanent selectedPermanent = permanent;
  136. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(targetPermanent: selectedPermanent, defenderCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack"));
  137. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(targetPermanent: selectedPermanent, attackerCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Block"));
  138. }
  139. }
  140. }
  141. }
  142. return cardEffects;
  143. }
  144. }