[ALA] Finish fixing Death Baron and add test

This commit is contained in:
Alex W. Jackson 2022-04-08 01:42:41 -04:00
parent ff5efb525a
commit a48dedcd76
5 changed files with 77 additions and 9 deletions

View file

@ -117,8 +117,9 @@ public class BoostControlledEffect extends ContinuousEffectImpl {
}
}
} else {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
if (perm.isControlledBy(source.getControllerId())
&& (!(excludeSource && perm.getId().equals(source.getSourceId())))) {
perm.addPower(power.calculate(game, source, this));
perm.addToughness(toughness.calculate(game, source, this));
}

View file

@ -98,8 +98,9 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl {
}
}
} else {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
if (perm.isControlledBy(source.getControllerId())
&& !(excludeSource && perm.getId().equals(source.getSourceId()))) {
for (Ability abilityToAdd : ability) {
perm.addAbility(abilityToAdd, source.getSourceId(), game);
}
@ -149,5 +150,4 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl {
setText();
return this;
}
}

View file

@ -237,8 +237,8 @@ public class Battlefield implements Serializable {
/**
* Returns all {@link Permanent} on the battlefield that match the supplied
* filter. This method ignores the range of influence. It ignores controller
* predicates
* filter. This method ignores the range of influence and ignores
* ObjectSourcePlayer predicates in the filter (e.g. controller predicates)
*
* @param filter
* @param game
@ -254,7 +254,8 @@ public class Battlefield implements Serializable {
/**
* Returns all {@link Permanent} that match the filter and are controlled by
* controllerId. This method ignores the range of influence.
* controllerId. This method ignores the range of influence and ignores
* ObjectSourcePlayer predicates in the filter
*
* @param filter
* @param controllerId