BT25_067.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Sealsdramon
  4. namespace DCGO.CardEffects.BT25
  5. {
  6. public class BT25_067 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternative Digivolve Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. static bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsTraits("D-Brigade")
  17. || targetPermanent.TopCard.EqualsTraits("ACCEL");
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 2, false, card, null, level: 3));
  20. }
  21. #endregion
  22. #region Your Turn
  23. if (timing == EffectTiming.OnEnterFieldAnyone)
  24. {
  25. ActivateClass activateClass = new ActivateClass();
  26. activateClass.SetUpICardEffect("Digivolve into [D-Brigade]/[ACCEL] trait in hand for 2 less", CanUseCondition, card);
  27. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
  28. cardEffects.Add(activateClass);
  29. string EffectDescription()
  30. {
  31. return "[Your Turn] When any of your [D-Brigade] or [ACCEL] trait Digimon are played, this Digimon may digivolve into [D-Brigade] or [ACCEL] trait Digimon card in the hand with the cost reduced by 2.";
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  36. && CardEffectCommons.IsOwnerTurn(card)
  37. && CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PlayedPermanentCondition);
  38. }
  39. bool CanActivateCondition(Hashtable hashtable)
  40. {
  41. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  42. && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardToDigivolveInto);
  43. }
  44. bool PlayedPermanentCondition(Permanent permanent)
  45. {
  46. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card)
  47. && (permanent.TopCard.EqualsTraits("D-Brigade")
  48. || permanent.TopCard.EqualsTraits("ACCEL"));
  49. }
  50. bool CanSelectCardToDigivolveInto(CardSource cardSource)
  51. {
  52. return cardSource.EqualsTraits("D-Brigade")
  53. || cardSource.EqualsTraits("ACCEL");
  54. }
  55. IEnumerator ActivateCoroutine(Hashtable hashtable)
  56. {
  57. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.DigivolveIntoHandOrTrashCard(
  58. targetPermanent: card.PermanentOfThisCard(),
  59. cardCondition: CanSelectCardToDigivolveInto,
  60. payCost: true,
  61. reduceCostTuple: (reduceCost: 2, reduceCostCardCondition: null),
  62. fixedCostTuple: null,
  63. ignoreDigivolutionRequirementFixedCost: -1,
  64. isHand: true,
  65. activateClass: activateClass,
  66. successProcess: null));
  67. }
  68. }
  69. #endregion
  70. #region All Turns - Inherited Effect
  71. if (timing == EffectTiming.None)
  72. {
  73. bool Condition()
  74. {
  75. return true;
  76. }
  77. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  78. changeValue: 1000,
  79. isInheritedEffect: true,
  80. card: card,
  81. condition: Condition));
  82. }
  83. #endregion
  84. return cardEffects;
  85. }
  86. }
  87. }