diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java index 70a66f20bb..210ac15ba9 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java @@ -61,11 +61,15 @@ public class GameStateEvaluator2 { } int permanentScore = 0; - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { - permanentScore += evaluatePermanent(permanent, game); - } - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(opponent.getId())) { - permanentScore -= evaluatePermanent(permanent, game); + try { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(playerId)) { + permanentScore += evaluatePermanent(permanent, game); + } + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(opponent.getId())) { + permanentScore -= evaluatePermanent(permanent, game); + } + } catch (Throwable t) { + t.printStackTrace(); } //permanentScore *= PERMANENT_FACTOR; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java index a76b079e0c..b8b9c3cc45 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/ArtificialScoringSystem.java @@ -26,7 +26,7 @@ public class ArtificialScoringSystem { private static final int LIFE_ABOVE_MULTIPLIER = 100; public static int getCardDefinitionScore(final Game game, final Card card) { - int value = 0; //TODO: add new rating system card value + int value = 3; //TODO: add new rating system card value if (card.getCardType().contains(Constants.CardType.LAND)) { int score = (int) ((value / 2.0f) * 50); //TODO: check this for "any color" lands diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java index 47a55969ed..21084afa54 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ma/MagicAbility.java @@ -15,35 +15,36 @@ import java.util.zip.Inflater; public class MagicAbility { private static Map scores = new HashMap() {{ - scores.put(DeathtouchAbility.getInstance().getRule(), 60); - scores.put(DefenderAbility.getInstance().getRule(), -100); - scores.put(DoubleStrikeAbility.getInstance().getRule(), 100); - scores.put(DoubleStrikeAbility.getInstance().getRule(), 100); - scores.put(new ExaltedAbility().getRule(), 10); - scores.put(FirstStrikeAbility.getInstance().getRule(), 50); - scores.put(FlashAbility.getInstance().getRule(), 0); - scores.put(FlyingAbility.getInstance().getRule(), 50); - scores.put(new ForestwalkAbility().getRule(), 10); - scores.put(HasteAbility.getInstance().getRule(), 0); - scores.put(IndestructibleAbility.getInstance().getRule(), 150); - scores.put(InfectAbility.getInstance().getRule(), 60); - scores.put(IntimidateAbility.getInstance().getRule(), 50); - scores.put(new IslandwalkAbility().getRule(), 10); - scores.put(new MountainwalkAbility().getRule(), 10); - scores.put(new PlainswalkAbility().getRule(), 10); - scores.put(ReachAbility.getInstance().getRule(), 20); - scores.put(ShroudAbility.getInstance().getRule(), 60); - scores.put(new SwampwalkAbility().getRule(), 10); - scores.put(TrampleAbility.getInstance().getRule(), 30); - scores.put(UnblockableAbility.getInstance().getRule(), 100); - scores.put(VigilanceAbility.getInstance().getRule(), 20); - scores.put(WitherAbility.getInstance().getRule(), 30); + put(DeathtouchAbility.getInstance().getRule(), 60); + put(DefenderAbility.getInstance().getRule(), -100); + put(DoubleStrikeAbility.getInstance().getRule(), 100); + put(DoubleStrikeAbility.getInstance().getRule(), 100); + put(new ExaltedAbility().getRule(), 10); + put(FirstStrikeAbility.getInstance().getRule(), 50); + put(FlashAbility.getInstance().getRule(), 0); + put(FlyingAbility.getInstance().getRule(), 50); + put(new ForestwalkAbility().getRule(), 10); + put(HasteAbility.getInstance().getRule(), 0); + put(IndestructibleAbility.getInstance().getRule(), 150); + put(InfectAbility.getInstance().getRule(), 60); + put(IntimidateAbility.getInstance().getRule(), 50); + put(new IslandwalkAbility().getRule(), 10); + put(new MountainwalkAbility().getRule(), 10); + put(new PlainswalkAbility().getRule(), 10); + put(ReachAbility.getInstance().getRule(), 20); + put(ShroudAbility.getInstance().getRule(), 60); + put(new SwampwalkAbility().getRule(), 10); + put(TrampleAbility.getInstance().getRule(), 30); + put(UnblockableAbility.getInstance().getRule(), 100); + put(VigilanceAbility.getInstance().getRule(), 20); + put(WitherAbility.getInstance().getRule(), 30); }}; public static int getAbilityScore(Ability ability) { if (!scores.containsKey(ability.getRule())) { - System.err.println("Couldn't find ability score: " + ability.getRule()); + //System.err.println("Couldn't find ability score: " + ability.getRule()); //TODO: add handling protection from ..., levelup, kicker, etc. abilities + return 0; } return scores.get(ability.getRule()); } diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties index de0c2725e7..2e014c18ee 100644 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Sun Feb 06 08:07:38 EST 2011 +#Sat Feb 12 11:24:53 MSK 2011 version=0.6 groupId=org.mage artifactId=Mage-Tournament-BoosterDraft diff --git a/Mage.Tests/plugins/mage-player-ai-ma.jar b/Mage.Tests/plugins/mage-player-ai-ma.jar index 0891171fea..a7d5b0a71d 100644 Binary files a/Mage.Tests/plugins/mage-player-ai-ma.jar and b/Mage.Tests/plugins/mage-player-ai-ma.jar differ diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java index 1c1cc4b119..e8fed69414 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/PlayGameTest.java @@ -32,7 +32,7 @@ public class PlayGameTest extends MageTestBase { game.loadCards(deck.getCards(), player.getId()); Player player2 = createPlayer("computer2", "Computer - mad"); - Deck deck2 = Deck.load(Sets.loadDeck("UW Control.dck")); + Deck deck2 = Deck.load(Sets.loadDeck("RB Aggro.dck")); if (deck2.getCards().size() < 40) { throw new IllegalArgumentException("Couldn't load deck, deck side=" + deck2.getCards().size()); } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostPowerXSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostPowerXSourceEffect.java index 9f8221685f..377649ad21 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostPowerXSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostPowerXSourceEffect.java @@ -33,10 +33,13 @@ import mage.Constants.Layer; import mage.Constants.Outcome; import mage.Constants.SubLayer; import mage.abilities.Ability; +import mage.abilities.costs.VariableCost; import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.List; + /** * * @author BetaSteward_at_googlemail.com @@ -50,6 +53,7 @@ public class BoostPowerXSourceEffect extends ContinuousEffectImpl varCost = source.getCosts().getVariableCosts(); + if (varCost.size() > 0) { + amount = varCost.get(0).getAmount(); + } else { + amount = 0; + return false; + } + } Permanent target = (Permanent) game.getPermanent(source.getSourceId()); if (target != null) { target.addPower(amount); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 517b27f68d..48d1152861 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -962,7 +962,9 @@ public abstract class PlayerImpl> implements Player, Ser for (UUID targetId: option.getTargets().getUnchosen().get(targetNum).possibleTargets(option.getSourceId(), playerId, game)) { Ability newOption = option.copy(); newOption.getTargets().get(targetNum).addTarget(targetId, option, game); - if (targetNum < option.getTargets().size() - 1) { + if (targetNum < option.getTargets().size() - 2) { + //addTargetOptions(options, newOption, targetNum + 1, game); + // ayrat: bug fix addTargetOptions(options, newOption, targetNum + 1, game); } else {