EX6_047.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace DCGO.CardEffects.EX6
  5. {
  6. public class EX6_047 : 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 3", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Fallen Angel] or [Demon Lord] trait and 1 purple option card among them to your hand. Return the rest to the bottom of the deck. If you added cards, trash 1 card in your hand.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOnPlay(hashtable,card);
  25. }
  26. bool CanSelectCardCondition(CardSource _card)
  27. {
  28. if (_card.CardTraits.Contains("Fallen Angel") || _card.CardTraits.Contains("FallenAngel") || _card.CardTraits.Contains("DemonLord") || _card.CardTraits.Contains("Demon Lord"))
  29. {
  30. return true;
  31. }
  32. return false;
  33. }
  34. bool CanSelectCardCondition1(CardSource _card)
  35. {
  36. if(_card.IsOption && _card.HasCardColor(CardColor.Purple))
  37. {
  38. return true;
  39. }
  40. return false;
  41. }
  42. bool CanActivateCondition(Hashtable hashtable)
  43. {
  44. if(CardEffectCommons.IsExistOnBattleArea(card))
  45. {
  46. if (card.Owner.LibraryCards.Count >= 1)
  47. {
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable hashtable)
  54. {
  55. bool added = false;
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  57. revealCount: 3,
  58. simplifiedSelectCardConditions:
  59. new SimplifiedSelectCardConditionClass[]
  60. {
  61. new SimplifiedSelectCardConditionClass(
  62. canTargetCondition:CanSelectCardCondition,
  63. message: "Select 1 card with the [Fallen Angel] or [Demon Lord] trait.",
  64. mode: SelectCardEffect.Mode.AddHand,
  65. maxCount: 1,
  66. selectCardCoroutine: null),
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition1,
  69. message: "Select 1 purple Option card.",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. },
  74. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  75. activateClass: activateClass,
  76. revealedCardsCoroutine: RevealedCardsCoroutine
  77. ));
  78. IEnumerator RevealedCardsCoroutine(List<CardSource> revealedCards)
  79. {
  80. added = revealedCards.Count(CanSelectCardCondition) >= 1 || revealedCards.Count(CanSelectCardCondition1) >= 1;
  81. yield return null;
  82. }
  83. if (added)
  84. {
  85. if (card.Owner.HandCards.Count >= 1)
  86. {
  87. int discardCount = 1;
  88. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  89. selectHandEffect.SetUp(
  90. selectPlayer: card.Owner,
  91. canTargetCondition: (cardSource) => true,
  92. canTargetCondition_ByPreSelecetedList: null,
  93. canEndSelectCondition: null,
  94. maxCount: discardCount,
  95. canNoSelect: false,
  96. canEndNotMax: false,
  97. isShowOpponent: true,
  98. selectCardCoroutine: null,
  99. afterSelectCardCoroutine: null,
  100. mode: SelectHandEffect.Mode.Discard,
  101. cardEffect: activateClass);
  102. yield return StartCoroutine(selectHandEffect.Activate());
  103. }
  104. }
  105. }
  106. }
  107. #endregion
  108. #region Inherit
  109. if (timing == EffectTiming.None)
  110. {
  111. bool Condition()
  112. {
  113. if (CardEffectCommons.IsExistOnBattleArea(card))
  114. {
  115. if (card.Owner.Enemy.HandCards.Count <= 6)
  116. {
  117. return true;
  118. }
  119. }
  120. return false;
  121. }
  122. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  123. }
  124. #endregion
  125. return cardEffects;
  126. }
  127. }
  128. }