From 91347b38d96087744c56ba9302417a9bacfb0892 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Tue, 14 Dec 2010 11:02:49 +0000 Subject: [PATCH] sorry had to add this too, aparently simply putting BLAH_GOOD/BLAH_BAD without actually comparing it to the suggestion from af always returns true... --- projects/mtg/src/AIPlayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index 9f62dfb7b..c6703ed57 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -378,10 +378,12 @@ int AIAction::getEfficiency() efficiency = 0; if (!target) break; + AbilityFactory af; + int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY); //i do not set a starting eff. on this ability, this allows Ai to sometimes randomly do it as it normally does. if (g->getCurrentGamePhase() == Constants::MTG_PHASE_COMBATBLOCKERS) { - if (BAKA_EFFECT_GOOD && target->controller()->isAI()) + if (suggestion == BAKA_EFFECT_GOOD && target->controller()->isAI()) { if ((_target->defenser || _target->blockers.size()) && ((_target->power < _target->getNextOpponent()->toughness || _target->toughness < _target->getNextOpponent()->power) || (_target->has(Constants::TRAMPLE)))) @@ -395,7 +397,7 @@ int AIAction::getEfficiency() efficiency = 100; } } - if (BAKA_EFFECT_BAD && !target->controller()->isAI()) + if (suggestion == BAKA_EFFECT_BAD && !target->controller()->isAI()) { efficiency = 100; }