mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Displaying arrows for fixed targets in effects (for Jace, Architect of Thought first ability)
This commit is contained in:
parent
c9a40f4431
commit
575cebad7f
2 changed files with 30 additions and 3 deletions
|
@ -28,9 +28,14 @@
|
|||
|
||||
package mage.view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.TargetPointer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -57,7 +62,25 @@ public class StackAbilityView extends CardView {
|
|||
this.superTypes = ability.getSupertype();
|
||||
this.color = ability.getColor();
|
||||
this.manaCost = ability.getManaCost().getSymbols();
|
||||
setTargets(ability.getTargets());
|
||||
updateTargets(ability);
|
||||
}
|
||||
|
||||
private void updateTargets(StackAbility ability) {
|
||||
if (ability.getTargets().size() > 0) {
|
||||
setTargets(ability.getTargets());
|
||||
} else {
|
||||
List<UUID> targetList = new ArrayList<UUID>();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
TargetPointer targetPointer = effect.getTargetPointer();
|
||||
if (targetPointer instanceof FixedTarget) {
|
||||
targetList.add(((FixedTarget) targetPointer).getTarget());
|
||||
}
|
||||
}
|
||||
if (targetList.size() > 0) {
|
||||
overrideTargets(targetList);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public CardView getSourceCard() {
|
||||
|
|
|
@ -61,4 +61,8 @@ public class FixedTarget implements TargetPointer {
|
|||
public TargetPointer copy() {
|
||||
return new FixedTarget(this);
|
||||
}
|
||||
|
||||
public UUID getTarget() {
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue