BT13_099.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT13
  5. {
  6. public class BT13_099 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. if (timing == EffectTiming.OnTappedAnyone)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("DP -1000", CanUseCondition, card);
  15. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  16. activateClass.SetHashString("DP-1000_BT13_099");
  17. cardEffects.Add(activateClass);
  18. string EffectDiscription()
  19. {
  20. return "[All Turns][Once Per Turn] When one of your yellow Digimon becomes suspended, 1 of your opponent's Digimon gets -1000 DP until the end of your opponent's turn.";
  21. }
  22. bool PermanentCondition(Permanent permanent)
  23. {
  24. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  25. {
  26. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  27. {
  28. return true;
  29. }
  30. }
  31. return false;
  32. }
  33. bool CanSelectPermanentCondition(Permanent permanent)
  34. {
  35. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  36. }
  37. bool CanUseCondition(Hashtable hashtable)
  38. {
  39. if (CardEffectCommons.IsExistOnBattleArea(card))
  40. {
  41. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  42. {
  43. return true;
  44. }
  45. }
  46. return false;
  47. }
  48. bool CanActivateCondition(Hashtable hashtable)
  49. {
  50. if (CardEffectCommons.IsExistOnBattleArea(card))
  51. {
  52. return true;
  53. }
  54. return false;
  55. }
  56. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  57. {
  58. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  59. {
  60. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  61. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  62. selectPermanentEffect.SetUp(
  63. selectPlayer: card.Owner,
  64. canTargetCondition: CanSelectPermanentCondition,
  65. canTargetCondition_ByPreSelecetedList: null,
  66. canEndSelectCondition: null,
  67. maxCount: maxCount,
  68. canNoSelect: false,
  69. canEndNotMax: false,
  70. selectPermanentCoroutine: SelectPermanentCoroutine,
  71. afterSelectPermanentCoroutine: null,
  72. mode: SelectPermanentEffect.Mode.Custom,
  73. cardEffect: activateClass);
  74. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -1000.", "The opponent is selecting 1 Digimon that will get DP -1000.");
  75. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  76. IEnumerator SelectPermanentCoroutine(Permanent selectedPermanent)
  77. {
  78. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: selectedPermanent, changeValue: -1000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  79. }
  80. }
  81. }
  82. }
  83. if (timing == EffectTiming.OnEndTurn)
  84. {
  85. ActivateClass activateClass = new ActivateClass();
  86. activateClass.SetUpICardEffect("This Tamer becomes Digimon", CanUseCondition, card);
  87. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDiscription());
  88. activateClass.SetHashString("BecomeDigimon_BT13_099");
  89. cardEffects.Add(activateClass);
  90. string EffectDiscription()
  91. {
  92. return "[End of Your Turn][Once Per Turn] If there're 6 or fewer total cards in both players' security stacks, until the end of your opponent's turn, this Tamer is also treated as a 3000 DP Digimon, can't digivolve, and gains <Blocker>.";
  93. }
  94. bool CanUseCondition(Hashtable hashtable)
  95. {
  96. if (CardEffectCommons.IsExistOnBattleArea(card))
  97. {
  98. if (CardEffectCommons.IsOwnerTurn(card))
  99. {
  100. return true;
  101. }
  102. }
  103. return false;
  104. }
  105. bool CanActivateCondition(Hashtable hashtable)
  106. {
  107. if (CardEffectCommons.IsExistOnBattleArea(card))
  108. {
  109. if (card.Owner.SecurityCards.Count + card.Owner.Enemy.SecurityCards.Count <= 6)
  110. {
  111. return true;
  112. }
  113. }
  114. return false;
  115. }
  116. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  117. {
  118. Permanent selectedPermanent = card.PermanentOfThisCard();
  119. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.BecomeDigimonThatCantDigivolve(targetPermanent: selectedPermanent, DP: 3000, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  120. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainBlocker(targetPermanent: selectedPermanent, effectDuration: EffectDuration.UntilOpponentTurnEnd, activateClass: activateClass));
  121. }
  122. }
  123. if (timing == EffectTiming.SecuritySkill)
  124. {
  125. cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
  126. }
  127. return cardEffects;
  128. }
  129. }
  130. }