EX5_035.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. public class EX5_035 : CEntity_Effect
  4. {
  5. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  6. {
  7. List<ICardEffect> cardEffects = new List<ICardEffect>();
  8. if (timing == EffectTiming.OnEnterFieldAnyone)
  9. {
  10. ActivateClass activateClass = new ActivateClass();
  11. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  12. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  13. cardEffects.Add(activateClass);
  14. string EffectDiscription()
  15. {
  16. return "[On Play] Reveal the top 3 cards of your deck. Add all Digimon cards with <Fortitude> among them to the hand. Return the rest to the bottom of the deck.";
  17. }
  18. bool CanSelectCardCondition(CardSource cardSource)
  19. {
  20. if (cardSource.IsDigimon)
  21. {
  22. if (cardSource.HasFortitude)
  23. {
  24. return true;
  25. }
  26. }
  27. return false;
  28. }
  29. bool CanUseCondition(Hashtable hashtable)
  30. {
  31. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  32. }
  33. bool CanActivateCondition(Hashtable hashtable)
  34. {
  35. if (CardEffectCommons.IsExistOnBattleArea(card))
  36. {
  37. if (card.Owner.LibraryCards.Count >= 1)
  38. {
  39. return true;
  40. }
  41. }
  42. return false;
  43. }
  44. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  45. {
  46. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndProcessForAll(
  47. revealCount: 3,
  48. simplifiedSelectCardCondition:
  49. new SimplifiedSelectCardConditionClass(
  50. canTargetCondition: CanSelectCardCondition,
  51. message: "",
  52. mode: SelectCardEffect.Mode.AddHand,
  53. maxCount: -1,
  54. selectCardCoroutine: null),
  55. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  56. activateClass: activateClass
  57. ));
  58. }
  59. }
  60. if (timing == EffectTiming.None)
  61. {
  62. bool Condition()
  63. {
  64. if (CardEffectCommons.IsExistOnBattleArea(card))
  65. {
  66. if (card.PermanentOfThisCard().IsSuspended)
  67. {
  68. return true;
  69. }
  70. }
  71. return false;
  72. }
  73. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  74. }
  75. return cardEffects;
  76. }
  77. }