BT25_008.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Coronamon
  5. namespace DCGO.CardEffects.BT25
  6. {
  7. public class BT25_008 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternative Digivolve Condition
  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, 0, false, card, null, level: 2));
  20. }
  21. #endregion
  22. #region Shared OP/WD
  23. string SharedEffectName = "May trash up to 2 cards to <Draw 1> same amount";
  24. CardEffectFactory.ActivateClassesForSharedEffects
  25. (ref cardEffects, timing, card,
  26. SharedEffectName,
  27. SharedActivateCoroutine,
  28. SharedEffectDescription,
  29. optional: false,
  30. isSkippable: true,
  31. onPlay: true,
  32. whenMoving: true);
  33. string SharedEffectDescription(string tag) => $"[{tag}] By trashing up to 2 [Iliad] or [TS] trait cards from your hand, <Draw 1> for each card trashed.";
  34. bool CanSelectCardCondition(CardSource cardSource)
  35. {
  36. return cardSource.HasIliadTraits
  37. || cardSource.HasTSTraits;
  38. }
  39. IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
  40. {
  41. if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
  42. {
  43. int maxCount = Math.Min(2, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CanSelectCardCondition));
  44. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  45. selectHandEffect.SetUp(
  46. selectPlayer: card.Owner,
  47. canTargetCondition: CanSelectCardCondition,
  48. canTargetCondition_ByPreSelecetedList: null,
  49. canEndSelectCondition: null,
  50. maxCount: maxCount,
  51. canNoSelect: true,
  52. canEndNotMax: true,
  53. isShowOpponent: true,
  54. selectCardCoroutine: null,
  55. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  56. mode: SelectHandEffect.Mode.Discard,
  57. cardEffect: activateClass);
  58. yield return StartCoroutine(selectHandEffect.Activate());
  59. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  60. {
  61. int drawCount = cardSources.Count;
  62. yield return ContinuousController.instance.StartCoroutine(new DrawClass(
  63. player: card.Owner,
  64. drawCount: drawCount,
  65. cardEffect: activateClass).Draw()
  66. );
  67. }
  68. }
  69. }
  70. #endregion
  71. #region Inherit
  72. if (timing == EffectTiming.None)
  73. {
  74. bool Condition()
  75. {
  76. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  77. && CardEffectCommons.IsOwnerTurn(card);
  78. }
  79. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  80. changeValue: 2000,
  81. isInheritedEffect: true,
  82. card: card,
  83. condition: Condition));
  84. }
  85. #endregion
  86. return cardEffects;
  87. }
  88. }
  89. }