BT25_012.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Grizzlymon
  4. namespace DCGO.CardEffects.BT25
  5. {
  6. public class BT25_012 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alt Digivolution
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent permanent)
  15. {
  16. return permanent.TopCard.EqualsTraits("TS");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 2, true, card, null, level: 3));
  19. }
  20. #endregion
  21. #region OP/WD Shared
  22. string SharedEffectName = "Give 1 of your Digimon <Raid> and +3K DP for turn";
  23. CardEffectFactory.ActivateClassesForSharedEffects
  24. (ref cardEffects, timing, card,
  25. SharedEffectName,
  26. SharedActivateCoroutine,
  27. SharedEffectDescription,
  28. optional: false,
  29. maxCountPerTurn: -1,
  30. onPlay: true,
  31. whenDigivolving: true);
  32. string SharedEffectDescription(string tag)
  33. {
  34. return $"[{tag}] 1 of your Digimon with [Beast], [Animal] or [Sovereign], other than [Sea Animal], in any of its traits or the [Shaman] or [TS] trait gains <Raid> and +3000 DP for the turn.";
  35. }
  36. bool CanSelectPermanentCondition(Permanent permanent)
  37. {
  38. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  39. && (permanent.TopCard.HasBeastTraits
  40. || permanent.TopCard.EqualsTraits("Shaman")
  41. || permanent.TopCard.HasTSTraits);
  42. }
  43. IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
  44. {
  45. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  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: null,
  57. afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
  58. mode: SelectPermanentEffect.Mode.Custom,
  59. cardEffect: activateClass);
  60. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to gain Raid and +3000 DP", "Opponent is select 1 Digimon to gain Raid and +3000 DP");
  61. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  62. IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanent)
  63. {
  64. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRaid(
  65. targetPermanent: permanent[0],
  66. effectDuration: EffectDuration.UntilEachTurnEnd,
  67. activateClass: activateClass));
  68. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  69. targetPermanent: permanent[0],
  70. changeValue: 3000,
  71. effectDuration: EffectDuration.UntilEachTurnEnd,
  72. activateClass: activateClass));
  73. }
  74. }
  75. }
  76. #endregion
  77. #region Inherit
  78. if (timing == EffectTiming.None)
  79. {
  80. bool Condition()
  81. {
  82. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  83. }
  84. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  85. changeValue: 1000,
  86. isInheritedEffect: true,
  87. card: card,
  88. condition: Condition));
  89. }
  90. #endregion
  91. return cardEffects;
  92. }
  93. }
  94. }