BT24_001.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. //Gigimon
  6. namespace DCGO.CardEffects.BT24
  7. {
  8. public class BT24_001 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. #region Your Turn - ESS
  14. if (timing == EffectTiming.OnLoseSecurity)
  15. {
  16. ActivateClass activateClass = new ActivateClass();
  17. activateClass.SetUpICardEffect("Delete 1 Digimon with 3000 DP or less", CanUseCondition, card);
  18. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
  19. activateClass.SetIsInheritedEffect(true);
  20. activateClass.SetHashString("Delete_BT24_001");
  21. cardEffects.Add(activateClass);
  22. string EffectDescription()
  23. => "[Your Turn] [Once Per Turn] When your opponent's security stack is removed from, you may delete 1 of their Digimon with 3000 DP or less.";
  24. bool CanUseCondition(Hashtable hashtable)
  25. {
  26. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  27. {
  28. if (CardEffectCommons.IsOwnerTurn(card))
  29. {
  30. if (CardEffectCommons.CanTriggerWhenLoseSecurity(hashtable, player => player == card.Owner.Enemy))
  31. {
  32. return true;
  33. }
  34. }
  35. }
  36. return false;
  37. }
  38. bool CanSelectPermanentCondition(Permanent permanent)
  39. {
  40. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  41. {
  42. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(3000, activateClass))
  43. {
  44. return true;
  45. }
  46. }
  47. return false;
  48. }
  49. bool CanActivateCondition(Hashtable hashtable)
  50. {
  51. return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
  52. }
  53. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  54. {
  55. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  56. {
  57. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  58. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  59. selectPermanentEffect.SetUp(
  60. selectPlayer: card.Owner,
  61. canTargetCondition: CanSelectPermanentCondition,
  62. canTargetCondition_ByPreSelecetedList: null,
  63. canEndSelectCondition: null,
  64. maxCount: maxCount,
  65. canNoSelect: false,
  66. canEndNotMax: false,
  67. selectPermanentCoroutine: null,
  68. afterSelectPermanentCoroutine: null,
  69. mode: SelectPermanentEffect.Mode.Destroy,
  70. cardEffect: activateClass);
  71. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  72. }
  73. }
  74. }
  75. #endregion
  76. return cardEffects;
  77. }
  78. }
  79. }