BT23_038.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // FunBeemon
  4. namespace DCGO.CardEffects.BT23
  5. {
  6. public class BT23_038 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternative Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.IsLevel2
  17. && (targetPermanent.TopCard.HasCSTraits || targetPermanent.TopCard.HasRoyalBaseTraits);
  18. }
  19. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  20. permanentCondition: PermanentCondition,
  21. digivolutionCost: 0,
  22. ignoreDigivolutionRequirement: false,
  23. card: card,
  24. condition: null)
  25. );
  26. }
  27. #endregion Alternative Digivolution Condition
  28. #region All Turns - Security
  29. if (timing == EffectTiming.None)
  30. {
  31. string EffectDiscription()
  32. {
  33. return "(Security) [All Turns] All of your [Royal Base] trait Digimon get +1000 DP.";
  34. }
  35. bool Condition()
  36. {
  37. return CardEffectCommons.IsExistInSecurity(card, false);
  38. }
  39. bool PermanentCondition(Permanent permanent)
  40. {
  41. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  42. {
  43. if (permanent.TopCard.EqualsTraits("Royal Base"))
  44. {
  45. return true;
  46. }
  47. }
  48. return false;
  49. }
  50. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  51. permanentCondition: PermanentCondition,
  52. changeValue: 1000,
  53. isInheritedEffect: false,
  54. card: card,
  55. condition: Condition,
  56. effectName: EffectDiscription));
  57. }
  58. #endregion
  59. #region On Play
  60. if (timing == EffectTiming.OnEnterFieldAnyone)
  61. {
  62. ActivateClass activateClass = new ActivateClass();
  63. activateClass.SetUpICardEffect("Reveal top 3", CanUseCondition, card);
  64. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  65. cardEffects.Add(activateClass);
  66. string EffectDiscription()
  67. {
  68. return "[On Play] Reveal the top 3 cards of your deck. Add 1 card with [Royal Base] in its text and 1 card with the [CS] trait among them to the hand. Return the rest to the bottom of the deck.";
  69. }
  70. bool CanUseCondition(Hashtable hashtable)
  71. {
  72. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  73. && CardEffectCommons.CanTriggerOnPlay(hashtable, card);
  74. }
  75. bool CanActivateCondition(Hashtable hashtable)
  76. {
  77. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  78. }
  79. bool CanSelectCardCondition(CardSource cardSource)
  80. {
  81. return cardSource.HasText("Royal Base");
  82. }
  83. bool CanSelectCardCondition1(CardSource cardSource)
  84. {
  85. return cardSource.HasCSTraits;
  86. }
  87. IEnumerator ActivateCoroutine(Hashtable hashtable)
  88. {
  89. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  90. revealCount: 3,
  91. simplifiedSelectCardConditions:
  92. new SimplifiedSelectCardConditionClass[]
  93. {
  94. new SimplifiedSelectCardConditionClass(
  95. canTargetCondition:CanSelectCardCondition,
  96. message: "Select 1 card with [Royal Base] in text.",
  97. mode: SelectCardEffect.Mode.AddHand,
  98. maxCount: 1,
  99. selectCardCoroutine: null),
  100. new SimplifiedSelectCardConditionClass(
  101. canTargetCondition:CanSelectCardCondition1,
  102. message: "Select 1 card with [CS] trait.",
  103. mode: SelectCardEffect.Mode.AddHand,
  104. maxCount: 1,
  105. selectCardCoroutine: null),
  106. },
  107. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  108. activateClass: activateClass
  109. ));
  110. }
  111. }
  112. #endregion
  113. #region ESS
  114. if (timing == EffectTiming.None)
  115. {
  116. bool Condition()
  117. {
  118. return CardEffectCommons.IsExistOnBattleArea(card);
  119. }
  120. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  121. }
  122. #endregion
  123. return cardEffects;
  124. }
  125. }
  126. }