EX6_017.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Luxmon
  4. namespace DCGO.CardEffects.EX6
  5. {
  6. public class EX6_017 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region On PLay
  12. if (timing == EffectTiming.OnEnterFieldAnyone)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  17. cardEffects.Add(activateClass);
  18. string EffectDescription()
  19. {
  20. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with the [Angel]/[Archangel] trait and 1 card with the [Three Great Angels] trait among them to your hand. Return the rest to the bottom of the deck.";
  21. }
  22. bool CanSelectCardCondition(CardSource cardSource)
  23. {
  24. return cardSource.IsDigimon
  25. && (cardSource.CardTraits.Contains("Angel")
  26. || cardSource.CardTraits.Contains("Archangel"));
  27. }
  28. bool CanSelectCardCondition1(CardSource cardSource)
  29. {
  30. return cardSource.CardTraits.Contains("Three Great Angels")
  31. || cardSource.CardTraits.Contains("ThreeGreatAngels");
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleArea(card)
  36. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  37. }
  38. bool CanActivateCondition(Hashtable hashtable)
  39. {
  40. return CardEffectCommons.IsExistOnBattleArea(card);
  41. }
  42. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  43. {
  44. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  45. revealCount: 3,
  46. simplifiedSelectCardConditions:
  47. new SimplifiedSelectCardConditionClass[]
  48. {
  49. new SimplifiedSelectCardConditionClass(
  50. canTargetCondition:CanSelectCardCondition,
  51. message: "Select 1 Digimon card with the [Angel]/[Archangel] trait.",
  52. mode: SelectCardEffect.Mode.AddHand,
  53. maxCount: 1,
  54. selectCardCoroutine: null),
  55. new SimplifiedSelectCardConditionClass(
  56. canTargetCondition:CanSelectCardCondition1,
  57. message: "Select 1 card with [Three Great Angels] trait.",
  58. mode: SelectCardEffect.Mode.AddHand,
  59. maxCount: 1,
  60. selectCardCoroutine: null),
  61. },
  62. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  63. activateClass: activateClass
  64. ));
  65. }
  66. }
  67. #endregion
  68. #region Inherit
  69. if (timing == EffectTiming.OnAllyAttack)
  70. {
  71. ActivateClass activateClass = new ActivateClass();
  72. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  73. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  74. activateClass.SetIsInheritedEffect(true);
  75. activateClass.SetHashString("Draw1_EX6_017");
  76. cardEffects.Add(activateClass);
  77. string EffectDiscription()
  78. {
  79. return "[When Attacking][Once Per Turn] If this Digimon has the [Angel]/[Archangel]/[Three Great Angels] trait, Draw 1";
  80. }
  81. bool CanUseCondition(Hashtable hashtable)
  82. {
  83. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  84. && CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  85. }
  86. bool CanActivateCondition(Hashtable hashtable)
  87. {
  88. return CardEffectCommons.IsExistOnBattleArea(card)
  89. && (card.PermanentOfThisCard().TopCard.CardTraits.Contains("Angel")
  90. || card.PermanentOfThisCard().TopCard.CardTraits.Contains("Archangel")
  91. || card.PermanentOfThisCard().TopCard.CardTraits.Contains("Three Great Angels")
  92. || card.PermanentOfThisCard().TopCard.CardTraits.Contains("ThreeGreatAngels"));
  93. }
  94. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  95. {
  96. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  97. }
  98. }
  99. #endregion
  100. return cardEffects;
  101. }
  102. }
  103. }