BT20_030.cs 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT20
  4. {
  5. public class BT20_030 : 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 Requirement
  11. if (timing == EffectTiming.None)
  12. {
  13. static bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Frimon") ||
  16. (targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 2 && targetPermanent.TopCard.EqualsTraits("ACCEL"));
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. #endregion
  21. #region On Play
  22. if (timing == EffectTiming.OnEnterFieldAnyone)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Reveal 3 cards, add 2", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  27. cardEffects.Add(activateClass);
  28. string EffectDiscription()
  29. {
  30. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with [Chaosmon] in its name or the [ACCEL] trait and 1 Option card with the [ACCEL] trait among them to the hand. Return the rest to the bottom of the deck.";
  31. }
  32. bool IsChaosOrAccel(CardSource source)
  33. {
  34. return source.IsDigimon &&
  35. (source.ContainsCardName("Chaosmon") || source.EqualsTraits("ACCEL"));
  36. }
  37. bool IsAccelOption(CardSource source)
  38. {
  39. return source.IsOption &&
  40. source.EqualsTraits("ACCEL");
  41. }
  42. bool CanUseCondition(Hashtable hashtable)
  43. {
  44. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  45. }
  46. bool CanActivateCondition(Hashtable hashtable)
  47. {
  48. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  49. }
  50. IEnumerator ActivateCoroutine(Hashtable hashtable)
  51. {
  52. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  53. revealCount: 3,
  54. simplifiedSelectCardConditions:
  55. new SimplifiedSelectCardConditionClass[]
  56. {
  57. new SimplifiedSelectCardConditionClass(
  58. canTargetCondition:IsChaosOrAccel,
  59. message: "Select 1 Digimon with [Chaosmon] in its name or the [ACCEL] trait.",
  60. mode: SelectCardEffect.Mode.AddHand,
  61. maxCount: 1,
  62. selectCardCoroutine: null),
  63. new SimplifiedSelectCardConditionClass(
  64. canTargetCondition: IsAccelOption,
  65. message: "Select 1 option with the [ACCEL] trait.",
  66. mode: SelectCardEffect.Mode.AddHand,
  67. maxCount: 1,
  68. selectCardCoroutine: null)
  69. },
  70. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  71. activateClass: activateClass
  72. ));
  73. }
  74. }
  75. #endregion
  76. #region Barrier - ESS
  77. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  78. cardEffects.Add(CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: null));
  79. #endregion
  80. return cardEffects;
  81. }
  82. }
  83. }