BT20_007.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT20
  4. {
  5. public class BT20_007 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.CardNames.Contains("Bebydomon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
  18. digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. #endregion
  21. #region Start of Your Main Phase
  22. if (timing == EffectTiming.OnStartMainPhase)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Trash 1 [Dracomon]/[Examon] text card, <Draw 1> and gain 1 memory", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  27. cardEffects.Add(activateClass);
  28. string EffectDescription()
  29. {
  30. return
  31. "[Start of Your Main Phase] By trashing 1 card with [Dracomon]/[Examon] in its text in your hand, <Draw 1> and gain 1 memory.";
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  36. CardEffectCommons.IsOwnerTurn(card);
  37. }
  38. bool HasDragonText(CardSource cardSource)
  39. {
  40. return cardSource.HasText("Dracomon") || cardSource.HasText("Examon");
  41. }
  42. bool CanActivateCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  45. CardEffectCommons.HasMatchConditionOwnersHand(card, HasDragonText);
  46. }
  47. IEnumerator ActivateCoroutine(Hashtable hashtable)
  48. {
  49. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  50. selectHandEffect.SetUp(
  51. canTargetCondition: HasDragonText,
  52. canTargetCondition_ByPreSelecetedList: null,
  53. canEndSelectCondition: null,
  54. canNoSelect: true,
  55. selectCardCoroutine: null,
  56. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  57. maxCount: 1,
  58. canEndNotMax: false,
  59. isShowOpponent: true,
  60. mode: SelectHandEffect.Mode.Discard,
  61. selectPlayer: card.Owner,
  62. cardEffect: activateClass);
  63. selectHandEffect.SetUpCustomMessage("Select 1 card with [Dracomon]/[Examon] in its text to discard.",
  64. "The opponent is selecting 1 card with [Dracomon]/[Examon] in its text to discard.");
  65. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  66. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  67. {
  68. if (cardSources.Count > 0)
  69. {
  70. yield return ContinuousController.instance.StartCoroutine(
  71. new DrawClass(card.Owner, 1, activateClass).Draw());
  72. yield return ContinuousController.instance.StartCoroutine(
  73. card.Owner.AddMemory(1, activateClass));
  74. }
  75. }
  76. }
  77. }
  78. #endregion
  79. #region Your Turn - ESS
  80. if (timing == EffectTiming.None)
  81. {
  82. bool Condition()
  83. {
  84. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
  85. CardEffectCommons.IsOwnerTurn(card);
  86. }
  87. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  88. changeValue: 2000,
  89. isInheritedEffect: true,
  90. card: card,
  91. condition: Condition));
  92. }
  93. #endregion
  94. return cardEffects;
  95. }
  96. }
  97. }