mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Implemented Skyclave Relic
This commit is contained in:
parent
0c61973772
commit
ce4073d810
3 changed files with 66 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue