BT8_033.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class BT8_033 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OnEnterFieldAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Reveal the top 4 cards of deck", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Play] Reveal the top 4 cards of your deck. Add 1 2-color yellow card among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. return (cardSource.CardColors.Count == 2 && cardSource.CardColors.Contains(CardColor.Yellow))
  26. || (cardSource.DualCardColors.Count == 2 && cardSource.DualCardColors.Contains(CardColor.Yellow));
  27. }
  28. bool CanUseCondition(Hashtable hashtable)
  29. {
  30. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  31. }
  32. bool CanActivateCondition(Hashtable hashtable)
  33. {
  34. if (CardEffectCommons.IsExistOnBattleArea(card))
  35. {
  36. if (card.Owner.LibraryCards.Count >= 1)
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  44. {
  45. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  46. revealCount: 4,
  47. simplifiedSelectCardConditions:
  48. new SimplifiedSelectCardConditionClass[]
  49. {
  50. new SimplifiedSelectCardConditionClass(
  51. canTargetCondition:CanSelectCardCondition,
  52. message: "Select 1 2-color yellow card.",
  53. mode: SelectCardEffect.Mode.AddHand,
  54. maxCount: 1,
  55. selectCardCoroutine: null),
  56. },
  57. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  58. activateClass: activateClass
  59. ));
  60. }
  61. }
  62. return cardEffects;
  63. }
  64. }