From 139faeb7a5108f36d7ce9f543f046af83714177b Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Tue, 7 Dec 2010 05:03:35 +0000 Subject: [PATCH] fixes + adjusted minimax AI --- .../mage/player/ai/GameStateEvaluator.java | 12 ++++++------ Mage.Server/plugins/mage-player-aiminimax.jar | Bin 36449 -> 36423 bytes .../src/mage/sets/worldwake/SearingBlaze.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java index 9553efacf3..f4734f9bbc 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java @@ -67,17 +67,17 @@ public class GameStateEvaluator { } public static int evaluatePermanent(Permanent permanent, Game game) { - int value = permanent.isTapped()?1:2; + int value = permanent.isTapped()?4:5; if (permanent.getCardType().contains(CardType.CREATURE)) { value += evaluateCreature(permanent, game) * CREATURE_FACTOR; } value += permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD).size(); for (ActivatedAbility ability: permanent.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD)) { if (!(ability instanceof ManaAbility) && ability.canActivate(ability.getControllerId(), game)) - value += ability.getEffects().getOutcomeTotal(); + value += ability.getEffects().size(); } - value += permanent.getAbilities().getStaticAbilities(Zone.BATTLEFIELD).getOutcomeTotal(); - value += permanent.getAbilities().getTriggeredAbilities(Zone.BATTLEFIELD).getOutcomeTotal(); + value += permanent.getAbilities().getStaticAbilities(Zone.BATTLEFIELD).size(); + value += permanent.getAbilities().getTriggeredAbilities(Zone.BATTLEFIELD).size(); value += permanent.getManaCost().convertedManaCost(); //TODO: add a difficulty to calculation to ManaCost - sort permanents by difficulty for casting when evaluating game states return value; @@ -91,8 +91,8 @@ public class GameStateEvaluator { // value += creature.getPower().getValue(); // if (!creature.isTapped()) // value += 2; - value += creature.getAbilities().getEvasionAbilities().getOutcomeTotal(); - value += creature.getAbilities().getProtectionAbilities().getOutcomeTotal(); + value += creature.getAbilities().getEvasionAbilities().size(); + value += creature.getAbilities().getProtectionAbilities().size(); value += creature.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId())?1:0; value += creature.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId())?2:0; value += creature.getAbilities().containsKey(TrampleAbility.getInstance().getId())?1:0; diff --git a/Mage.Server/plugins/mage-player-aiminimax.jar b/Mage.Server/plugins/mage-player-aiminimax.jar index 91cfe4afe385cc7983b9345b168d5fb369300b8b..c733ae46014a2688451551a498e077a94f99c4da 100644 GIT binary patch delta 3490 zcmZ9PcQo7m7snC1w2eKA))tLX8Wh!}wtwy}lNJoR;L`X{w8RM$Zpu zJco2TfTb+vSk_nojk3#$U{+Tr&v5+N=H~rx@Dop=mT!ssR}tVo`?XKwNSLVs$va zd!!+skM?TqO!RtAPLU&h%Vxt=2Jwk7<|NG`7Xb1lJ~AqZr!0sUG|lRZ$v!;LHT-$f zxJ$_OYCCp3lbQ*gA)uEw+gLxd{MdfUGaBLpuohStv2LZ53HD*Mu9)@bg(E((dVS`M zZN-KI#A|JoWMqUoWU{U&G$(XhDh6>*Z(!srGd7LA>*JR^fmM%+{42aSckolP8)%Q9 z)UIjKg)o62rMt6eDxZ&0SK#_7t5Zicp-Q|9uRTL?DU6<>R_cXUKgqY2eHMz%yNS*} zN?-fwGQKWlzbTge0)&>nyNbXpN$@SSq!}rD8hcxyD_Jdln$tpJLZ_p}&F&o19v7Ll z^e3Hc3(U2xp`R82M0 zaj3NgIMwe;jX5>z(qlSJpG9_RsPB>6nJm{p$|(d5)upfB;)5_yXCwSP$i0NehQl26 zoM1tlcgZMd7Jp5h1k0a%IB7TcF&}N)=-Y}6lT+I)=xduAf9CcPC}k*5eQ@VD33`y3 zX9#Z6m9P@V_$Yo))l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S8S!_FVw8AMg>MyiJ0im~N=rhAM_%KCq6- z5`F?80AzFtCyzEoG>K6^>Jx}zG5SaAB(}sTGjJS3{y0X&U;FPKp)~&bxuZXTo%)|O5P*qk8_2{Y%jj2*U-{uluEc|2A)m-00BUw4ymTX ve@%9Lu!lANhmX#GYMGew!=s}Q3)G2?(d>ejaAuaH+?m6B=aAXP97X>E+gf9D diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index c53b2a9145..c355254f92 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -99,7 +99,7 @@ class SearingBlazeWatcher extends WatcherImpl { public void watch(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).getToZone() == Zone.BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(event.getPlayerId())) { + if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { condition = true; } }