EX12_012.cs 4.0 KB

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