From 75949037b03a5dac398b022f51099e297e9464d9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 20 Apr 2018 23:26:28 +0200 Subject: [PATCH] * The Antiquities War - Fixed that the third ability affects wrongly also artifacts played after it resolves (fixes #4819). --- Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java index 8c83a8c5f3d..7e47eda9f71 100644 --- a/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java +++ b/Mage.Sets/src/mage/cards/t/TheAntiquitiesWar.java @@ -27,8 +27,8 @@ */ package mage.cards.t; -import java.util.List; import java.util.UUID; +import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SagaAbility; import mage.abilities.dynamicvalue.common.StaticValue; @@ -47,7 +47,6 @@ import mage.constants.SubLayer; import mage.constants.SubType; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterArtifactPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -103,10 +102,18 @@ class TheAntiquitiesWarEffect extends ContinuousEffectImpl { return new TheAntiquitiesWarEffect(this); } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + for (Permanent perm : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT, source.getControllerId(), source.getSourceId(), game)) { + affectedObjectList.add(new MageObjectReference(perm, game)); + } + } + @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - List permanents = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), source.getControllerId(), game); - for (Permanent permanent : permanents) { + for (MageObjectReference mor : affectedObjectList) { + Permanent permanent = mor.getPermanent(game); if (permanent != null) { switch (layer) { case TypeChangingEffects_4: