Junkmon_ST19_02.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.ST19
  4. {
  5. public class Junkmon_ST19_02 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Decoy
  11. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  12. {
  13. string DecoyDescription()
  14. {
  15. return
  16. "<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.)";
  17. }
  18. bool CanSelectDecoyPermanentCondition(Permanent permanent)
  19. {
  20. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card) &&
  21. permanent != card.PermanentOfThisCard() &&
  22. permanent.TopCard.ContainsTraits("Puppet") &&
  23. permanent.willBeRemoveField;
  24. }
  25. cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null,
  26. permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy ([Puppet] trait)",
  27. effectDiscription: DecoyDescription()));
  28. }
  29. #endregion
  30. #region Barrier - ESS
  31. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  32. {
  33. cardEffects.Add(
  34. CardEffectFactory.BarrierSelfEffect(isInheritedEffect: true, card: card, condition: null));
  35. }
  36. #endregion
  37. return cardEffects;
  38. }
  39. }
  40. }