EX4_038.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX4
  4. {
  5. public class EX4_038 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. if (timing == EffectTiming.OnEnterFieldAnyone)
  11. {
  12. ActivateClass activateClass = new ActivateClass();
  13. activateClass.SetUpICardEffect("Reveal the top 3 cards of deck", CanUseCondition, card);
  14. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  15. cardEffects.Add(activateClass);
  16. string EffectDiscription()
  17. {
  18. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with [Greymon] in its name and 1 Digimon card with [Gabumon], [Garurumon], or [Omnimon] in its name among them to your hand. Place the rest on top of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.HasGreymonName)
  23. {
  24. if (cardSource.IsDigimon)
  25. {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. bool CanSelectCardCondition1(CardSource cardSource)
  32. {
  33. if (cardSource.IsDigimon)
  34. {
  35. if (cardSource.ContainsCardName("Omnimon"))
  36. {
  37. return true;
  38. }
  39. if (cardSource.ContainsCardName("Gabumon"))
  40. {
  41. return true;
  42. }
  43. if (cardSource.HasGarurumonName)
  44. {
  45. return true;
  46. }
  47. }
  48. return false;
  49. }
  50. bool CanUseCondition(Hashtable hashtable)
  51. {
  52. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  53. }
  54. bool CanActivateCondition(Hashtable hashtable)
  55. {
  56. if (CardEffectCommons.IsExistOnBattleArea(card))
  57. {
  58. if (card.Owner.LibraryCards.Count >= 1)
  59. {
  60. return true;
  61. }
  62. }
  63. return false;
  64. }
  65. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  66. {
  67. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  68. revealCount: 3,
  69. simplifiedSelectCardConditions:
  70. new SimplifiedSelectCardConditionClass[]
  71. {
  72. new SimplifiedSelectCardConditionClass(
  73. canTargetCondition:CanSelectCardCondition,
  74. message: "Select 1 Digimon card with [Greymon] in its name.",
  75. mode: SelectCardEffect.Mode.AddHand,
  76. maxCount: 1,
  77. selectCardCoroutine: null),
  78. new SimplifiedSelectCardConditionClass(
  79. canTargetCondition:CanSelectCardCondition1,
  80. message: "Select 1 Digimon card with [Gabumon], [Garurumon], or [Omnimon] in its name.",
  81. mode: SelectCardEffect.Mode.AddHand,
  82. maxCount: 1,
  83. selectCardCoroutine: null),
  84. },
  85. remainingCardsPlace: RemainingCardsPlace.DeckTop,
  86. activateClass: activateClass,
  87. mutualConditions: true
  88. ));
  89. }
  90. }
  91. if (timing == EffectTiming.OnEnterFieldAnyone)
  92. {
  93. ActivateClass activateClass = new ActivateClass();
  94. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  95. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  96. activateClass.SetIsInheritedEffect(true);
  97. activateClass.SetHashString("Memory+1_EX4_038");
  98. cardEffects.Add(activateClass);
  99. string EffectDiscription()
  100. {
  101. return "[Your Turn][Once Per Turn] When one of your other Digimon digivolves, gain 1 memory.";
  102. }
  103. bool PermanentCondition(Permanent permanent)
  104. {
  105. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  106. {
  107. if (permanent != card.PermanentOfThisCard())
  108. {
  109. return true;
  110. }
  111. }
  112. return false;
  113. }
  114. bool CanUseCondition(Hashtable hashtable)
  115. {
  116. if (CardEffectCommons.IsExistOnBattleArea(card))
  117. {
  118. if (CardEffectCommons.IsOwnerTurn(card))
  119. {
  120. if (CardEffectCommons.CanTriggerWhenPermanentDigivolving(hashtable, PermanentCondition))
  121. {
  122. return true;
  123. }
  124. }
  125. }
  126. return false;
  127. }
  128. bool CanActivateCondition(Hashtable hashtable)
  129. {
  130. if (CardEffectCommons.IsExistOnBattleArea(card))
  131. {
  132. return true;
  133. }
  134. return false;
  135. }
  136. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  137. {
  138. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  139. }
  140. }
  141. return cardEffects;
  142. }
  143. }
  144. }