BT24_043.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. // Tapirmon
  6. namespace DCGO.CardEffects.BT24
  7. {
  8. public class BT24_043 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Alt Digivolution Condition
  14. if (timing == EffectTiming.None)
  15. {
  16. static bool PermanentCondition(Permanent targetPermanent)
  17. {
  18. return targetPermanent.TopCard.IsLevel2
  19. && targetPermanent.TopCard.HasTSTraits;
  20. }
  21. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null));
  22. }
  23. #endregion
  24. #region On Play - Search 3
  25. if (timing == EffectTiming.OnEnterFieldAnyone)
  26. {
  27. ActivateClass activateClass = new ActivateClass();
  28. activateClass.SetUpICardEffect("Reveal 3 from deck. Add 2. Bottom deck the rest.", CanUseCondition, card);
  29. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
  30. cardEffects.Add(activateClass);
  31. string EffectDescription()
  32. {
  33. return "[On Play] Reveal the top 3 cards of your deck. Add 1 Digimon card with the [Shaman] trait or with [Beast], [Animal], or [Sovereign], other than [Sea Animal], in any of its traits and 1 card with [TS] trait among them to the hand. Return the rest to the bottom of the deck.";
  34. }
  35. bool CanUseCondition(Hashtable hashtable)
  36. {
  37. return CardEffectCommons.CanTriggerOnPlay(hashtable, card)
  38. && CardEffectCommons.IsExistOnBattleArea(card);
  39. }
  40. bool CanActivateCondition(Hashtable hashtable)
  41. {
  42. return CardEffectCommons.IsExistOnBattleArea(card);
  43. }
  44. bool CanSelectCardCondition(CardSource card)
  45. {
  46. return card.IsDigimon
  47. && (card.EqualsTraits("Shaman")
  48. || card.HasBeastTraits);
  49. }
  50. bool CanSelectCardCondition1(CardSource card)
  51. {
  52. return card.HasTSTraits;
  53. }
  54. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  55. {
  56. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.SimplifiedRevealDeckTopCardsAndSelect(
  57. revealCount: 3,
  58. simplifiedSelectCardConditions:
  59. new SimplifiedSelectCardConditionClass[]
  60. {
  61. new SimplifiedSelectCardConditionClass(
  62. canTargetCondition:CanSelectCardCondition,
  63. message: "Select 1 Digimon card with the [Shaman] trait or with [Beast], [Animal], or [Sovereign], other than [Sea Animal], in any of its traits",
  64. mode: SelectCardEffect.Mode.AddHand,
  65. maxCount: 1,
  66. selectCardCoroutine: null),
  67. new SimplifiedSelectCardConditionClass(
  68. canTargetCondition:CanSelectCardCondition1,
  69. message: "Select 1 card with the [TS] trait.",
  70. mode: SelectCardEffect.Mode.AddHand,
  71. maxCount: 1,
  72. selectCardCoroutine: null),
  73. },
  74. remainingCardsPlace: RemainingCardsPlace.DeckBottom,
  75. activateClass: activateClass
  76. ));
  77. }
  78. }
  79. #endregion
  80. #region Inherit - When Attacking
  81. if (timing == EffectTiming.OnAllyAttack)
  82. {
  83. ActivateClass activateClass = new ActivateClass();
  84. activateClass.SetUpICardEffect("Suspend 1 opponent's Digimon", CanUseCondition, card);
  85. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
  86. activateClass.SetHashString("BT24_043_Inherited");
  87. activateClass.SetIsInheritedEffect(true);
  88. cardEffects.Add(activateClass);
  89. string EffectDescription()
  90. {
  91. return "[When Attacking] [Once Per Turn] Suspend 1 of your opponent's Digimon.";
  92. }
  93. bool CanUseCondition(Hashtable hashtable)
  94. {
  95. return CardEffectCommons.CanTriggerOnAttack(hashtable, card)
  96. && CardEffectCommons.IsExistOnBattleArea(card);
  97. }
  98. bool CanActivateCondition(Hashtable hashtable)
  99. {
  100. return CardEffectCommons.IsExistOnBattleArea(card);
  101. }
  102. bool CanSelectPermanentCondition(Permanent permanent)
  103. {
  104. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  105. }
  106. IEnumerator ActivateCoroutine(Hashtable hashtable)
  107. {
  108. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  109. {
  110. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  111. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  112. selectPermanentEffect.SetUp(
  113. selectPlayer: card.Owner,
  114. canTargetCondition: CanSelectPermanentCondition,
  115. canTargetCondition_ByPreSelecetedList: null,
  116. canEndSelectCondition: null,
  117. maxCount: 1,
  118. canNoSelect: false,
  119. canEndNotMax: false,
  120. selectPermanentCoroutine: null,
  121. afterSelectPermanentCoroutine: null,
  122. mode: SelectPermanentEffect.Mode.Tap,
  123. cardEffect: activateClass);
  124. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  125. }
  126. }
  127. }
  128. #endregion
  129. return cardEffects;
  130. }
  131. }
  132. }