LM_014.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.LM
  4. {
  5. public class LM_014 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region OnPlay
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  16. cardEffects.Add(activateClass);
  17. string EffectDiscription()
  18. {
  19. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with <Blocker> or 1 Tamer card among them to the hand. Return the rest to the bottom of the deck.";
  20. }
  21. bool CanSelectCondition(CardSource cardSource)
  22. {
  23. if(cardSource.HasBlocker || cardSource.IsTamer)
  24. {
  25. return true;
  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.SimplifiedRevealDeckTopCardsAndSelect(
  47. revealCount: 3,
  48. simplifiedSelectCardConditions:
  49. new SimplifiedSelectCardConditionClass[]
  50. {
  51. new SimplifiedSelectCardConditionClass(
  52. canTargetCondition:CanSelectCondition,
  53. message: "Select 1 card with <Blocker> or 1 Tamer.",
  54. mode: SelectCardEffect.Mode.AddHand,
  55. maxCount: 1,
  56. selectCardCoroutine: null),
  57. },
  58. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  59. activateClass: activateClass
  60. ));
  61. }
  62. }
  63. #endregion
  64. #region OnAttackTargetChanged - Inherited Effect
  65. if (timing == EffectTiming.OnAttackTargetChanged)
  66. {
  67. ActivateClass activateClass = new ActivateClass();
  68. activateClass.SetUpICardEffect("Draw 1", CanUseCondition, card);
  69. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  70. activateClass.SetIsInheritedEffect(true);
  71. activateClass.SetHashString("Draw+1_LM_014");
  72. cardEffects.Add(activateClass);
  73. string EffectDiscription()
  74. {
  75. return "[Opponent's Turn] [Once Per Turn] When the attack target is switched, <Draw 1>.";
  76. }
  77. bool CanUseCondition(Hashtable hashtable)
  78. {
  79. if (CardEffectCommons.IsExistOnBattleArea(card))
  80. {
  81. if (CardEffectCommons.IsOpponentTurn(card))
  82. {
  83. if (CardEffectCommons.CanTriggerOnPermanentAttackTargetSwitch(hashtable, permanent => true))
  84. {
  85. return true;
  86. }
  87. }
  88. }
  89. return false;
  90. }
  91. bool CanActivateCondition(Hashtable hashtable)
  92. {
  93. if (CardEffectCommons.IsExistOnBattleArea(card))
  94. {
  95. if (card.Owner.LibraryCards.Count >= 1)
  96. {
  97. return true;
  98. }
  99. }
  100. return false;
  101. }
  102. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  103. {
  104. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw());
  105. }
  106. }
  107. #endregion
  108. return cardEffects;
  109. }
  110. }
  111. }