forked from External/mage
Support for copying permanent spells (WIP, do not merge) (#7084)
* added initial support for permanent tokens * [ZNR] Implemented Lithoform Engine * [ZNR] Implemented Verazol, the Split Current * permanent spell tokens no longer count as created * small change to token generation * added test, currently incomplete * found a potential solution for kicker issue, possibly too much of a hack * fixed a test failure * reversed hack changes * skipped failing tests * added more tests
This commit is contained in:
parent
f32597b164
commit
7647a3d8f0
11 changed files with 531 additions and 29 deletions
|
|
@ -19,6 +19,7 @@ public class CopyTargetSpellEffect extends OneShotEffect {
|
|||
private final boolean useController;
|
||||
private final boolean useLKI;
|
||||
private String copyThatSpellName = "that spell";
|
||||
private final boolean chooseTargets;
|
||||
|
||||
public CopyTargetSpellEffect() {
|
||||
this(false);
|
||||
|
|
@ -29,9 +30,14 @@ public class CopyTargetSpellEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
public CopyTargetSpellEffect(boolean useController, boolean useLKI) {
|
||||
this(useController, useLKI, true);
|
||||
}
|
||||
|
||||
public CopyTargetSpellEffect(boolean useController, boolean useLKI, boolean chooseTargets) {
|
||||
super(Outcome.Copy);
|
||||
this.useController = useController;
|
||||
this.useLKI = useLKI;
|
||||
this.chooseTargets = chooseTargets;
|
||||
}
|
||||
|
||||
public CopyTargetSpellEffect(final CopyTargetSpellEffect effect) {
|
||||
|
|
@ -39,6 +45,7 @@ public class CopyTargetSpellEffect extends OneShotEffect {
|
|||
this.useLKI = effect.useLKI;
|
||||
this.useController = effect.useController;
|
||||
this.copyThatSpellName = effect.copyThatSpellName;
|
||||
this.chooseTargets = effect.chooseTargets;
|
||||
}
|
||||
|
||||
public Effect withSpellName(String copyThatSpellName) {
|
||||
|
|
@ -58,7 +65,7 @@ public class CopyTargetSpellEffect extends OneShotEffect {
|
|||
spell = (Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK);
|
||||
}
|
||||
if (spell != null) {
|
||||
StackObject newStackObject = spell.createCopyOnStack(game, source, useController ? spell.getControllerId() : source.getControllerId(), true);
|
||||
StackObject newStackObject = spell.createCopyOnStack(game, source, useController ? spell.getControllerId() : source.getControllerId(), chooseTargets);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null && newStackObject instanceof Spell) {
|
||||
String activateMessage = ((Spell) newStackObject).getActivatedMessage(game);
|
||||
|
|
@ -91,8 +98,9 @@ public class CopyTargetSpellEffect extends OneShotEffect {
|
|||
} else {
|
||||
sb.append(copyThatSpellName);
|
||||
}
|
||||
sb.append(". You may choose new targets for the copy");
|
||||
|
||||
if (chooseTargets) {
|
||||
sb.append(". You may choose new targets for the copy");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue