EX8_009.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX8
  4. {
  5. public class EX8_009 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Digivolution Condition
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.EqualsCardName("Guilmon") || targetPermanent.TopCard.EqualsCardName("Gigimon");
  16. }
  17. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  18. permanentCondition: PermanentCondition,
  19. digivolutionCost: 0,
  20. ignoreDigivolutionRequirement: false,
  21. card: card, condition: null)
  22. );
  23. }
  24. #endregion
  25. #region On Play/When Digivolving Shared
  26. bool CanSelectGrowlmonGallantmonCondition(CardSource cardSource)
  27. {
  28. return cardSource.ContainsCardName("Growlmon") || cardSource.ContainsCardName("Gallantmon");
  29. }
  30. bool CanSelectXAntibodyCondition(CardSource cardSource)
  31. {
  32. return cardSource.EqualsCardName("X Antibody");
  33. }
  34. bool CanActivateOnPlayWhenDigivolvingCondition(Hashtable hashtable)
  35. {
  36. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  37. {
  38. if (card.Owner.LibraryCards.Count >= 1)
  39. {
  40. return true;
  41. }
  42. }
  43. return false;
  44. }
  45. #endregion
  46. #region On Play
  47. if (timing == EffectTiming.OnEnterFieldAnyone)
  48. {
  49. ActivateClass activateClass = new ActivateClass();
  50. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  51. activateClass.SetUpActivateClass(CanActivateOnPlayWhenDigivolvingCondition, ActivateCoroutine, -1, false, EffectDiscription());
  52. cardEffects.Add(activateClass);
  53. string EffectDiscription()
  54. {
  55. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Growlmon]/[Gallantmon] in its name and 1 [X Antibody] among them to the hand. Return the rest to the bottom of the deck.";
  56. }
  57. bool CanUseCondition(Hashtable hashtable)
  58. {
  59. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  60. }
  61. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  62. {
  63. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  64. revealCount: 3,
  65. simplifiedSelectCardConditions:
  66. new SimplifiedSelectCardConditionClass[]
  67. {
  68. new SimplifiedSelectCardConditionClass(
  69. canTargetCondition:CanSelectGrowlmonGallantmonCondition,
  70. message: "Select 1 card with [Growlmon] or [Gallantmon] in its name.",
  71. mode: SelectCardEffect.Mode.AddHand,
  72. maxCount: 1,
  73. selectCardCoroutine: null),
  74. new SimplifiedSelectCardConditionClass(
  75. canTargetCondition:CanSelectXAntibodyCondition,
  76. message:"Select 1 [X Antibody].",
  77. mode: SelectCardEffect.Mode.AddHand,
  78. maxCount: 1,
  79. selectCardCoroutine: null),
  80. },
  81. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  82. activateClass: activateClass
  83. ));
  84. }
  85. }
  86. #endregion
  87. #region When Digivolving
  88. if (timing == EffectTiming.OnEnterFieldAnyone)
  89. {
  90. ActivateClass activateClass = new ActivateClass();
  91. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  92. activateClass.SetUpActivateClass(CanActivateOnPlayWhenDigivolvingCondition, ActivateCoroutine, -1, false, EffectDiscription());
  93. cardEffects.Add(activateClass);
  94. string EffectDiscription()
  95. {
  96. return "[When Digivolving] Reveal the top 3 cards of your deck. Add 1 card with [Growlmon]/[Gallantmon] in its name and 1 [X Antibody] among them to the hand. Return the rest to the bottom of the deck.";
  97. }
  98. bool CanUseCondition(Hashtable hashtable)
  99. {
  100. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  101. {
  102. if (CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card))
  103. {
  104. return true;
  105. }
  106. }
  107. return false;
  108. }
  109. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  110. {
  111. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  112. revealCount: 3,
  113. simplifiedSelectCardConditions:
  114. new SimplifiedSelectCardConditionClass[]
  115. {
  116. new SimplifiedSelectCardConditionClass(
  117. canTargetCondition:CanSelectGrowlmonGallantmonCondition,
  118. message: "Select 1 card with [Growlmon] or [Gallantmon] in its name.",
  119. mode: SelectCardEffect.Mode.AddHand,
  120. maxCount: 1,
  121. selectCardCoroutine: null),
  122. new SimplifiedSelectCardConditionClass(
  123. canTargetCondition:CanSelectXAntibodyCondition,
  124. message:"Select 1 [X Antibody].",
  125. mode: SelectCardEffect.Mode.AddHand,
  126. maxCount: 1,
  127. selectCardCoroutine: null),
  128. },
  129. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  130. activateClass: activateClass
  131. ));
  132. }
  133. }
  134. #endregion
  135. #region Inherit
  136. if (timing == EffectTiming.OnDestroyedAnyone)
  137. {
  138. ActivateClass activateClass = new ActivateClass();
  139. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  140. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  141. activateClass.SetIsInheritedEffect(true);
  142. activateClass.SetHashString("Memory+1_EX8_009");
  143. cardEffects.Add(activateClass);
  144. string EffectDiscription()
  145. {
  146. return "[Your Turn][Once Per Turn] When any of your opponent's Digimon is deleted, gain 1 memory.";
  147. }
  148. bool PermanentCondition(Permanent permanent)
  149. {
  150. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  151. }
  152. bool CanUseCondition(Hashtable hashtable)
  153. {
  154. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  155. {
  156. if (CardEffectCommons.IsOwnerTurn(card))
  157. {
  158. if (CardEffectCommons.CanTriggerOnPermanentDeleted(hashtable, PermanentCondition, activateClass))
  159. {
  160. return true;
  161. }
  162. }
  163. }
  164. return false;
  165. }
  166. bool CanActivateCondition(Hashtable hashtable)
  167. {
  168. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  169. {
  170. return true;
  171. }
  172. return false;
  173. }
  174. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  175. {
  176. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  177. }
  178. }
  179. #endregion
  180. return cardEffects;
  181. }
  182. }
  183. }