BT23_042.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Waspmon
  5. namespace DCGO.CardEffects.BT23
  6. {
  7. public class BT23_042 : CEntity_Effect
  8. {
  9. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  10. {
  11. List<ICardEffect> cardEffects = new List<ICardEffect>();
  12. #region Alternative Digivolution Condition
  13. if (timing == EffectTiming.None)
  14. {
  15. bool PermanentCondition(Permanent targetPermanent)
  16. {
  17. return targetPermanent.TopCard.HasLevel && targetPermanent.TopCard.IsLevel3
  18. && (targetPermanent.TopCard.HasCSTraits || targetPermanent.TopCard.HasRoyalBaseTraits);
  19. }
  20. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  21. permanentCondition: PermanentCondition,
  22. digivolutionCost: 2,
  23. ignoreDigivolutionRequirement: false,
  24. card: card,
  25. condition: null)
  26. );
  27. }
  28. #endregion Alternative Digivolution Condition
  29. #region All Turns - Security
  30. if (timing == EffectTiming.None)
  31. {
  32. string EffectDiscription()
  33. {
  34. return "(Security) [All Turns] All of your [Royal Base] trait Digimon get +1000 DP.";
  35. }
  36. bool Condition()
  37. {
  38. return CardEffectCommons.IsExistInSecurity(card, false);
  39. }
  40. bool PermanentCondition(Permanent permanent)
  41. {
  42. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  43. {
  44. if (permanent.TopCard.EqualsTraits("Royal Base"))
  45. {
  46. return true;
  47. }
  48. }
  49. return false;
  50. }
  51. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  52. permanentCondition: PermanentCondition,
  53. changeValue: 1000,
  54. isInheritedEffect: false,
  55. card: card,
  56. condition: Condition,
  57. effectName: EffectDiscription));
  58. }
  59. #endregion
  60. #region When Digivolving
  61. if (timing == EffectTiming.OnEnterFieldAnyone)
  62. {
  63. ActivateClass activateClass = new ActivateClass();
  64. activateClass.SetUpICardEffect("Play 1 tamer with [Royal Base] in text", CanUseCondition, card);
  65. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
  66. cardEffects.Add(activateClass);
  67. string EffectDiscription()
  68. {
  69. return "[When Digivolving] If you have 1 or fewer Tamers, you may play 1 Tamer card with [Royal Base] in its text from your hand without paying the cost.";
  70. }
  71. bool CanUseCondition(Hashtable hashtable)
  72. {
  73. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  74. && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
  75. }
  76. bool CanActivateCondition(Hashtable hashtable)
  77. {
  78. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  79. && CardEffectCommons.OwnerHas1OrLessTamers(card);
  80. }
  81. bool CanSelectCardCondition(CardSource cardSource)
  82. {
  83. return cardSource.IsTamer
  84. && cardSource.HasText("Royal Base");
  85. }
  86. IEnumerator ActivateCoroutine(Hashtable hashtable)
  87. {
  88. if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
  89. {
  90. CardSource selectCard = null;
  91. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  92. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CanSelectCardCondition));
  93. selectHandEffect.SetUp(
  94. selectPlayer: card.Owner,
  95. canTargetCondition: CanSelectCardCondition,
  96. canTargetCondition_ByPreSelecetedList: null,
  97. canEndSelectCondition: null,
  98. maxCount: maxCount,
  99. canNoSelect: true,
  100. canEndNotMax: false,
  101. isShowOpponent: true,
  102. selectCardCoroutine: SelectCardCoroutine,
  103. afterSelectCardCoroutine: null,
  104. mode: SelectHandEffect.Mode.Custom,
  105. cardEffect: activateClass);
  106. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  107. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  108. IEnumerator SelectCardCoroutine(CardSource cardSource)
  109. {
  110. selectCard = cardSource;
  111. yield return null;
  112. }
  113. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  114. if (selectCard != null)
  115. {
  116. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  117. new List<CardSource>() { selectCard },
  118. activateClass: activateClass,
  119. payCost: false,
  120. isTapped: false,
  121. root: SelectCardEffect.Root.Hand,
  122. activateETB: true));
  123. }
  124. }
  125. }
  126. }
  127. #endregion
  128. #region ESS
  129. if (timing == EffectTiming.None)
  130. {
  131. bool Condition()
  132. {
  133. return CardEffectCommons.IsExistOnBattleArea(card);
  134. }
  135. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  136. }
  137. #endregion
  138. return cardEffects;
  139. }
  140. }
  141. }