From 7ce1e6de19891cae2590ac522da1968cadf079f8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 1 Mar 2015 17:22:39 +0100 Subject: [PATCH] * Some minor changes. --- .../Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java | 8 ++++++-- .../src/main/java/mage/player/ai/ComputerPlayer.java | 3 +++ .../org/mage/test/cards/abilities/curses/CursesTest.java | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java index 1680d0cf4b..686eb4cb90 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/TinyLeaders.java @@ -155,8 +155,12 @@ public class TinyLeaders extends DeckValidator { */ if (commander == null || commander.getManaCost().convertedManaCost() > 3) { - if (commander == null) invalid.put("Leader", "Please be sure to set your leader in the NAME field in the DECK EDITOR"); - if (commander != null && commander.getManaCost().convertedManaCost() > 3) invalid.put("Leader", "Commander CMC is Greater than 3"); + if (commander == null) { + invalid.put("Leader", "Please be sure to set your leader in the NAME field in the DECK EDITOR"); + } + if (commander != null && commander.getManaCost().convertedManaCost() > 3) { + invalid.put("Leader", "Commander CMC is Greater than 3"); + } return false; } if ((commander.getCardType().contains(CardType.CREATURE) && commander.getSupertype().contains("Legendary")) diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index cb9a85dda2..df1a684fa0 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -1286,6 +1286,9 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (card != null) { target.addTarget(card.getId(), source, game); cardChoices.remove(card); + } else { + // We don't have any valid target to choose so stop choosing + return target.getTargets().size() < target.getNumberOfTargets(); } if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) { return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java index f466f34a33..9b34753da4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/curses/CursesTest.java @@ -192,6 +192,9 @@ public class CursesTest extends CardTestPlayerBase { @Test public void testCurseOfMisfortune1() { removeAllCardsFromLibrary(playerA); + + // At the beginning of your upkeep, you may search your library for a Curse card that doesn't have the same name as a + // Curse attached to enchanted player, put it onto the battlefield attached to that player, then shuffle your library. addCard(Zone.LIBRARY, playerA, "Curse of Misfortunes", 2); addCard(Zone.HAND, playerA, "Curse of Misfortunes"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);