BT25_051.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. // Grizzlymon
  6. namespace DCGO.CardEffects.BT25
  7. {
  8. public class BT25_051 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Alternative Digivolve Condition
  14. if (timing == EffectTiming.None)
  15. {
  16. static bool PermanentCondition(Permanent targetPermanent)
  17. {
  18. return targetPermanent.TopCard.HasTSTraits;
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 2, false, card, null, level: 3));
  21. }
  22. #endregion
  23. #region Blocker
  24. if (timing == EffectTiming.None)
  25. {
  26. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  27. }
  28. #endregion
  29. #region Shared OP / WD
  30. string SharedEffectName = "1 of your traited Digimon gets +3000 DP until enemy turn end";
  31. CardEffectFactory.ActivateClassesForSharedEffects
  32. (ref cardEffects, timing, card,
  33. SharedEffectName,
  34. SharedActivateCoroutine,
  35. SharedEffectDescription,
  36. optional: false,
  37. onPlay: true,
  38. whenDigivolving: true);
  39. string SharedEffectDescription(string tag) => $"[{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 gets +3000 DP until your opponent's turn ends.";
  40. bool CanSelectPermanentCondition(Permanent permanent)
  41. {
  42. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  43. && (permanent.TopCard.HasBeastTraits
  44. || permanent.TopCard.EqualsTraits("Shaman")
  45. || permanent.TopCard.HasTSTraits);
  46. }
  47. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  48. {
  49. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  50. {
  51. SelectPermanentEffect selectPermanentEffect1 = GManager.instance.GetComponent<SelectPermanentEffect>();
  52. selectPermanentEffect1.SetUp(
  53. selectPlayer: card.Owner,
  54. canTargetCondition: CanSelectPermanentCondition,
  55. canTargetCondition_ByPreSelecetedList: null,
  56. canEndSelectCondition: null,
  57. maxCount: 1,
  58. canNoSelect: false,
  59. canEndNotMax: false,
  60. selectPermanentCoroutine: SelectPermanentCoroutine1,
  61. afterSelectPermanentCoroutine: null,
  62. mode: SelectPermanentEffect.Mode.Custom,
  63. cardEffect: activateClass);
  64. selectPermanentEffect1.SetUpCustomMessage(
  65. "Select 1 Digimon that will gain 3k DP until enemy turn ends.",
  66. "The opponent is selecting 1 Digimon that will gain 3k DP until enemy turn ends.");
  67. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect1.Activate());
  68. IEnumerator SelectPermanentCoroutine1(Permanent permanent)
  69. {
  70. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  71. targetPermanent: permanent,
  72. changeValue: 3000,
  73. effectDuration: EffectDuration.UntilOpponentTurnEnd,
  74. activateClass: activateClass));
  75. }
  76. }
  77. }
  78. #endregion
  79. #region ESS - Win Battle
  80. if (timing == EffectTiming.OnEndBattle)
  81. {
  82. ActivateClass activateClass = new ActivateClass();
  83. activateClass.SetUpICardEffect("<Draw 1>", CanUseCondition, card);
  84. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  85. activateClass.SetIsInheritedEffect(true);
  86. activateClass.SetHashString("BT25_051_Inherited");
  87. cardEffects.Add(activateClass);
  88. string EffectDiscription()
  89. {
  90. return "[All Turns] [Once Per Turn] When this Digimon wins a battle, <Draw 1>.";
  91. }
  92. bool CanUseCondition(Hashtable hashtable)
  93. {
  94. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  95. {
  96. bool WinnerCondition(Permanent permanent) => permanent.cardSources.Contains(card);
  97. if (CardEffectCommons.CanTriggerWhenWinBattle(
  98. hashtable: hashtable,
  99. winnerCondition: WinnerCondition))
  100. {
  101. return true;
  102. }
  103. }
  104. return false;
  105. }
  106. bool CanActivateCondition(Hashtable hashtable)
  107. {
  108. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  109. }
  110. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  111. {
  112. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  113. }
  114. }
  115. #endregion
  116. return cardEffects;
  117. }
  118. }
  119. }