BT6_092.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 BT6_092 : 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, true, EffectDiscription());
  22. cardEffects.Add(activateClass);
  23. string EffectDiscription()
  24. {
  25. return "[Your Turn] When you play an [Eosmon], you may suspend this Tamer to reveal the top 3 cards of your deck. Add 1 Tamer card or 1 Digimon card with [Eosmon] in its name among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  26. }
  27. bool PermanentCondition(Permanent permanent)
  28. {
  29. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  30. {
  31. if (permanent.TopCard.CardNames.Contains("Eosmon"))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanSelectCardCondition(CardSource cardSource)
  39. {
  40. if (cardSource.IsTamer)
  41. {
  42. return true;
  43. }
  44. if (cardSource.IsDigimon)
  45. {
  46. if (cardSource.ContainsCardName("Eosmon"))
  47. {
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. bool CanUseCondition(Hashtable hashtable)
  54. {
  55. if (CardEffectCommons.IsExistOnBattleArea(card))
  56. {
  57. if (CardEffectCommons.IsOwnerTurn(card))
  58. {
  59. if (CardEffectCommons.CanTriggerOnPermanentPlay(hashtable, PermanentCondition))
  60. {
  61. return true;
  62. }
  63. }
  64. }
  65. return false;
  66. }
  67. bool CanActivateCondition(Hashtable hashtable)
  68. {
  69. if (CardEffectCommons.IsExistOnBattleArea(card))
  70. {
  71. if (CardEffectCommons.CanActivateSuspendCostEffect(card))
  72. {
  73. return true;
  74. }
  75. }
  76. return false;
  77. }
  78. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  79. {
  80. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  81. if (card.Owner.LibraryCards.Count >= 1)
  82. {
  83. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  84. revealCount: 3,
  85. simplifiedSelectCardConditions:
  86. new SimplifiedSelectCardConditionClass[]
  87. {
  88. new SimplifiedSelectCardConditionClass(
  89. canTargetCondition:CanSelectCardCondition,
  90. message: "Select 1 Tamer card or 1 Digimon card with [Eosmon] in its name.",
  91. mode: SelectCardEffect.Mode.AddHand,
  92. maxCount: 1,
  93. selectCardCoroutine: null),
  94. },
  95. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  96. activateClass: activateClass
  97. ));
  98. }
  99. }
  100. }
  101. if (timing == EffectTiming.None)
  102. {
  103. bool PermanentCondition(Permanent permanent)
  104. {
  105. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleArea(permanent, card))
  106. {
  107. if (permanent.IsTamer)
  108. {
  109. return true;
  110. }
  111. }
  112. return false;
  113. }
  114. bool CanUseCondition()
  115. {
  116. if (CardEffectCommons.IsExistOnBattleArea(card))
  117. {
  118. if (CardEffectCommons.IsOpponentTurn(card))
  119. {
  120. if (card.Owner.GetBattleAreaDigimons().Count((permanet) => permanet.TopCard.CardNames.Contains("Eosmon")) >= 1)
  121. {
  122. if (GManager.instance.turnStateMachine.gameContext.TurnPhase == GameContext.phase.Active)
  123. {
  124. return true;
  125. }
  126. }
  127. }
  128. }
  129. return false;
  130. }
  131. string effectName = "Opponent's Tamers don't unsuspend";
  132. cardEffects.Add(CardEffectFactory.CantUnsuspendStaticEffect(
  133. permanentCondition: PermanentCondition,
  134. isInheritedEffect: false,
  135. card: card, condition: CanUseCondition,
  136. effectName: effectName));
  137. }
  138. if (timing == EffectTiming.SecuritySkill)
  139. {
  140. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  141. }
  142. return cardEffects;
  143. }
  144. }