BT1_088.cs 3.1 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 BT1_088 : 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.OnDeclaration)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect("Reveal the top card of deck", CanUseCondition, card);
  17. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Main] If you have a level 5 or higher green Digimon in play, you can suspend this Tamer to reveal the top card of your deck. If that card is a Digimon card, add it to your hand. Otherwise place it at the bottom of your deck.";
  22. }
  23. bool CardCondition(CardSource cardSource)
  24. {
  25. return cardSource.IsDigimon;
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. if (CardEffectCommons.IsExistOnBattleArea(card))
  30. {
  31. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  32. {
  33. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent.TopCard.CardColors.Contains(CardColor.Green) && permanent.Level >= 5 && permanent.TopCard.HasLevel))
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  42. {
  43. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  44. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.RevealDeckTopCardsAndProcessForAll(
  45. revealCount: 1,
  46. simplifiedSelectCardCondition:
  47. new SimplifiedSelectCardConditionClass(
  48. canTargetCondition: CardCondition,
  49. message: "",
  50. mode: SelectCardEffect.Mode.AddHand,
  51. maxCount: -1,
  52. selectCardCoroutine: null),
  53. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  54. activateClass: activateClass
  55. ));
  56. }
  57. }
  58. if (timing == EffectTiming.SecuritySkill)
  59. {
  60. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  61. }
  62. return cardEffects;
  63. }
  64. }