updated Crown of Doom

This commit is contained in:
Evan Kranzler 2017-09-19 11:41:16 -04:00
parent 2d577287d1
commit 6800d80cae

View file

@ -47,6 +47,7 @@ import mage.filter.StaticFilters;
import mage.filter.predicate.ObjectSourcePlayer; import mage.filter.predicate.ObjectSourcePlayer;
import mage.filter.predicate.ObjectSourcePlayerPredicate; import mage.filter.predicate.ObjectSourcePlayerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -57,7 +58,7 @@ import mage.target.targetpointer.FixedTarget;
*/ */
public class CrownOfDoom extends CardImpl { public class CrownOfDoom extends CardImpl {
private static final FilterPlayer filter = new FilterPlayer("player other than Crown of Doom's owner"); private static final FilterPlayer filter = new FilterPlayer("player other than {this}'s owner");
static { static {
filter.add(new CrownOfDoomPredicate()); filter.add(new CrownOfDoomPredicate());
@ -95,17 +96,17 @@ class CrownOfDoomPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePl
@Override @Override
public boolean apply(ObjectSourcePlayer<Player> input, Game game) { public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
Player player = input.getObject(); Player targetPlayer = input.getObject();
UUID playerId = input.getPlayerId(); Permanent sourceObject = game.getPermanentOrLKIBattlefield(input.getSourceId());
if (player == null || playerId == null) { if (targetPlayer == null || sourceObject == null) {
return false; return false;
} }
return !player.getId().equals(playerId); return !targetPlayer.getId().equals(sourceObject.getOwnerId());
} }
@Override @Override
public String toString() { public String toString() {
return "Owner()"; return "Owner(" + ')';
} }
} }