BT3_093.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_093 : 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. Add 1 blue and 1 green Digimon card among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  26. }
  27. bool CanSelectCardCondition(CardSource cardSource)
  28. {
  29. if (cardSource.IsDigimon)
  30. {
  31. if (cardSource.HasCardColor(CardColor.Blue))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanSelectCardCondition1(CardSource cardSource)
  39. {
  40. if (cardSource.IsDigimon)
  41. {
  42. if (cardSource.HasCardColor(CardColor.Green))
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanUseCondition(Hashtable hashtable)
  50. {
  51. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  52. }
  53. bool CanActivateCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (card.Owner.LibraryCards.Count >= 1)
  58. {
  59. return true;
  60. }
  61. }
  62. return false;
  63. }
  64. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  65. {
  66. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  67. revealCount: 3,
  68. simplifiedSelectCardConditions:
  69. new SimplifiedSelectCardConditionClass[]
  70. {
  71. new SimplifiedSelectCardConditionClass(
  72. canTargetCondition:CanSelectCardCondition,
  73. message: "Select 1 blue Digimon card.",
  74. mode: SelectCardEffect.Mode.AddHand,
  75. maxCount: 1,
  76. selectCardCoroutine: null),
  77. new SimplifiedSelectCardConditionClass(
  78. canTargetCondition:CanSelectCardCondition1,
  79. message: "Select 1 green Digimon card.",
  80. mode: SelectCardEffect.Mode.AddHand,
  81. maxCount: 1,
  82. selectCardCoroutine: null),
  83. },
  84. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  85. activateClass: activateClass,
  86. mutualConditions: true
  87. ));
  88. }
  89. }
  90. if (timing == EffectTiming.SecuritySkill)
  91. {
  92. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  93. }
  94. return cardEffects;
  95. }
  96. }