mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
* Artisan of Forms - Fixed that the copy effect did the copied creature not target.
This commit is contained in:
parent
1e3af770f0
commit
46e63861ec
2 changed files with 9 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ import mage.abilities.keyword.HeroicAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.util.functions.ApplyToPermanent;
|
import mage.util.functions.ApplyToPermanent;
|
||||||
|
|
@ -56,7 +57,7 @@ public class ArtisanOfForms extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// <i>Heroic</i> - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability.
|
// <i>Heroic</i> - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability.
|
||||||
Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent());
|
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new ArtisanOfFormsApplyToPermanent(), false);
|
||||||
effect.setText("have {this} become a copy of target creature and gain this ability");
|
effect.setText("have {this} become a copy of target creature and gain this ability");
|
||||||
this.addAbility(new HeroicAbility(effect, true));
|
this.addAbility(new HeroicAbility(effect, true));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ public class CopyPermanentEffect extends OneShotEffect {
|
||||||
private FilterPermanent filter;
|
private FilterPermanent filter;
|
||||||
private ApplyToPermanent applier;
|
private ApplyToPermanent applier;
|
||||||
private Permanent bluePrintPermanent;
|
private Permanent bluePrintPermanent;
|
||||||
|
private boolean notTarget;
|
||||||
|
|
||||||
public CopyPermanentEffect() {
|
public CopyPermanentEffect() {
|
||||||
this(new FilterCreaturePermanent());
|
this(new FilterCreaturePermanent());
|
||||||
|
|
@ -63,9 +64,13 @@ public class CopyPermanentEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier) {
|
public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier) {
|
||||||
|
this(filter, applier, true);
|
||||||
|
}
|
||||||
|
public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier, boolean notTarget) {
|
||||||
super(Outcome.Copy);
|
super(Outcome.Copy);
|
||||||
this.applier = applier;
|
this.applier = applier;
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
|
this.notTarget = notTarget;
|
||||||
this.staticText = "You may have {this} enter the battlefield as a copy of any " + filter.getMessage() + " on the battlefield";
|
this.staticText = "You may have {this} enter the battlefield as a copy of any " + filter.getMessage() + " on the battlefield";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,6 +79,7 @@ public class CopyPermanentEffect extends OneShotEffect {
|
||||||
this.filter = effect.filter.copy();
|
this.filter = effect.filter.copy();
|
||||||
this.applier = effect.applier;
|
this.applier = effect.applier;
|
||||||
this.bluePrintPermanent = effect.bluePrintPermanent;
|
this.bluePrintPermanent = effect.bluePrintPermanent;
|
||||||
|
this.notTarget = effect.notTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,7 +88,7 @@ public class CopyPermanentEffect extends OneShotEffect {
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
if (player != null && sourcePermanent != null) {
|
if (player != null && sourcePermanent != null) {
|
||||||
Target target = new TargetPermanent(filter);
|
Target target = new TargetPermanent(filter);
|
||||||
target.setNotTarget(true);
|
target.setNotTarget(notTarget);
|
||||||
if (target.canChoose(source.getControllerId(), game)) {
|
if (target.canChoose(source.getControllerId(), game)) {
|
||||||
player.choose(Outcome.Copy, target, source.getSourceId(), game);
|
player.choose(Outcome.Copy, target, source.getSourceId(), game);
|
||||||
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
|
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue