mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
* Clutch of Currents - Fixed wrong target handling.
This commit is contained in:
parent
5582db0332
commit
52d8fce569
5 changed files with 39 additions and 7 deletions
|
|
@ -40,7 +40,6 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.targetpointer.FirstTargetPointer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -49,19 +48,26 @@ import mage.util.CardUtil;
|
|||
public class ReturnToHandTargetEffect extends OneShotEffect {
|
||||
|
||||
boolean withName;
|
||||
protected boolean multitargetHandling;
|
||||
|
||||
public ReturnToHandTargetEffect() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public ReturnToHandTargetEffect(boolean withName) {
|
||||
this(withName, false);
|
||||
}
|
||||
|
||||
public ReturnToHandTargetEffect(boolean withName, boolean multitargetHandling) {
|
||||
super(Outcome.ReturnToHand);
|
||||
this.withName = withName;
|
||||
this.multitargetHandling = multitargetHandling;
|
||||
}
|
||||
|
||||
public ReturnToHandTargetEffect(final ReturnToHandTargetEffect effect) {
|
||||
super(effect);
|
||||
this.withName = effect.withName;
|
||||
this.multitargetHandling = effect.multitargetHandling;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -76,7 +82,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Set<Card> cards = new LinkedHashSet<>();
|
||||
if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) {
|
||||
if (multitargetHandling) {
|
||||
for (Target target : source.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
MageObject mageObject = game.getObject(targetId);
|
||||
|
|
@ -85,8 +91,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (UUID targetId : targetPointer.getTargets(game, source)) {
|
||||
MageObject mageObject = game.getObject(targetId);
|
||||
if (mageObject != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue