BT12_003.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace DCGO.CardEffects.BT12
  5. {
  6. public class BT12_003 : 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.SetIsInheritedEffect(true);
  17. activateClass.SetHashString("DP-1000_BT12_003");
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Your Turn][Once Per Turn] If one of your yellow or red Tamers becomes suspended, 1 of your opponent's Digimon gets -1000 DP for the turn.";
  22. }
  23. bool PermanentCondition(Permanent permanent)
  24. {
  25. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  26. {
  27. if (permanent.IsTamer)
  28. {
  29. if (permanent.TopCard.CardColors.Contains(CardColor.Red))
  30. {
  31. return true;
  32. }
  33. if (permanent.TopCard.CardColors.Contains(CardColor.Yellow))
  34. {
  35. return true;
  36. }
  37. }
  38. }
  39. return false;
  40. }
  41. bool CanSelectPermanentCondition(Permanent permanent)
  42. {
  43. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  44. }
  45. bool CanUseCondition(Hashtable hashtable)
  46. {
  47. if (CardEffectCommons.IsExistOnBattleArea(card))
  48. {
  49. if (CardEffectCommons.IsOwnerTurn(card))
  50. {
  51. if (CardEffectCommons.CanTriggerWhenPermanentSuspends(hashtable, PermanentCondition))
  52. {
  53. return true;
  54. }
  55. }
  56. }
  57. return false;
  58. }
  59. bool CanActivateCondition(Hashtable hashtable)
  60. {
  61. if (CardEffectCommons.IsExistOnBattleArea(card))
  62. {
  63. return true;
  64. }
  65. return false;
  66. }
  67. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  68. {
  69. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  70. {
  71. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  72. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  73. selectPermanentEffect.SetUp(
  74. selectPlayer: card.Owner,
  75. canTargetCondition: CanSelectPermanentCondition,
  76. canTargetCondition_ByPreSelecetedList: null,
  77. canEndSelectCondition: null,
  78. maxCount: maxCount,
  79. canNoSelect: false,
  80. canEndNotMax: false,
  81. selectPermanentCoroutine: SelectPermanentCoroutine,
  82. afterSelectPermanentCoroutine: null,
  83. mode: SelectPermanentEffect.Mode.Custom,
  84. cardEffect: activateClass);
  85. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP -1000.", "The opponent is selecting 1 Digimon that will get DP -1000.");
  86. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  87. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  88. {
  89. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -1000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  90. }
  91. }
  92. }
  93. }
  94. return cardEffects;
  95. }
  96. }
  97. }