BT3_047.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 BT3_047 : 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.OnDestroyedAnyone)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[On Deletion] Reveal the top 3 cards of your deck. Add 1 level 4 or 5 Digimon 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. if (cardSource.IsDigimon)
  26. {
  27. if (cardSource.HasLevel)
  28. {
  29. if (cardSource.Level == 4)
  30. {
  31. return true;
  32. }
  33. if (cardSource.Level == 5)
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanUseCondition(Hashtable hashtable)
  42. {
  43. return CardEffectCommons.CanTriggerOnDeletion(hashtable, card, activateClass);
  44. }
  45. bool CanActivateCondition(Hashtable hashtable)
  46. {
  47. if (CardEffectCommons.CanActivateOnDeletion(card, activateClass))
  48. {
  49. if (card.Owner.LibraryCards.Count >= 1)
  50. {
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  57. {
  58. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  59. revealCount: 3,
  60. simplifiedSelectCardConditions:
  61. new SimplifiedSelectCardConditionClass[]
  62. {
  63. new SimplifiedSelectCardConditionClass(
  64. canTargetCondition:CanSelectCardCondition,
  65. message: "Select 1 level 4 or 5 Digimon card.",
  66. mode: SelectCardEffect.Mode.AddHand,
  67. maxCount: 1,
  68. selectCardCoroutine: null),
  69. },
  70. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  71. activateClass: activateClass
  72. ));
  73. }
  74. }
  75. return cardEffects;
  76. }
  77. }