ST19_15.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST19
  4. {
  5. public class ST19_15 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Main Effect
  11. if (timing == EffectTiming.OptionSkill)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  15. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
  16. cardEffects.Add(activateClass);
  17. string EffectDescription()
  18. {
  19. return
  20. "[Main] 1 of your opponent's Digimon gets -6000 DP for the turn. If there are 3 or more Digimon, increase the DP reduction of this effect by -6000.";
  21. }
  22. bool CanUseCondition(Hashtable hashtable)
  23. {
  24. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  25. }
  26. bool CanSelectPermanentCondition(Permanent permanent)
  27. {
  28. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
  29. }
  30. int GetDPReduceValue()
  31. {
  32. int reduceValue = -6000;
  33. if (card.Owner.GetBattleAreaDigimons().Count + card.Owner.Enemy.GetBattleAreaDigimons().Count >= 3)
  34. reduceValue += -6000;
  35. return reduceValue;
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable hashtable)
  38. {
  39. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  40. {
  41. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  42. selectPermanentEffect.SetUp(
  43. selectPlayer: card.Owner,
  44. canTargetCondition: CanSelectPermanentCondition,
  45. canTargetCondition_ByPreSelecetedList: null,
  46. canEndSelectCondition: null,
  47. maxCount: 1,
  48. canNoSelect: false,
  49. canEndNotMax: false,
  50. selectPermanentCoroutine: SelectPermanentCoroutine,
  51. afterSelectPermanentCoroutine: null,
  52. mode: SelectPermanentEffect.Mode.Custom,
  53. cardEffect: activateClass);
  54. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  55. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  56. {
  57. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
  58. targetPermanent: permanent,
  59. changeValue: GetDPReduceValue(),
  60. effectDuration: EffectDuration.UntilEachTurnEnd,
  61. activateClass: activateClass));
  62. }
  63. }
  64. }
  65. }
  66. #endregion
  67. #region Security Effect
  68. if (timing == EffectTiming.SecuritySkill)
  69. {
  70. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects,
  71. effectName:
  72. $"1 of your opponent's Digimon gets -6000 DP for the turn. If there are 3 or more Digimon, increase the DP reduction of this effect by -6000.");
  73. }
  74. #endregion
  75. return cardEffects;
  76. }
  77. }
  78. }