EX5_008.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. public class EX5_008 : CEntity_Effect
  4. {
  5. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  6. {
  7. List<ICardEffect> cardEffects = new List<ICardEffect>();
  8. if (timing == EffectTiming.None)
  9. {
  10. static bool PermanentCondition(Permanent targetPermanent)
  11. {
  12. if (targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.Level == 3)
  13. {
  14. if (targetPermanent.TopCard.CardTraits.Contains("Light Fang"))
  15. {
  16. return true;
  17. }
  18. if (targetPermanent.TopCard.CardTraits.Contains("LightFung"))
  19. {
  20. return true;
  21. }
  22. if (targetPermanent.TopCard.CardTraits.Contains("Night Claw"))
  23. {
  24. return true;
  25. }
  26. if (targetPermanent.TopCard.CardTraits.Contains("NightClaw"))
  27. {
  28. return true;
  29. }
  30. }
  31. return false;
  32. }
  33. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
  34. }
  35. if (timing == EffectTiming.OnEnterFieldAnyone)
  36. {
  37. ActivateClass activateClass = new ActivateClass();
  38. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  39. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  40. cardEffects.Add(activateClass);
  41. string EffectDiscription()
  42. {
  43. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with the [Light Fang] trait and 1 card with the [Night Claw]/[Galaxy] trait among them to the hand. Return the rest to the bottom of the deck.";
  44. }
  45. bool CanSelectCardCondition(CardSource cardSource)
  46. {
  47. if (cardSource.CardTraits.Contains("Light Fang"))
  48. {
  49. return true;
  50. }
  51. if (cardSource.CardTraits.Contains("LightFung"))
  52. {
  53. return true;
  54. }
  55. return false;
  56. }
  57. bool CanSelectCardCondition1(CardSource cardSource)
  58. {
  59. if (cardSource.CardTraits.Contains("Night Claw"))
  60. {
  61. return true;
  62. }
  63. if (cardSource.CardTraits.Contains("NightClaw"))
  64. {
  65. return true;
  66. }
  67. if (cardSource.CardTraits.Contains("Galaxy"))
  68. {
  69. return true;
  70. }
  71. return false;
  72. }
  73. bool CanUseCondition(Hashtable hashtable)
  74. {
  75. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  76. }
  77. bool CanActivateCondition(Hashtable hashtable)
  78. {
  79. if (CardEffectCommons.IsExistOnBattleArea(card))
  80. {
  81. if (card.Owner.LibraryCards.Count >= 1)
  82. {
  83. return true;
  84. }
  85. }
  86. return false;
  87. }
  88. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  89. {
  90. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  91. revealCount: 3,
  92. simplifiedSelectCardConditions:
  93. new SimplifiedSelectCardConditionClass[]
  94. {
  95. new SimplifiedSelectCardConditionClass(
  96. canTargetCondition:CanSelectCardCondition,
  97. message: "Select 1 card with the [Light Fang] trait.",
  98. mode: SelectCardEffect.Mode.AddHand,
  99. maxCount: 1,
  100. selectCardCoroutine: null),
  101. new SimplifiedSelectCardConditionClass(
  102. canTargetCondition:CanSelectCardCondition1,
  103. message: "Select 1 card with the [Night Claw]/[Galaxy] trait.",
  104. mode: SelectCardEffect.Mode.AddHand,
  105. maxCount: 1,
  106. selectCardCoroutine: null),
  107. },
  108. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  109. activateClass: activateClass
  110. ));
  111. }
  112. }
  113. if (timing == EffectTiming.OnEnterFieldAnyone)
  114. {
  115. ActivateClass activateClass = new ActivateClass();
  116. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  117. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  118. cardEffects.Add(activateClass);
  119. string EffectDiscription()
  120. {
  121. return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with the [Light Fang] trait and 1 card with the [Night Claw]/[Galaxy] trait among them to the hand. Return the rest to the bottom of the deck.";
  122. }
  123. bool CanSelectCardCondition(CardSource cardSource)
  124. {
  125. if (cardSource.CardTraits.Contains("Light Fang"))
  126. {
  127. return true;
  128. }
  129. if (cardSource.CardTraits.Contains("LightFung"))
  130. {
  131. return true;
  132. }
  133. return false;
  134. }
  135. bool CanSelectCardCondition1(CardSource cardSource)
  136. {
  137. if (cardSource.CardTraits.Contains("Night Claw"))
  138. {
  139. return true;
  140. }
  141. if (cardSource.CardTraits.Contains("NightClaw"))
  142. {
  143. return true;
  144. }
  145. if (cardSource.CardTraits.Contains("Galaxy"))
  146. {
  147. return true;
  148. }
  149. return false;
  150. }
  151. bool CanUseCondition(Hashtable hashtable)
  152. {
  153. return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  154. }
  155. bool CanActivateCondition(Hashtable hashtable)
  156. {
  157. if (CardEffectCommons.IsExistOnBattleArea(card))
  158. {
  159. if (card.Owner.LibraryCards.Count >= 1)
  160. {
  161. return true;
  162. }
  163. }
  164. return false;
  165. }
  166. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  167. {
  168. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  169. revealCount: 3,
  170. simplifiedSelectCardConditions:
  171. new SimplifiedSelectCardConditionClass[]
  172. {
  173. new SimplifiedSelectCardConditionClass(
  174. canTargetCondition:CanSelectCardCondition,
  175. message: "Select 1 card with the [Light Fang] trait.",
  176. mode: SelectCardEffect.Mode.AddHand,
  177. maxCount: 1,
  178. selectCardCoroutine: null),
  179. new SimplifiedSelectCardConditionClass(
  180. canTargetCondition:CanSelectCardCondition1,
  181. message: "Select 1 card with the [Night Claw]/[Galaxy] trait.",
  182. mode: SelectCardEffect.Mode.AddHand,
  183. maxCount: 1,
  184. selectCardCoroutine: null),
  185. },
  186. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  187. activateClass: activateClass
  188. ));
  189. }
  190. }
  191. if (timing == EffectTiming.None)
  192. {
  193. bool Condition()
  194. {
  195. if (CardEffectCommons.IsOwnerTurn(card))
  196. {
  197. return true;
  198. }
  199. return false;
  200. }
  201. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: +2000, isInheritedEffect: true, card: card, condition: Condition));
  202. }
  203. return cardEffects;
  204. }
  205. }