EX12_011.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Seasarmon
  4. namespace DCGO.CardEffects.EX12
  5. {
  6. public class EX12_011 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternate Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.EqualsTraits("Shambala");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null, level: 3));
  19. }
  20. #endregion
  21. #region Raid
  22. if (timing == EffectTiming.OnAllyAttack)
  23. {
  24. cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
  25. }
  26. #endregion
  27. #region OP/WD Shared
  28. string SharedEffectName = "Delete 1 enemy Digimon with 5K DP or less.";
  29. CardEffectFactory.ActivateClassesForSharedEffects
  30. (ref cardEffects, timing, card,
  31. SharedEffectName,
  32. SharedActivateCoroutine,
  33. SharedEffectDescription,
  34. optional: false,
  35. onPlay: true,
  36. whenDigivolving: true);
  37. string SharedEffectDescription(string tag) => $"[{tag}] Delete 1 of your opponent's Digimon with 5000 DP or less.";
  38. IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
  39. {
  40. bool CanSelectPermanentCondition(Permanent permanent)
  41. {
  42. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card)
  43. && permanent.HasDP
  44. && permanent.DP <= card.Owner.MaxDP_DeleteEffect(5000, activateClass);
  45. }
  46. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  47. {
  48. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  49. selectPermanentEffect.SetUp(
  50. selectPlayer: card.Owner,
  51. canTargetCondition: CanSelectPermanentCondition,
  52. canTargetCondition_ByPreSelecetedList: null,
  53. canEndSelectCondition: null,
  54. maxCount: 1,
  55. canNoSelect: false,
  56. canEndNotMax: false,
  57. selectPermanentCoroutine: null,
  58. afterSelectPermanentCoroutine: null,
  59. mode: SelectPermanentEffect.Mode.Destroy,
  60. cardEffect: activateClass);
  61. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "Opponent is select 1 digimon to delete.");
  62. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  63. }
  64. }
  65. #endregion
  66. #region Inherit
  67. if (timing == EffectTiming.None)
  68. {
  69. bool Condition()
  70. {
  71. return CardEffectCommons.IsExistOnBattleAreaDigimon(card)
  72. && CardEffectCommons.IsOwnerTurn(card);
  73. }
  74. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(
  75. changeValue: 2000,
  76. isInheritedEffect: true,
  77. card: card,
  78. condition: Condition));
  79. }
  80. #endregion
  81. return cardEffects;
  82. }
  83. }
  84. }