EX3_048.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.EX3
  4. {
  5. public class EX3_048 : 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 Digimon card with [Rock Dragon], [Earth Dragon], [Bird Dragon], [Machine Dragon] or [Sky Dragon] in its traits and 1 [Hina Kurihara] among them to your hand. Place the rest at the bottom of your deck in any order.";
  19. }
  20. bool CanSelectCardCondition(CardSource cardSource)
  21. {
  22. if (cardSource.IsDigimon)
  23. {
  24. if (cardSource.CardTraits.Contains("Rock Dragon"))
  25. {
  26. return true;
  27. }
  28. if (cardSource.CardTraits.Contains("RockDragon"))
  29. {
  30. return true;
  31. }
  32. if (cardSource.CardTraits.Contains("Earth Dragon"))
  33. {
  34. return true;
  35. }
  36. if (cardSource.CardTraits.Contains("EarthDragon"))
  37. {
  38. return true;
  39. }
  40. if (cardSource.CardTraits.Contains("Bird Dragon"))
  41. {
  42. return true;
  43. }
  44. if (cardSource.CardTraits.Contains("BirdDragon"))
  45. {
  46. return true;
  47. }
  48. if (cardSource.CardTraits.Contains("Machine Dragon"))
  49. {
  50. return true;
  51. }
  52. if (cardSource.CardTraits.Contains("MachineDragon"))
  53. {
  54. return true;
  55. }
  56. if (cardSource.CardTraits.Contains("Sky Dragon"))
  57. {
  58. return true;
  59. }
  60. if (cardSource.CardTraits.Contains("SkyDragon"))
  61. {
  62. return true;
  63. }
  64. }
  65. return false;
  66. }
  67. bool CanSelectCardCondition1(CardSource cardSource)
  68. {
  69. if (cardSource.CardNames.Contains("Hina Kurihara"))
  70. {
  71. return true;
  72. }
  73. if (cardSource.CardNames.Contains("HinaKurihara"))
  74. {
  75. return true;
  76. }
  77. return false;
  78. }
  79. bool CanUseCondition(Hashtable hashtable)
  80. {
  81. return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  82. }
  83. bool CanActivateCondition(Hashtable hashtable)
  84. {
  85. if (CardEffectCommons.IsExistOnBattleArea(card))
  86. {
  87. if (card.Owner.LibraryCards.Count >= 1)
  88. {
  89. return true;
  90. }
  91. }
  92. return false;
  93. }
  94. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  95. {
  96. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  97. revealCount: 4,
  98. simplifiedSelectCardConditions:
  99. new SimplifiedSelectCardConditionClass[]
  100. {
  101. new SimplifiedSelectCardConditionClass(
  102. canTargetCondition:CanSelectCardCondition,
  103. message: "Select 1 Digimon card with [Rock Dragon], [Earth Dragon], [Bird Dragon], [Machine Dragon] or [Sky Dragon] in its traits.",
  104. mode: SelectCardEffect.Mode.AddHand,
  105. maxCount: 1,
  106. selectCardCoroutine: null),
  107. new SimplifiedSelectCardConditionClass(
  108. canTargetCondition:CanSelectCardCondition1,
  109. message: "Select 1 [Hina Kurihara].",
  110. mode: SelectCardEffect.Mode.AddHand,
  111. maxCount: 1,
  112. selectCardCoroutine: null),
  113. },
  114. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  115. activateClass: activateClass,
  116. mutualConditions: true
  117. ));
  118. }
  119. }
  120. if (timing == EffectTiming.None)
  121. {
  122. bool Condition()
  123. {
  124. if (CardEffectCommons.IsExistOnBattleArea(card))
  125. {
  126. if (card.PermanentOfThisCard().TopCard.HasOnPlayEffect)
  127. {
  128. return true;
  129. }
  130. }
  131. return false;
  132. }
  133. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  134. }
  135. return cardEffects;
  136. }
  137. }
  138. }