Fixed Goblin Barrage not targeting correctly

This commit is contained in:
Evan Kranzler 2018-04-22 17:24:24 -04:00
parent 9b2af09505
commit 35b78f8d11
3 changed files with 14 additions and 22 deletions

View file

@ -60,22 +60,21 @@ public class TargetPermanentOrPlayer extends TargetImpl {
}
public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets) {
this.minNumberOfTargets = minNumTargets;
this.maxNumberOfTargets = maxNumTargets;
this.zone = Zone.ALL;
this.filter = new FilterPermanentOrPlayer();
this.targetName = filter.getMessage();
this.filterPermanent = this.filter.getPermanentFilter();
this(minNumTargets, maxNumTargets, false);
}
public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets, boolean notTarget) {
this(minNumTargets, maxNumTargets);
this.notTarget = notTarget;
this(minNumTargets, maxNumTargets, new FilterPermanentOrPlayer(), notTarget);
}
public TargetPermanentOrPlayer(int minNumTargets, int maxNumTargets, FilterPermanentOrPlayer filter, boolean notTarget) {
this(minNumTargets, maxNumTargets, notTarget);
this.minNumberOfTargets = minNumTargets;
this.maxNumberOfTargets = maxNumTargets;
this.zone = Zone.ALL;
this.filter = filter;
this.targetName = filter.getMessage();
this.filterPermanent = this.filter.getPermanentFilter();
this.notTarget = notTarget;
}
public TargetPermanentOrPlayer(final TargetPermanentOrPlayer target) {
@ -164,7 +163,7 @@ public class TargetPermanentOrPlayer extends TargetImpl {
}
}
}
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT, sourceControllerId, game)) {
if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
count++;
if (count >= this.minNumberOfTargets) {

View file

@ -14,7 +14,7 @@ import mage.filter.common.FilterPlayerOrPlaneswalker;
public class TargetPlayerOrPlaneswalker extends TargetPermanentOrPlayer {
public TargetPlayerOrPlaneswalker() {
this(1, 1, new FilterPlayerOrPlaneswalker("player or planeswalker"), false);
this(1, 1, new FilterPlayerOrPlaneswalker(), false);
}
public TargetPlayerOrPlaneswalker(int numTargets) {