BT21_012.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. //Flamemon
  4. namespace DCGO.CardEffects.BT21
  5. {
  6. public class BT21_012 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Main
  12. if (timing == EffectTiming.OnDeclaration)
  13. {
  14. ActivateClass activateClass = new ActivateClass();
  15. activateClass.SetUpICardEffect("Suspend this digimon, play 1 red tamer with inherit effects", CanUseCondition, card);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. => "[Main] By suspending this Digimon, you may play 1 red Tamer card with inherited effects from your hand without paying the cost. If you did, place this Digimon under the played Tamer.";
  20. bool CanUseCondition(Hashtable hashtable)
  21. {
  22. return CardEffectCommons.IsExistOnBattleArea(card) &&
  23. CardEffectCommons.CanActivateSuspendCostEffect(card);
  24. }
  25. bool CanActivateCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.IsExistOnBattleArea(card) &&
  28. CardEffectCommons.IsOwnerTurn(card);
  29. }
  30. bool CanSelectCardCondition(CardSource cardSource)
  31. {
  32. if (CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass))
  33. {
  34. if (cardSource.IsTamer)
  35. {
  36. if (cardSource.HasCardColor(CardColor.Red))
  37. {
  38. if (cardSource.HasInheritedEffect)
  39. {
  40. return true;
  41. }
  42. }
  43. }
  44. }
  45. return false;
  46. }
  47. IEnumerator ActivateCoroutine(Hashtable hashtable)
  48. {
  49. yield return ContinuousController.instance.StartCoroutine(new SuspendPermanentsClass(new List<Permanent>() { card.PermanentOfThisCard() }, CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
  50. if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition))
  51. {
  52. CardSource selectedCard = null;
  53. bool tamerPlayed = false;
  54. SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
  55. selectHandEffect.SetUp(
  56. selectPlayer: card.Owner,
  57. canTargetCondition: CanSelectCardCondition,
  58. canTargetCondition_ByPreSelecetedList: null,
  59. canEndSelectCondition: null,
  60. maxCount: 1,
  61. canNoSelect: true,
  62. canEndNotMax: false,
  63. isShowOpponent: true,
  64. selectCardCoroutine: SelectCardCoroutine,
  65. afterSelectCardCoroutine: null,
  66. mode: SelectHandEffect.Mode.Custom,
  67. cardEffect: activateClass);
  68. selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
  69. selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
  70. yield return StartCoroutine(selectHandEffect.Activate());
  71. IEnumerator SelectCardCoroutine(CardSource cardSource)
  72. {
  73. selectedCard = cardSource;
  74. yield return null;
  75. }
  76. if (selectedCard != null)
  77. {
  78. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(cardSources: new List<CardSource>() { selectedCard }, activateClass: activateClass, payCost: false, isTapped: false, root: SelectCardEffect.Root.Hand, activateETB: true));
  79. tamerPlayed = true;
  80. }
  81. if (tamerPlayed)
  82. {
  83. yield return ContinuousController.instance.StartCoroutine(selectedCard.PermanentOfThisCard().AddDigivolutionCardsBottom(new List<CardSource>() { card }, activateClass));
  84. }
  85. }
  86. }
  87. }
  88. #endregion
  89. #region ESS
  90. if (timing == EffectTiming.None)
  91. {
  92. bool Condition()
  93. {
  94. if (CardEffectCommons.IsOwnerTurn(card))
  95. {
  96. return true;
  97. }
  98. return false;
  99. }
  100. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  101. }
  102. #endregion
  103. return cardEffects;
  104. }
  105. }
  106. }