ST19_02.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. namespace DCGO.CardEffects.ST19
  3. {
  4. public class ST19_02 : CEntity_Effect
  5. {
  6. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  7. {
  8. List<ICardEffect> cardEffects = new List<ICardEffect>();
  9. #region Decoy
  10. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  11. {
  12. string DecoyDescription()
  13. {
  14. return
  15. "<Decoy ([Puppet] trait)> (When one of your other [Puppet] trait Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
  16. }
  17. bool CanSelectDecoyPermanentCondition(Permanent permanent)
  18. {
  19. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  20. permanent != card.PermanentOfThisCard() &&
  21. permanent.TopCard.ContainsTraits("Puppet") &&
  22. permanent.willBeRemoveField;
  23. }
  24. cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null,
  25. permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy ([Puppet] trait)",
  26. effectDiscription: DecoyDescription()));
  27. }
  28. #endregion
  29. #region Barrier - ESS
  30. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  31. {
  32. cardEffects.Add(
  33. CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: null));
  34. }
  35. #endregion
  36. return cardEffects;
  37. }
  38. }
  39. }