BT1_113.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 BT1_113 : 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.OptionSkill)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  17. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Main] Until the end of your opponent's next turn, of your opponent's Digimon can't attack or block.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  30. }
  31. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  32. {
  33. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  34. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  35. selectPermanentEffect.SetUp(
  36. selectPlayer: card.Owner,
  37. canTargetCondition: CanSelectPermanentCondition,
  38. canTargetCondition_ByPreSelecetedList: null,
  39. canEndSelectCondition: null,
  40. maxCount: maxCount,
  41. canNoSelect: false,
  42. canEndNotMax: false,
  43. selectPermanentCoroutine: SelectPermanentCoroutine,
  44. afterSelectPermanentCoroutine: null,
  45. mode: SelectPermanentEffect.Mode.Custom,
  46. cardEffect: activateClass);
  47. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get effects.", "The opponent is selecting 1 Digimon that will get effects.");
  48. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  49. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  50. {
  51. Permanent selectedPermanent = permanent;
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotAttack(targetPermanent: selectedPermanent, defenderCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Attack"));
  53. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotBlock(targetPermanent: selectedPermanent, attackerCondition: null, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass, effectName: "Can't Block"));
  54. }
  55. }
  56. }
  57. if (timing == EffectTiming.SecuritySkill)
  58. {
  59. ActivateClass activateClass = new ActivateClass();
  60. activateClass.SetUpICardEffect($"Can't Unsuspend", CanUseCondition, card);
  61. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  62. activateClass.SetIsSecurityEffect(true);
  63. cardEffects.Add(activateClass);
  64. string EffectDiscription()
  65. {
  66. return "[Security] Your opponent's Digimon don't unsuspend during their next unsuspend phase.";
  67. }
  68. bool CanUseCondition(Hashtable hashtable)
  69. {
  70. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  71. }
  72. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  73. {
  74. bool PermanentCondition(Permanent permanent)
  75. {
  76. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  77. {
  78. if (!permanent.TopCard.CanNotBeAffected(activateClass))
  79. {
  80. return true;
  81. }
  82. }
  83. return false;
  84. }
  85. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
  86. permanentCondition: PermanentCondition,
  87. effectDuration: EffectDuration.UntilOwnerActivePhase,
  88. activateClass: activateClass,
  89. isOnlyActivePhase: true,
  90. effectName: "Your Digimon can't unsuspend"));
  91. }
  92. }
  93. return cardEffects;
  94. }
  95. }