BT16_052_token.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.Generic;
  2. namespace DCGO.CardEffects.Tokens
  3. {
  4. public class BT16_052_token : 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 DecoyDiscription()
  13. {
  14. return "<Decoy (Black)> (When one of your other Black Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
  15. }
  16. bool CanSelectDecoyPermanentCondition(Permanent permanent)
  17. {
  18. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  19. {
  20. if (permanent != card.PermanentOfThisCard())
  21. {
  22. if (permanent.TopCard.CardColors.Contains(CardColor.Black))
  23. {
  24. if (permanent.willBeRemoveField)
  25. {
  26. return true;
  27. }
  28. }
  29. }
  30. }
  31. return false;
  32. }
  33. cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy ([Black])", effectDiscription: DecoyDiscription()));
  34. }
  35. #endregion
  36. if (timing == EffectTiming.None)
  37. {
  38. bool Condition()
  39. {
  40. return CardEffectCommons.IsOwnerTurn(card);
  41. }
  42. cardEffects.Add(CardEffectFactory.CanNotAttackSelfStaticEffect(defenderCondition: null, isInheritedEffect: false, card: card, condition: Condition, effectName: "Can't Attack"));
  43. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(false, card, null));
  44. }
  45. return cardEffects;
  46. }
  47. }
  48. }