BT16_037.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT16
  4. {
  5. public class BT16_037 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region On Play
  11. if (timing == EffectTiming.OnEnterFieldAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Reveal the top 4 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 4 cards of your deck. Add 1 card with the [Insectoid] trait among them to your hand. Place the rest at the bottom of your deck in any order.";
  20. }
  21. bool CanSelectCardCondition(CardSource cardSource)
  22. {
  23. if (cardSource.CardTraits.Contains("Insectoid"))
  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: 4,
  48. simplifiedSelectCardConditions:
  49. new SimplifiedSelectCardConditionClass[]
  50. {
  51. new SimplifiedSelectCardConditionClass(
  52. canTargetCondition:CanSelectCardCondition,
  53. message:"Select 1 card with [Insectoid] in its traits.",
  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 Inherit
  65. if (timing == EffectTiming.None)
  66. {
  67. bool Condition()
  68. {
  69. if (CardEffectCommons.IsExistOnBattleArea(card))
  70. {
  71. if (card.PermanentOfThisCard().IsSuspended)
  72. {
  73. return true;
  74. }
  75. }
  76. return false;
  77. }
  78. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  79. }
  80. #endregion
  81. return cardEffects;
  82. }
  83. }
  84. }