BT12_106.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Gypt Particle Cannon
  4. namespace DCGO.CardEffects.BT12
  5. {
  6. public class BT12_106 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Ignore Color Requirement
  12. if (timing == EffectTiming.None)
  13. {
  14. IgnoreColorConditionClass ignoreColorConditionClass = new IgnoreColorConditionClass();
  15. ignoreColorConditionClass.SetUpICardEffect("Ignore color requirements", CanUseCondition, card);
  16. ignoreColorConditionClass.SetUpIgnoreColorConditionClass(cardCondition: CardCondition);
  17. cardEffects.Add(ignoreColorConditionClass);
  18. bool CanUseCondition(Hashtable hashtable)
  19. {
  20. return CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent)
  21. => permanent.IsTamer
  22. && permanent.TopCard.CardTraits.Contains("Hunter"));
  23. }
  24. bool CardCondition(CardSource cardSource)
  25. {
  26. return cardSource == card;
  27. }
  28. }
  29. #endregion
  30. #region Main
  31. if (timing == EffectTiming.OptionSkill)
  32. {
  33. ActivateClass activateClass = new ActivateClass();
  34. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  35. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  36. cardEffects.Add(activateClass);
  37. string EffectDescription()
  38. {
  39. return "[Main] Suspend all of your opponent's Digimon and Tamers. Your opponent's cards don't unsuspend during their next unsuspend phase.";
  40. }
  41. bool CanSelectPermanentCondition(Permanent permanent)
  42. {
  43. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
  44. && (permanent.IsDigimon
  45. || permanent.IsTamer)
  46. && !permanent.TopCard.CanNotBeAffected(activateClass);
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  51. }
  52. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  53. {
  54. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  55. {
  56. List<Permanent> suspendTargetPermanents = card.Owner.Enemy.GetBattleAreaPermanents().Filter(CanSelectPermanentCondition);
  57. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(suspendTargetPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  58. }
  59. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainCanNotUnsuspendPlayerEffect(
  60. permanentCondition: CanSelectPermanentCondition,
  61. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  62. activateClass: activateClass,
  63. isOnlyActivePhase: true,
  64. effectName: "Your card can't unsuspend"));
  65. }
  66. }
  67. #endregion
  68. #region Security Effect
  69. if (timing == EffectTiming.SecuritySkill)
  70. {
  71. ActivateClass activateClass = new ActivateClass();
  72. activateClass.SetUpICardEffect($"Suspend opponent's all Digimon and Tamers", CanUseCondition, card);
  73. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  74. activateClass.SetIsSecurityEffect(true);
  75. cardEffects.Add(activateClass);
  76. string EffectDescription()
  77. {
  78. return "[Security] Suspend all of your opponent's Digimon and Tamers.";
  79. }
  80. bool CanSelectPermanentCondition(Permanent permanent)
  81. {
  82. return CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card)
  83. && (permanent.IsDigimon
  84. || permanent.IsTamer)
  85. && !permanent.TopCard.CanNotBeAffected(activateClass);
  86. }
  87. bool CanUseCondition(Hashtable hashtable)
  88. {
  89. return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
  90. }
  91. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  92. {
  93. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  94. {
  95. List<Permanent> suspendTargetPermanents = card.Owner.Enemy.GetBattleAreaPermanents().Filter(CanSelectPermanentCondition);
  96. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(suspendTargetPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  97. }
  98. }
  99. }
  100. #endregion
  101. return cardEffects;
  102. }
  103. }
  104. }