EX12_054.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Guardromon
  4. namespace DCGO.CardEffects.EX12
  5. {
  6. public class EX12_054 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternative Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsTraits("ME");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  19. permanentCondition: PermanentCondition,
  20. digivolutionCost: 2,
  21. ignoreDigivolutionRequirement: false,
  22. card: card,
  23. condition: null,
  24. level: 3)
  25. );
  26. }
  27. #endregion
  28. #region Blocker
  29. if (timing == EffectTiming.None)
  30. {
  31. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  32. }
  33. #endregion
  34. #region Shared OP / WD
  35. string SharedEffectName = "Trash 1 [Machine]/[Cyborg]/[ME] card to <Draw 2>";
  36. CardEffectFactory.ActivateClassesForSharedEffects
  37. (ref cardEffects, timing, card,
  38. SharedEffectName,
  39. SharedActivateCoroutine,
  40. SharedEffectDescription,
  41. additionalActivateCondition: AdditionalActivateCondition,
  42. optional: false,
  43. isSkippable: true,
  44. onPlay: true,
  45. whenDigivolving: true);
  46. string SharedEffectDescription(string tag) => $"[{tag}] By trashing 1 card with the [Machine], [Cyborg] or [ME] trait from your hand, <Draw 2>.";
  47. bool AdditionalActivateCondition(Hashtable hashtable, ActivateClass activateClass)
  48. {
  49. return CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
  50. }
  51. bool CanSelectCardCondition(CardSource cardSource)
  52. {
  53. return cardSource.EqualsTraits("Machine")
  54. || cardSource.EqualsTraits("Cyborg")
  55. || cardSource.EqualsTraits("ME");
  56. }
  57. IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
  58. {
  59. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  60. selectHandEffect.SetUp(
  61. selectPlayer: card.Owner,
  62. canTargetCondition: CanSelectCardCondition,
  63. canTargetCondition_ByPreSelecetedList: null,
  64. canEndSelectCondition: null,
  65. maxCount: 1,
  66. canNoSelect: true,
  67. canEndNotMax: false,
  68. isShowOpponent: true,
  69. selectCardCoroutine: null,
  70. afterSelectCardCoroutine: AfterSelectCardCoroutine,
  71. mode: SelectHandEffect.Mode.Discard,
  72. cardEffect: activateClass);
  73. selectHandEffect.SetUpCustomMessage("Select 1 card to trash.", "The opponent is selecting 1 card to trash from their hand.");
  74. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  75. IEnumerator AfterSelectCardCoroutine(List<CardSource> cardSources)
  76. {
  77. if (cardSources.Count >= 1)
  78. {
  79. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
  80. }
  81. }
  82. }
  83. #endregion
  84. #region Inherited Blocker
  85. if (timing == EffectTiming.None)
  86. {
  87. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: true, card: card, condition: null));
  88. }
  89. #endregion
  90. return cardEffects;
  91. }
  92. }
  93. }