Implemented Skyclave Relic

This commit is contained in:
Evan Kranzler 2020-09-07 21:20:57 -04:00
parent 0c61973772
commit ce4073d810
3 changed files with 66 additions and 6 deletions

View file

@ -13,31 +13,40 @@ import mage.target.targetpointer.FixedTarget;
public class CreateTokenCopySourceEffect extends OneShotEffect {
private final int number;
private final boolean tapped;
public CreateTokenCopySourceEffect() {
this(1);
}
public CreateTokenCopySourceEffect(int copies) {
this(copies, false);
}
public CreateTokenCopySourceEffect(int copies, boolean tapped) {
super(Outcome.PutCreatureInPlay);
this.number = copies;
staticText = "create a token that's a copy of {this}";
this.tapped = tapped;
staticText = "create a " + (tapped ? "tapped " : "") + "token that's a copy of {this}";
}
public CreateTokenCopySourceEffect(final CreateTokenCopySourceEffect effect) {
super(effect);
this.number = effect.number;
this.tapped = effect.tapped;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent != null) {
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, false, number);
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
return effect.apply(game, source);
if (permanent == null) {
return false;
}
return false;
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(
source.getControllerId(), null, false, number, tapped, false
);
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
return effect.apply(game, source);
}
@Override