BT4_096.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 BT4_096 : 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.OnStartTurn)
  14. {
  15. cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
  16. }
  17. if (timing == EffectTiming.OnEnterFieldAnyone)
  18. {
  19. ActivateClass activateClass = new ActivateClass();
  20. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  21. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  22. cardEffects.Add(activateClass);
  23. string EffectDiscription()
  24. {
  25. return "[On Play] Reveal the top 3 cards of your deck. If all of the revealed cards are black, gain 1 memory. Place the cards on top of your deck in any order.";
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  30. }
  31. bool CanActivateCondition(Hashtable hashtable)
  32. {
  33. if (CardEffectCommons.IsExistOnBattleArea(card))
  34. {
  35. if (card.Owner.LibraryCards.Count >= 1)
  36. {
  37. return true;
  38. }
  39. }
  40. return false;
  41. }
  42. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  43. {
  44. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndProcessForAll(
  45. revealCount: 3,
  46. simplifiedSelectCardCondition:
  47. new SimplifiedSelectCardConditionClass(
  48. canTargetCondition: (cardSource) => false,
  49. message: "",
  50. mode: SelectCardEffect.Mode.Custom,
  51. maxCount: -1,
  52. selectCardCoroutine: null),
  53. remainingCardsPlace: RemainingCardsPlace.DeckTop,
  54. activateClass: activateClass,
  55. revealedCardsCoroutine: RevealedCardsCoroutine
  56. ));
  57. IEnumerator RevealedCardsCoroutine(List<CardSource> revealedCards)
  58. {
  59. if (revealedCards.Every(cardSource => cardSource.HasCardColor(CardColor.Black)))
  60. {
  61. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  62. }
  63. }
  64. }
  65. }
  66. if (timing == EffectTiming.SecuritySkill)
  67. {
  68. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  69. }
  70. return cardEffects;
  71. }
  72. }