BT6_094.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class BT6_094 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.OptionSkill)
  14. {
  15. int maxDP()
  16. {
  17. int maxDP = 6000;
  18. if (card.Owner.Enemy.GetBattleAreaDigimons().Count >= 3)
  19. {
  20. maxDP = 13000;
  21. }
  22. return maxDP;
  23. }
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  26. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  27. cardEffects.Add(activateClass);
  28. string EffectDiscription()
  29. {
  30. return "[Main] Delete 1 of your opponent's Digimon with 6000 DP or less. If your opponent has 3 or more Digimon in play, delete 1 of your opponent's Digimon with 13000 DP or less instead.";
  31. }
  32. bool CanSelectPermanentCondition(Permanent permanent)
  33. {
  34. if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
  35. {
  36. if (permanent.DP <= card.Owner.MaxDP_DeleteEffect(maxDP(), activateClass))
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. bool CanUseCondition(Hashtable hashtable)
  44. {
  45. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  46. }
  47. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  48. {
  49. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  50. {
  51. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  52. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  53. selectPermanentEffect.SetUp(
  54. selectPlayer: card.Owner,
  55. canTargetCondition: CanSelectPermanentCondition,
  56. canTargetCondition_ByPreSelecetedList: null,
  57. canEndSelectCondition: null,
  58. maxCount: maxCount,
  59. canNoSelect: false,
  60. canEndNotMax: false,
  61. selectPermanentCoroutine: null,
  62. afterSelectPermanentCoroutine: null,
  63. mode: SelectPermanentEffect.Mode.Destroy,
  64. cardEffect: activateClass);
  65. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  66. }
  67. }
  68. }
  69. if (timing == EffectTiming.SecuritySkill)
  70. {
  71. CardEffectCommons.AddActivateMainOptionSecurityEffect(card: card, cardEffects: ref cardEffects, effectName: $"Delete 1 Digimon");
  72. }
  73. return cardEffects;
  74. }
  75. }