EX1_011.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX1
  4. {
  5. public class EX1_011 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnAllyAttack)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetHashString("Reveal3_EX1_011");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[When Attacking][Once Per Turn] Reveal the top 3 cards of your deck. Add 1 Tamer card or 1 Digimon card with [Gabumon] in its name among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  21. }
  22. bool CanSelectCardCondition(CardSource cardSource)
  23. {
  24. if (cardSource.IsTamer)
  25. {
  26. return true;
  27. }
  28. if (cardSource.IsDigimon)
  29. {
  30. if (cardSource.ContainsCardName("Gabumon"))
  31. {
  32. return true;
  33. }
  34. }
  35. return false;
  36. }
  37. bool CanUseCondition(Hashtable hashtable)
  38. {
  39. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  40. }
  41. bool CanActivateCondition(Hashtable hashtable)
  42. {
  43. if (CardEffectCommons.IsExistOnBattleArea(card))
  44. {
  45. return true;
  46. }
  47. return false;
  48. }
  49. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  50. {
  51. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  52. revealCount: 3,
  53. simplifiedSelectCardConditions:
  54. new SimplifiedSelectCardConditionClass[]
  55. {
  56. new SimplifiedSelectCardConditionClass(
  57. canTargetCondition:CanSelectCardCondition,
  58. message: "Select 1 Tamer card or 1 Digimon card with [Gabumon] in its name.",
  59. mode: SelectCardEffect.Mode.AddHand,
  60. maxCount: 1,
  61. selectCardCoroutine: null),
  62. },
  63. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  64. activateClass: activateClass
  65. ));
  66. }
  67. }
  68. return cardEffects;
  69. }
  70. }
  71. }