mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Polymorphous Rush - Fixed that the permanent that was copied had wrongly to be chosen as the spell goes to stack instead correctly as the spell resolved.
This commit is contained in:
parent
7d30d288be
commit
6c93ba1285
1 changed files with 11 additions and 10 deletions
|
@ -60,10 +60,6 @@ public class PolymorphousRush extends CardImpl {
|
||||||
// Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first.
|
// Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first.
|
||||||
this.addAbility(new StriveAbility("{1}{U}"));
|
this.addAbility(new StriveAbility("{1}{U}"));
|
||||||
// Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn.
|
// Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn.
|
||||||
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent(""));
|
|
||||||
target.setNotTarget(true);
|
|
||||||
target.setTargetName("a creature on the battlefield (creature to copy)");
|
|
||||||
this.getSpellAbility().addTarget(target);
|
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
|
||||||
this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect());
|
this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect());
|
||||||
|
|
||||||
|
@ -99,12 +95,17 @@ class PolymorphousRushCopyEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Permanent copyFromCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent(""));
|
||||||
if (copyFromCreature != null) {
|
target.setNotTarget(true);
|
||||||
for (UUID copyToId: source.getTargets().get(1).getTargets()) {
|
target.setTargetName("a creature on the battlefield (creature to copy)");
|
||||||
Permanent copyToCreature = game.getPermanent(copyToId);
|
if (target.canChoose(source.getId(), controller.getId(), game) && controller.chooseTarget(outcome, target, source, game)) {
|
||||||
if (copyToCreature != null) {
|
Permanent copyFromCreature = game.getPermanent(target.getFirstTarget());
|
||||||
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
|
if (copyFromCreature != null) {
|
||||||
|
for (UUID copyToId: getTargetPointer().getTargets(game, source)) {
|
||||||
|
Permanent copyToCreature = game.getPermanent(copyToId);
|
||||||
|
if (copyToCreature != null) {
|
||||||
|
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue