mirror of
https://github.com/correl/mage.git
synced 2024-12-27 11:07:39 +00:00
added methods for setting target adjuster
This commit is contained in:
parent
3265b70e2f
commit
8bcf95d996
3 changed files with 27 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -23,6 +22,7 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.Targets;
|
import mage.target.Targets;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -527,6 +527,12 @@ public interface Ability extends Controllable, Serializable {
|
||||||
|
|
||||||
boolean canFizzle();
|
boolean canFizzle();
|
||||||
|
|
||||||
|
void setTargetAdjuster(TargetAdjuster targetAdjuster);
|
||||||
|
|
||||||
|
TargetAdjuster getTargetAdjuster();
|
||||||
|
|
||||||
|
void adjustTargets(Game game);
|
||||||
|
|
||||||
void setTargetAdjustment(TargetAdjustment targetAdjustment);
|
void setTargetAdjustment(TargetAdjustment targetAdjustment);
|
||||||
|
|
||||||
TargetAdjustment getTargetAdjustment();
|
TargetAdjustment getTargetAdjustment();
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.abilities;
|
package mage.abilities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -33,6 +32,7 @@ import mage.game.stack.StackAbility;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.Target;
|
import mage.target.Target;
|
||||||
import mage.target.Targets;
|
import mage.target.Targets;
|
||||||
|
import mage.target.targetadjustment.TargetAdjuster;
|
||||||
import mage.util.GameLog;
|
import mage.util.GameLog;
|
||||||
import mage.util.ThreadLocalStringBuilder;
|
import mage.util.ThreadLocalStringBuilder;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
@ -73,6 +73,7 @@ public abstract class AbilityImpl implements Ability {
|
||||||
protected List<Ability> subAbilities = null;
|
protected List<Ability> subAbilities = null;
|
||||||
protected boolean canFizzle = true;
|
protected boolean canFizzle = true;
|
||||||
protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE;
|
protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE;
|
||||||
|
protected TargetAdjuster targetAdjuster = null;
|
||||||
|
|
||||||
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
||||||
this.id = UUID.randomUUID();
|
this.id = UUID.randomUUID();
|
||||||
|
@ -1233,4 +1234,19 @@ public abstract class AbilityImpl implements Ability {
|
||||||
public TargetAdjustment getTargetAdjustment() {
|
public TargetAdjustment getTargetAdjustment() {
|
||||||
return targetAdjustment;
|
return targetAdjustment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTargetAdjuster(TargetAdjuster targetAdjuster) {
|
||||||
|
this.targetAdjuster = targetAdjuster;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TargetAdjustment getTargetAdjuster() {
|
||||||
|
return targetAdjuster;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Game game) {
|
||||||
|
this.targetAdjuster.adjustTargets(this, game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package mage.target.targetadjustment;
|
package mage.target.targetadjustment;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.game.Game;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
|
|
Loading…
Reference in a new issue