BT20_017_token.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.Tokens
  4. {
  5. public class BT20_017_token : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Reboot
  11. if (timing == EffectTiming.None)
  12. {
  13. cardEffects.Add(CardEffectFactory.RebootSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  14. }
  15. #endregion
  16. #region Blocker
  17. if (timing == EffectTiming.None)
  18. {
  19. cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
  20. }
  21. #endregion
  22. #region Decoy
  23. if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
  24. {
  25. string DecoyDiscription()
  26. {
  27. return "<Decoy (Red)/(Black)> (When one of your other Red or Black Digimon would be deleted by an opponent's effect, you may delete this Digimon to prevent that deletion.)";
  28. }
  29. bool CanSelectDecoyPermanentCondition(Permanent permanent)
  30. {
  31. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  32. {
  33. if (permanent != card.PermanentOfThisCard())
  34. {
  35. if (permanent.TopCard.CardColors.Contains(CardColor.Red) || permanent.TopCard.CardColors.Contains(CardColor.Black))
  36. {
  37. if (permanent.willBeRemoveField)
  38. {
  39. return true;
  40. }
  41. }
  42. }
  43. }
  44. return false;
  45. }
  46. cardEffects.Add(CardEffectFactory.DecoySelfEffect(isInheritedEffect: false, card: card, condition: null, permanentCondition: CanSelectDecoyPermanentCondition, effectName: "Decoy (Red/Black)", effectDiscription: DecoyDiscription()));
  47. }
  48. #endregion
  49. return cardEffects;
  50. }
  51. }
  52. }