fixed High Alert allowing opposing defenders to attack

This commit is contained in:
Evan Kranzler 2019-01-28 18:58:02 -05:00
parent 31311f8220
commit f4401b32f9
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ import mage.constants.AsThoughEffectType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -21,7 +21,7 @@ public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffec
private final FilterPermanent filter; private final FilterPermanent filter;
public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration) { public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration) {
this(duration, new FilterCreaturePermanent()); this(duration, StaticFilters.FILTER_PERMANENT_CREATURE);
} }
public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) { public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) {
@ -30,7 +30,7 @@ public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffec
this.staticText = getText(); this.staticText = getText();
} }
public CanAttackAsThoughItDidntHaveDefenderAllEffect(final CanAttackAsThoughItDidntHaveDefenderAllEffect effect) { private CanAttackAsThoughItDidntHaveDefenderAllEffect(final CanAttackAsThoughItDidntHaveDefenderAllEffect effect) {
super(effect); super(effect);
this.filter = effect.filter.copy(); this.filter = effect.filter.copy();
} }
@ -48,7 +48,7 @@ public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffec
@Override @Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
Permanent permanent = game.getPermanent(objectId); Permanent permanent = game.getPermanent(objectId);
return permanent != null && filter.match(permanent, game); return permanent != null && filter.match(permanent, source.getSourceId(), affectedControllerId, game);
} }
private String getText() { private String getText() {

View file

@ -27,7 +27,7 @@ public class CombatDamageByToughnessEffect extends ContinuousEffectImpl {
" assigns combat damage equal to its toughness rather than its power"; " assigns combat damage equal to its toughness rather than its power";
} }
public CombatDamageByToughnessEffect(final CombatDamageByToughnessEffect effect) { private CombatDamageByToughnessEffect(final CombatDamageByToughnessEffect effect) {
super(effect); super(effect);
this.filter = effect.filter; this.filter = effect.filter;
this.onlyControlled = effect.onlyControlled; this.onlyControlled = effect.onlyControlled;