P_119.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 P_119 : 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 the top 3 cards of your deck. Add 1 red/yellow card with 2 or more colors and 1 Tamer card with [Yolei Inoue] among them to the hand. Return the rest to the bottom of the deck.";
  22. }
  23. bool CanSelectCardCondition(CardSource cardSource)
  24. {
  25. if (cardSource.CardColors.Count >= 2)
  26. {
  27. if (cardSource.HasCardColor(CardColor.Red))
  28. {
  29. return true;
  30. }
  31. if (cardSource.HasCardColor(CardColor.Yellow))
  32. {
  33. return true;
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanSelectCardCondition1(CardSource cardSource)
  39. {
  40. if (cardSource.IsTamer)
  41. {
  42. if (cardSource.ContainsCardName("Yolei Inoue"))
  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 red/yellow card with 2 or more colors.",
  74. mode: SelectCardEffect.Mode.AddHand,
  75. maxCount: 1,
  76. selectCardCoroutine: null),
  77. new SimplifiedSelectCardConditionClass(
  78. canTargetCondition:CanSelectCardCondition1,
  79. message: "Select 1 Tamer card with [Yolei Inoue].",
  80. mode: SelectCardEffect.Mode.AddHand,
  81. maxCount: 1,
  82. selectCardCoroutine: null),
  83. },
  84. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  85. activateClass: activateClass
  86. ));
  87. }
  88. }
  89. if (timing == EffectTiming.OnEndTurn)
  90. {
  91. ActivateClass activateClass = new ActivateClass();
  92. activateClass.SetUpICardEffect("DNA digivolve this Digimon", CanUseCondition, card);
  93. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  94. activateClass.SetIsInheritedEffect(true);
  95. cardEffects.Add(activateClass);
  96. string EffectDiscription()
  97. {
  98. return "[End of Your Turn] You may DNA digivolve this Digimon and one of your other Digimon in play into a Digimon card in your hand by paying its DNA digivolve cost.";
  99. }
  100. bool CanSelectCardCondition(CardSource cardSource)
  101. {
  102. if (cardSource != null)
  103. {
  104. if (cardSource.IsDigimon)
  105. {
  106. if (cardSource.Owner == card.Owner)
  107. {
  108. if (cardSource.CanPlayJogress(true))
  109. {
  110. if (isExistOnField(card))
  111. {
  112. if (cardSource.CanJogressFromTargetPermanent(card.PermanentOfThisCard(), true))
  113. {
  114. return true;
  115. }
  116. }
  117. }
  118. }
  119. }
  120. }
  121. return false;
  122. }
  123. bool CanUseCondition(Hashtable hashtable)
  124. {
  125. if (isExistOnField(card))
  126. {
  127. return true;
  128. }
  129. return false;
  130. }
  131. bool CanActivateCondition(Hashtable hashtable)
  132. {
  133. if (CardEffectCommons.IsExistOnBattleArea(card))
  134. {
  135. if (CardEffectCommons.IsOwnerTurn(card))
  136. {
  137. if (card.Owner.HandCards.Count >= 1)
  138. {
  139. if (CardEffectCommons.HasMatchConditionOwnersPermanent(card, (permanent) => permanent.IsDigimon && permanent != card.PermanentOfThisCard()))
  140. {
  141. return true;
  142. }
  143. }
  144. }
  145. }
  146. return false;
  147. }
  148. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  149. {
  150. if (isExistOnField(card))
  151. {
  152. yield return ContinuousController.instance.StartCoroutine(
  153. CardEffectCommons.DNADigivolvePermanentsIntoHandOrTrashCard(
  154. CanSelectCardCondition,
  155. payCost: true,
  156. isHand: true,
  157. activateClass,
  158. permanentConditions: new Func<Permanent, bool>[] { (permanent) => permanent == card.PermanentOfThisCard() }
  159. ));
  160. }
  161. }
  162. }
  163. return cardEffects;
  164. }
  165. }