mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
getBattlefield directly, not via getState
This commit is contained in:
parent
7a76a3b005
commit
d8be015c65
40 changed files with 47 additions and 50 deletions
|
|
@ -42,7 +42,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl {
|
|||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (getAffectedObjectsSet() && game.getPlayer(source.getControllerId()) != null) {
|
||||
for (Permanent perm : game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||
affectedObjectList.add(new MageObjectReference(perm, game));
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ public class SwitchPowerToughnessAllEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
|
||||
if (!getAffectedObjectsSet()) {
|
||||
game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).forEach(Permanent::switchPowerToughness);
|
||||
game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game).forEach(Permanent::switchPowerToughness);
|
||||
} else {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext(); ) { // filter may not be used again, because object can have changed filter relevant attributes but still gets boost
|
||||
Permanent creature = it.next().getPermanent(game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue