BT2_096.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 BT2_096 : 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] Return 1 of your opponent's level 5 or lower Digimon to their hand. (Trash all of the digivolution cards of that Digimon.) Then, if you have a blue Tamer in play, unsuspend 1 of your Digimon.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  26. {
  27. if (permanent.Level <= 5)
  28. {
  29. if (permanent.TopCard.HasLevel)
  30. {
  31. return true;
  32. }
  33. }
  34. }
  35. return false;
  36. }
  37. bool CanSelectPermanentCondition1(Permanent permanent)
  38. {
  39. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  40. }
  41. bool CanUseCondition(Hashtable hashtable)
  42. {
  43. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  44. }
  45. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  46. {
  47. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  48. {
  49. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  50. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  51. selectPermanentEffect.SetUp(
  52. selectPlayer: card.Owner,
  53. canTargetCondition: CanSelectPermanentCondition,
  54. canTargetCondition_ByPreSelecetedList: null,
  55. canEndSelectCondition: null,
  56. maxCount: maxCount,
  57. canNoSelect: false,
  58. canEndNotMax: false,
  59. selectPermanentCoroutine: null,
  60. afterSelectPermanentCoroutine: null,
  61. mode: SelectPermanentEffect.Mode.Bounce,
  62. cardEffect: activateClass);
  63. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  64. }
  65. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.TopCard.CardColors.Contains(CardColor.Blue) && permanent.IsTamer))
  66. {
  67. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition1))
  68. {
  69. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition1));
  70. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  71. selectPermanentEffect.SetUp(
  72. selectPlayer: card.Owner,
  73. canTargetCondition: CanSelectPermanentCondition1,
  74. canTargetCondition_ByPreSelecetedList: null,
  75. canEndSelectCondition: null,
  76. maxCount: maxCount,
  77. canNoSelect: false,
  78. canEndNotMax: false,
  79. selectPermanentCoroutine: null,
  80. afterSelectPermanentCoroutine: null,
  81. mode: SelectPermanentEffect.Mode.UnTap,
  82. cardEffect: activateClass);
  83. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  84. }
  85. }
  86. }
  87. }
  88. if (timing == EffectTiming.SecuritySkill)
  89. {
  90. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects, effectName: $"Return 1 Digimon to hand and Unsuspend 1 Digimon");
  91. }
  92. return cardEffects;
  93. }
  94. }