ST18_05.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST18
  4. {
  5. public class ST18_05 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region All Turns
  11. if (timing == EffectTiming.OnTappedAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("1 of your Digimon gains 3000 DP.", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  16. activateClass.SetHashString("Buff_ST18_05");
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return
  21. "[All Turns] (Once Per Turn) When this Digimon is suspended by an effect, 1 of your Digimon with [Bird] in one of its traits or with the [Vortex Warriors] trait gets +3000 DP until then end of your opponent's turn.";
  22. }
  23. bool CanUseCondition(Hashtable hashtable)
  24. {
  25. return CardEffectCommons.IsExistOnBattleArea(card) &&
  26. CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable,
  27. permanent => permanent == card.PermanentOfThisCard()) &&
  28. CardEffectCommons.IsByEffect(hashtable, null);
  29. }
  30. bool CanSelectPermanentCondition(Permanent permanent)
  31. {
  32. if(CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  33. {
  34. return permanent.TopCard.ContainsTraits("Avian") ||
  35. permanent.TopCard.ContainsTraits("Bird") ||
  36. permanent.TopCard.ContainsTraits("Vortex Warriors");
  37. }
  38. return false;
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  43. CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
  44. }
  45. IEnumerator ActivateCoroutine(Hashtable hashtable)
  46. {
  47. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  48. selectPermanentEffect.SetUp(
  49. selectPlayer: card.Owner,
  50. canTargetCondition: CanSelectPermanentCondition,
  51. canTargetCondition_ByPreSelecetedList: null,
  52. canEndSelectCondition: null,
  53. maxCount: 1,
  54. canNoSelect: false,
  55. canEndNotMax: false,
  56. selectPermanentCoroutine: SelectPermanentCoroutine,
  57. afterSelectPermanentCoroutine: null,
  58. mode: SelectPermanentEffect.Mode.Custom,
  59. cardEffect: activateClass);
  60. selectPermanentEffect.SetUpCustomMessage(
  61. "Select 1 Digimon that will get +3000 DP.",
  62. "The opponent is selecting 1 Digimon that will get +3000 DP.");
  63. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  64. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  67. targetPermanent: permanent,
  68. changeValue: 3000,
  69. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  70. activateClass: activateClass));
  71. }
  72. }
  73. }
  74. #endregion
  75. #region Piercing - ESS
  76. if (timing == EffectTiming.OnDetermineDoSecurityCheck)
  77. {
  78. cardEffects.Add(CardEffectFactory.PierceSelfEffect(
  79. isInheritedEffect: true,
  80. card: card,
  81. condition: null));
  82. }
  83. #endregion
  84. return cardEffects;
  85. }
  86. }
  87. }