diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index a4d437c08..c7f679fb3 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -62,8 +62,9 @@ int OrderedAIAction::getEfficiency(AADamager * aad) // I can't remember as I type this in which condition we use one or the other for this function, if you find out please replace this comment int OrderedAIAction::getEfficiency() { - if (efficiency > -1) - return efficiency; + //commented out the below becuase I noticed it prevented ai from updating the given abilities with new eff %. + //if (efficiency > -1) + // return efficiency; if (!ability) return 0; GameObserver * g = owner->getObserver(); @@ -335,6 +336,16 @@ int OrderedAIAction::getEfficiency() } case MTGAbility::MANA_PRODUCER://only way to hit this condition is nested manaabilities, ai skips manaproducers by defualt when finding an ability to use. { + AManaProducer * manamaker = dynamic_cast(a); + GenericActivatedAbility * GAA = dynamic_cast(ability); + AForeach * forMana = dynamic_cast(GAA->ability); + if (manamaker && forMana) + { + int outPut = forMana->checkActivation(); + if (ability->getCost() && outPut > int(ability->getCost()->getConvertedCost() +1) && currentPhase == MTG_PHASE_FIRSTMAIN && ability->source->controller()->game->hand->nb_cards > 1) + efficiency = 90;//might be a bit random, but better than never using them. + } + else efficiency = 0; break; } @@ -635,6 +646,10 @@ int OrderedAIAction::getEfficiency() { efficiency += 55; } + else if (dynamic_cast(a)) + { + efficiency += 55; + } SAFE_DELETE(transAbility); return efficiency; }