BT2_044.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 BT2_044 : 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 "[When Digivolving] Reveal 3 cards from the top of your deck. Add 1 level 5 Digimon card and 1 green Tamer 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.Level == 5)
  28. {
  29. if (cardSource.HasLevel)
  30. {
  31. return true;
  32. }
  33. }
  34. }
  35. return false;
  36. }
  37. bool CanSelectCardCondition1(CardSource cardSource)
  38. {
  39. if (cardSource.IsTamer)
  40. {
  41. if (cardSource.HasCardColor(CardColor.Green))
  42. {
  43. return true;
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  51. }
  52. bool CanActivateCondition(Hashtable hashtable)
  53. {
  54. if (CardEffectCommons.IsExistOnBattleArea(card))
  55. {
  56. if (card.Owner.LibraryCards.Count >= 1)
  57. {
  58. return true;
  59. }
  60. }
  61. return false;
  62. }
  63. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  64. {
  65. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  66. revealCount: 3,
  67. simplifiedSelectCardConditions:
  68. new SimplifiedSelectCardConditionClass[]
  69. {
  70. new SimplifiedSelectCardConditionClass(
  71. canTargetCondition:CanSelectCardCondition,
  72. message:"Select 1 level 5 Digimon card.",
  73. mode: SelectCardEffect.Mode.AddHand,
  74. maxCount: 1,
  75. selectCardCoroutine: null),
  76. new SimplifiedSelectCardConditionClass(
  77. canTargetCondition:CanSelectCardCondition1,
  78. message:"Select 1 green Tamer card.",
  79. mode: SelectCardEffect.Mode.AddHand,
  80. maxCount: 1,
  81. selectCardCoroutine: null),
  82. },
  83. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  84. activateClass: activateClass
  85. ));
  86. }
  87. }
  88. return cardEffects;
  89. }
  90. }