BT23_018.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. // Garurumon
  5. namespace DCGO.CardEffects.BT23
  6. {
  7. public class BT23_018 : 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.HasCSTraits || targetPermanent.TopCard.ContainsCardName("Gabumon")
  18. && targetPermanent.TopCard.HasLevel
  19. && targetPermanent.TopCard.IsLevel3;
  20. }
  21. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  22. permanentCondition: PermanentCondition,
  23. digivolutionCost: 2,
  24. ignoreDigivolutionRequirement: false,
  25. card: card,
  26. condition: null)
  27. );
  28. }
  29. #endregion
  30. #region Jamming
  31. if (timing == EffectTiming.None)
  32. {
  33. cardEffects.Add(CardEffectFactory.JammingSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  34. }
  35. #endregion
  36. #region Main - OPT
  37. if (timing == EffectTiming.OnDeclaration)
  38. {
  39. ActivateClass activateClass = new ActivateClass();
  40. activateClass.SetUpICardEffect("By placing this card as bottom digivolution card, play 1 [Agumon]/[Nokia Shiramine] from hand for 2 reduce cost", CanUseCondition, card);
  41. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
  42. activateClass.SetHashString("BT23_018_Main");
  43. cardEffects.Add(activateClass);
  44. string EffectDiscription()
  45. {
  46. return "[Main] [Once Per Turn] By placing this Digimon's top stacked card as its bottom digivolution card, you may play 1 [Agumon] or [Nokia Shiramine] from your hand with the play cost reduced by 2.";
  47. }
  48. bool CanUseCondition(Hashtable hashtable)
  49. {
  50. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  51. }
  52. bool CanActivateCondition(Hashtable hashtable)
  53. {
  54. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  55. && CardEffectCommons.IsOwnerTurn(card)
  56. && card.PermanentOfThisCard().StackCards.Count >= 1;
  57. }
  58. bool CanSelectCardCondition(CardSource cardSource)
  59. {
  60. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource, true, activateClass))
  61. {
  62. if (cardSource.IsDigimon && cardSource.EqualsCardName("Agumon")) return true;
  63. if (cardSource.IsTamer && cardSource.EqualsCardName("Nokia Shiramine")) return true;
  64. }
  65. return false;
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  68. {
  69. if (CardEffectCommons.IsExistOnBattleArea(card) && card.PermanentOfThisCard().StackCards.Count >= 1)
  70. {
  71. CardSource topCard = card.PermanentOfThisCard().TopCard;
  72. yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard().AddDigivolutionCardsBottom(
  73. new List<CardSource>() { topCard },
  74. activateClass));
  75. if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
  76. {
  77. CardSource selectCard = null;
  78. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  79. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionOwnersCardCountInHand(card, CanSelectCardCondition));
  80. selectHandEffect.SetUp(
  81. selectPlayer: card.Owner,
  82. canTargetCondition: CanSelectCardCondition,
  83. canTargetCondition_ByPreSelecetedList: null,
  84. canEndSelectCondition: null,
  85. maxCount: maxCount,
  86. canNoSelect: true,
  87. canEndNotMax: false,
  88. isShowOpponent: true,
  89. selectCardCoroutine: SelectCardCoroutine,
  90. afterSelectCardCoroutine: null,
  91. mode: SelectHandEffect.Mode.Custom,
  92. cardEffect: activateClass);
  93. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  94. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  95. IEnumerator SelectCardCoroutine(CardSource cardSource)
  96. {
  97. selectCard = cardSource;
  98. yield return null;
  99. }
  100. yield return ContinuousController.instance.StartCoroutine(selectHandEffect.Activate());
  101. if (selectCard != null)
  102. {
  103. int cost = selectCard.BasePlayCostFromEntity - 2;
  104. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
  105. new List<CardSource>() { selectCard },
  106. activateClass: activateClass,
  107. payCost: true,
  108. isTapped: false,
  109. root: SelectCardEffect.Root.Hand,
  110. activateETB: true,
  111. fixedCost: cost));
  112. }
  113. }
  114. }
  115. }
  116. }
  117. #endregion
  118. #region ESS
  119. if (timing == EffectTiming.None)
  120. {
  121. bool Condition()
  122. {
  123. return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOpponentTurn(card);
  124. }
  125. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  126. }
  127. #endregion
  128. return cardEffects;
  129. }
  130. }
  131. }