@Override public BecomesColorTargetEffect copy() { return new BecomesColorTargetEffect(this); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } if (setColor != null) { boolean objectFound = false; for (UUID targetId : targetPointer.getTargets(game, source)) { MageObject targetObject = game.getObject(targetId); if (targetObject != null) { if (targetObject instanceof Spell || targetObject instanceof Permanent) { objectFound = true; targetObject.getColor(game).setColor(setColor); } else { objectFound = false; } } } if (!objectFound && this.getDuration() == Duration.Custom) { this.discard(); } return true; } else { throw new UnsupportedOperationException("No color set"); } }
@Override public void init(Ability source, Game game) { super.init(source, game); List<Permanent> targets = new ArrayList<>(game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)); this.setTargetPointer(new FixedTargets(targets, game)); }
@Override public void init(Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return; } if (setColor == null) { ChoiceColor choice = new ChoiceColor(); if (!controller.choose(Outcome.PutManaInPool, choice, game)) { discard(); return; } setColor = choice.getColor(); if (!game.isSimulation()) { game.informPlayers(controller.getLogName() + " has chosen the color: " + setColor.toString()); } } super.init(source, game); //To change body of generated methods, choose Tools | Templates. }
public AlchorsTomb(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); // {2}, {tap}: Target permanent you control becomes the color of your choice. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.WhileOnBattlefield), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetControlledPermanent()); this.addAbility(ability); }
public Chaoslace(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}"); // Target spell or permanent becomes red. this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.RED, Duration.Custom)); }
public BlindSeer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN, SubType.WIZARD); this.power = new MageInt(3); this.toughness = new MageInt(3); // {1}{U}: Target spell or permanent becomes the color of your choice until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetSpellOrPermanent()); this.addAbility(ability); }
public Lifelace(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); // Target spell or permanent becomes green. this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.Custom)); }
public Deathlace(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); // Target spell or permanent becomes black. this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.Custom)); }
public Thoughtlace(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Target spell or permanent becomes blue. this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLUE, Duration.Custom)); }
public Purelace(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); // Target spell or permanent becomes white. this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.Custom)); }
public VodalianMystic(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // {T}: Target instant or sorcery spell becomes the color of your choice. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.WhileOnStack), new TapSourceCost()); ability.addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY)); this.addAbility(ability); }
public TidalVisionary(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}"); this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // {T}: Target creature becomes the color of your choice until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public AuroraGriffin(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); this.subtype.add(SubType.GRIFFIN); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // {W}: Target permanent becomes white until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn), new ManaCostsImpl("{W}")); ability.addTarget(new TargetPermanent()); this.addAbility(ability); }
public ErsatzGnomes(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.subtype.add(SubType.GNOME); this.power = new MageInt(1); this.toughness = new MageInt(1); // {T}: Target spell becomes colorless. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(new ObjectColor(), Duration.Custom), new TapSourceCost()); ability.addTarget(new TargetSpell()); this.addAbility(ability); // {T}: Target permanent becomes colorless until end of turn. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(new ObjectColor(), Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetPermanent()); this.addAbility(ability); }
public HeavensGate(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Any number of target creatures become white until end of turn. Effect effect = new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn); effect.setText("Any number of target creatures become white until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); }
public AislingLeprechaun(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}"); this.subtype.add(SubType.FAERIE); this.power = new MageInt(1); this.toughness = new MageInt(1); // Whenever Aisling Leprechaun blocks or becomes blocked by a creature, that creature becomes green. Effect effect = new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.EndOfGame); effect.setText("that creature becomes green"); Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false); this.addAbility(ability); }
public SylvanParadise(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); // Any number of target creatures become green until end of turn. Effect effect = new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.EndOfTurn); effect.setText("Any number of target creatures become green until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); }
public SeaKingsBlessing(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Any number of target creatures become blue until end of turn. Effect effect = new BecomesColorTargetEffect(ObjectColor.BLUE, Duration.EndOfTurn); effect.setText("Any number of target creatures become blue until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); }
public TouchOfDarkness(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // Any number of target creatures become black until end of turn. Effect effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn); effect.setText("Any number of target creatures become black until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); }