BT25_066.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Guardromon
  5. namespace DCGO.CardEffects.BT25
  6. {
  7. public class BT25_066 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternate Digivolution Requirement
  13. if (timing == EffectTiming.None)
  14. {
  15. static bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.HasTSTraits;
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 3));
  20. }
  21. #endregion
  22. #region Blocker
  23. if (timing == EffectTiming.None)
  24. {
  25. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  26. }
  27. #endregion
  28. #region All Turns
  29. if (timing == EffectTiming.WhenRemoveField)
  30. {
  31. List<Permanent> removedPermanents = new List<Permanent>();
  32. ActivateClass activateClass = new ActivateClass();
  33. activateClass.SetUpICardEffect("Trash a linked card to prevent this digimon from leaving", CanUseCondition, card);
  34. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  35. activateClass.SetIsSkippable(true);
  36. cardEffects.Add(activateClass);
  37. string EffectDescription()
  38. {
  39. return
  40. "[All Turns] When this Digimon would leave the battle area, by trashing 1 of its link cards, it doesn't leave.";
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.IsExistOnBattleArea(card)
  45. && CardEffectCommons.CanTriggerWhenRemoveField(hashtable, card);
  46. }
  47. bool CanActivateCondition(Hashtable hashtable)
  48. {
  49. return CardEffectCommons.IsExistOnBattleArea(card)
  50. && !card.PermanentOfThisCard().HasNoLinkCards;
  51. }
  52. IEnumerator ActivateCoroutine(Hashtable hashtable)
  53. {
  54. Permanent thisPermanent = card.PermanentOfThisCard();
  55. SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
  56. selectCardEffect.SetUp(
  57. canTargetCondition: _ => true,
  58. canTargetCondition_ByPreSelecetedList: null,
  59. canEndSelectCondition: null,
  60. canNoSelect: () => true,
  61. selectCardCoroutine: null,
  62. afterSelectCardCoroutine: SelectCardCoroutine,
  63. message: "Select 1 link card to trash.",
  64. maxCount: 1,
  65. canEndNotMax: false,
  66. isShowOpponent: true,
  67. mode: SelectCardEffect.Mode.Discard,
  68. root: SelectCardEffect.Root.LinkedCards,
  69. customRootCardList: card.PermanentOfThisCard().LinkedCards,
  70. canLookReverseCard: true,
  71. selectPlayer: card.Owner,
  72. cardEffect: activateClass);
  73. selectCardEffect.SetUpCustomMessage("Select 1 link card to trash.", "The opponent is selecting 1 link card to trash.");
  74. yield return StartCoroutine(selectCardEffect.Activate());
  75. IEnumerator SelectCardCoroutine(List<CardSource> cardSources)
  76. {
  77. if (cardSources.Count > 0)
  78. {
  79. thisPermanent.willBeRemoveField = false;
  80. thisPermanent.HideHandBounceEffect();
  81. thisPermanent.HideDeckBounceEffect();
  82. thisPermanent.HideWillRemoveFieldEffect();
  83. thisPermanent.HideDeleteEffect();
  84. }
  85. yield return null;
  86. }
  87. }
  88. }
  89. #endregion
  90. #region All Turns - Inherited Effect
  91. if (timing == EffectTiming.None)
  92. {
  93. bool Condition()
  94. {
  95. return true;
  96. }
  97. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  98. changeValue: 1000,
  99. isInheritedEffect: true,
  100. card: card,
  101. condition: Condition));
  102. }
  103. #endregion
  104. return cardEffects;
  105. }
  106. }
  107. }