BT16_001.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT16
  4. {
  5. public class BT16_001 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Inherit
  11. if (timing == EffectTiming.OnAllyAttack)
  12. {
  13. ActivateClass activateClass = new ActivateClass();
  14. activateClass.SetUpICardEffect("Delete opponent's Digimon with 2000 DP or less.", CanUseCondition, card);
  15. activateClass.SetIsInheritedEffect(true);
  16. activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false,
  17. EffectDiscription());
  18. activateClass.SetHashString("Delete_BT16_001");
  19. cardEffects.Add(activateClass);
  20. string EffectDiscription()
  21. {
  22. return
  23. "[When Attacking] [Once Per Turn] If this Digimon has 2 or more colors, delete 1 of your opponent's Digimon with 2000 or less DP.";
  24. }
  25. bool CanUseCondition(Hashtable hashtable)
  26. {
  27. return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
  28. }
  29. bool CanActivateCondition(Hashtable hashtable)
  30. {
  31. if (card.PermanentOfThisCard().TopCard.CardColors.Count >= 2)
  32. {
  33. return true;
  34. }
  35. return false;
  36. }
  37. bool CanSelectPermanentCondition(Permanent permanent)
  38. {
  39. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  40. {
  41. if (permanent.DP <= 2000)
  42. {
  43. return true;
  44. }
  45. }
  46. return false;
  47. }
  48. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  49. {
  50. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  51. {
  52. SelectPermanentEffect selectPermanentEffect =
  53. GManager.instance.GetComponent<SelectPermanentEffect>();
  54. selectPermanentEffect.SetUp(
  55. selectPlayer: card.Owner,
  56. canTargetCondition: CanSelectPermanentCondition,
  57. canTargetCondition_ByPreSelecetedList: null,
  58. canEndSelectCondition: null,
  59. maxCount: 1,
  60. canNoSelect: false,
  61. canEndNotMax: false,
  62. selectPermanentCoroutine: null,
  63. afterSelectPermanentCoroutine: null,
  64. mode: SelectPermanentEffect.Mode.Destroy,
  65. cardEffect: activateClass);
  66. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  67. }
  68. }
  69. }
  70. #endregion
  71. return cardEffects;
  72. }
  73. }
  74. }