BT5_007.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 BT5_007 : 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 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 Play] Reveal 3 cards from the top of your deck. Add 1 Digimon card with [Greymon] in its name (other than [DoruGreymon], [BurningGreymon], or [DexDoruGreymon]) and 1 Digimon card with [Omnimon] in its name 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.HasGreymonName)
  28. {
  29. return true;
  30. }
  31. }
  32. return false;
  33. }
  34. bool CanSelectCardCondition1(CardSource cardSource)
  35. {
  36. if (cardSource.IsDigimon)
  37. {
  38. if (cardSource.ContainsCardName("Omnimon"))
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. if (CardEffectCommons.IsExistOnBattleArea(card))
  52. {
  53. if (card.Owner.LibraryCards.Count >= 1)
  54. {
  55. return true;
  56. }
  57. }
  58. return false;
  59. }
  60. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  61. {
  62. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  63. revealCount: 3,
  64. simplifiedSelectCardConditions:
  65. new SimplifiedSelectCardConditionClass[]
  66. {
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition,
  69. message: "Select 1 Digimon card with [Greymon] in its name.",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. new SimplifiedSelectCardConditionClass(
  74. canTargetCondition:CanSelectCardCondition1,
  75. message: "Select 1 Digimon card with [Omnimon] in its name.",
  76. mode: SelectCardEffect.Mode.AddHand,
  77. maxCount: 1,
  78. selectCardCoroutine: null),
  79. },
  80. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  81. activateClass: activateClass,
  82. mutualConditions: true
  83. ));
  84. }
  85. }
  86. return cardEffects;
  87. }
  88. }