EX2_019.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX2
  4. {
  5. public class EX2_019 : 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 4 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 4 cards of your deck. Add 1 card with [Kyubimon], [Taomon], or [Sakuyamon] in its name and 1 [Rika Nonaka] among them to your hand. Place the remaining cards at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.ContainsCardName("Kyubimon"))
  23. {
  24. return true;
  25. }
  26. if (cardSource.ContainsCardName("Taomon"))
  27. {
  28. return true;
  29. }
  30. if (cardSource.ContainsCardName("Sakuyamon"))
  31. {
  32. return true;
  33. }
  34. return false;
  35. }
  36. bool CanSelectCardCondition1(CardSource cardSource)
  37. {
  38. if (cardSource.CardNames.Contains("Rika Nonaka"))
  39. {
  40. return true;
  41. }
  42. if (cardSource.CardNames.Contains("RikaNonaka"))
  43. {
  44. return true;
  45. }
  46. return false;
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  51. }
  52. bool CanActivateCondition(Hashtable hashtable)
  53. {
  54. if (CardEffectCommons.IsExistOnBattleArea(card))
  55. {
  56. if (card.Owner.LibraryCards.Count >= 1)
  57. {
  58. return true;
  59. }
  60. }
  61. return false;
  62. }
  63. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  64. {
  65. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  66. revealCount: 4,
  67. simplifiedSelectCardConditions:
  68. new SimplifiedSelectCardConditionClass[]
  69. {
  70. new SimplifiedSelectCardConditionClass(
  71. canTargetCondition:CanSelectCardCondition,
  72. message: "Select 1 card with [Kyubimon], [Taomon], or [Sakuyamon] in its name.",
  73. mode: SelectCardEffect.Mode.AddHand,
  74. maxCount: 1,
  75. selectCardCoroutine: null),
  76. new SimplifiedSelectCardConditionClass(
  77. canTargetCondition:CanSelectCardCondition1,
  78. message: "Select 1 [Rika Nonaka].",
  79. mode: SelectCardEffect.Mode.AddHand,
  80. maxCount: 1,
  81. selectCardCoroutine: null),
  82. },
  83. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  84. activateClass: activateClass,
  85. mutualConditions: true
  86. ));
  87. }
  88. }
  89. if (timing == EffectTiming.OnUseOption)
  90. {
  91. ActivateClass activateClass = new ActivateClass();
  92. activateClass.SetUpICardEffect("Memory +1", CanUseCondition, card);
  93. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  94. activateClass.SetIsInheritedEffect(true);
  95. activateClass.SetHashString("Memory+1_EX2_019");
  96. cardEffects.Add(activateClass);
  97. string EffectDiscription()
  98. {
  99. return "[Your Turn][Once Per Turn] When you use an Option card with a cost of 2 or more, gain 1 memory.";
  100. }
  101. bool CanUseCondition(Hashtable hashtable)
  102. {
  103. if (CardEffectCommons.IsExistOnBattleArea(card))
  104. {
  105. if (CardEffectCommons.IsOwnerTurn(card))
  106. {
  107. if (CardEffectCommons.CanTriggerWhenOwnerUseOption(hashtable, null, (cost) => cost >= 2, card))
  108. {
  109. return true;
  110. }
  111. }
  112. }
  113. return false;
  114. }
  115. bool CanActivateCondition(Hashtable hashtable)
  116. {
  117. if (CardEffectCommons.IsExistOnBattleArea(card))
  118. {
  119. return true;
  120. }
  121. return false;
  122. }
  123. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  124. {
  125. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
  126. }
  127. }
  128. return cardEffects;
  129. }
  130. }
  131. }