diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 260e9c8773..0fc95c3262 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -42,7 +42,7 @@ public class MageVersion implements Serializable, Comparable { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 0; - public final static String MAGE_VERSION_MINOR_PATCH = "v0"; + public final static String MAGE_VERSION_MINOR_PATCH = "v1"; public final static String MAGE_VERSION_INFO = ""; private final int major; 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 e036a3f820..4186fd22f2 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 @@ -341,10 +341,12 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target instanceof TargetPermanentOrPlayer) { List targets; TargetPermanentOrPlayer t = ((TargetPermanentOrPlayer) target); + List ownedTargets = threats(playerId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets());; + List opponentTargets = threats(opponentId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); if (outcome.isGood()) { - targets = threats(playerId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); + targets = ownedTargets; } else { - targets = threats(opponentId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); + targets = opponentTargets; } for (Permanent permanent : targets) { List alreadyTargetted = target.getTargets(); @@ -377,7 +379,21 @@ public class ComputerPlayer extends PlayerImpl implements Player { target.add(playerId, game); return true; } - throw new IllegalStateException("TargetPermanentOrPlayer wasn't handled. class:" + target.getClass().toString()); + if (outcome.isGood()) { // no other valid targets so use a permanent + targets = opponentTargets; + } else { + targets = ownedTargets; + } + for (Permanent permanent : targets) { + List alreadyTargetted = target.getTargets(); + if (t.canTarget(permanent.getId(), game)) { + if (alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId())) { + target.add(permanent.getId(), game); + return true; + } + } + } + return false; } if (target instanceof TargetCardInGraveyard) { List cards = new ArrayList<>(); diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 07cb0fc3e4..e06f1c741d 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -60,7 +60,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 38; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 15; + private static final long CARD_CONTENT_VERSION = 16; private final Random random = new Random(); private Dao cardDao; diff --git a/Mage/src/mage/cards/repository/ExpansionRepository.java b/Mage/src/mage/cards/repository/ExpansionRepository.java index 134aca215f..5fb202231b 100644 --- a/Mage/src/mage/cards/repository/ExpansionRepository.java +++ b/Mage/src/mage/cards/repository/ExpansionRepository.java @@ -27,7 +27,7 @@ public enum ExpansionRepository { private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "expansion"; private static final long EXPANSION_DB_VERSION = 4; - private static final long EXPANSION_CONTENT_VERSION = 6; + private static final long EXPANSION_CONTENT_VERSION = 7; private Dao expansionDao; diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index 60d8b392fe..a9d30f519d 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -126,6 +126,9 @@ git log 00692410273d4c2ff70eec7bfcf6a601fb404bf9..HEAD --diff-filter=A --name-st since 1.4.0.v0 git log fa847e8feb646e94d77fc8abc35e1d9817622f8a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.0.v1 +git log e8b2e01cd465f6a8ced2c83ec52a698ee093baa4..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl