further improved "prevent" training on ai, while polishing off a Ai deck based on cleric i noticed it was using WAY too much prevent on a creature...sometimes 6 points or more then it should have been using...we only ever want to use *just* enough to survive. this way we can spread the love to the other creatures.

i hope to have a polished cleric Ai deck for release 14.1 within the next day or so. trying to include a couple decks that take adventage of all this great training.

hopefully i can get prevent working as good as equip does...the Ai deck i constructed called
"the kor" is almost an unbeatable white weenie deck.
This commit is contained in:
omegablast2002@yahoo.com
2010-12-13 12:33:35 +00:00
parent 3c0ac6b3f5
commit 64af4470e4

View File

@@ -281,18 +281,31 @@ int AIAction::getEfficiency()
{
if ((target->defenser || target->blockers.size()) && target->preventable < target->getNextOpponent()->power)
NeedPreventing = true;
}
if (p == target->controller() && NeedPreventing == true && !(target->getNextOpponent()->has(Constants::DEATHTOUCH)
if (p == target->controller() && target->controller()->isAI() && NeedPreventing == true && !(target->getNextOpponent()->has(Constants::DEATHTOUCH)
|| target->getNextOpponent()->has(Constants::WITHER)))
{
efficiency = 20 * (target->DangerRanking());//increase this chance to be used in combat if the creature blocking/blocked could kill the creature this chance is taking into consideration how good the creature is, best creature will always be the first "saved"..
if (target->toughness == 1 && target->getNextOpponent()->power == 1)
efficiency += 15;
//small bonus added for the poor 1/1s, if we can save them, we will unless something else took precidence.
}
}
//note is the target is being blocked or blocking a creature with wither or deathtouch, it is not even considered for preventing as it is a waste.
//if its combat blockers, it is being blocked or blocking, and has less prevents the the amount of damage it will be taking, the effeincy is increased slightly and totalled by the danger rank multiplier for final result.
//TODO If the card is the target of a damage spell
int calculateAfterDamage = 0;
int damages = 0;
if((target->defenser || target->blockers.size()) && target->controller()->isAI())
{
damages = target->getNextOpponent()->power;
calculateAfterDamage = int(target->toughness - damages);
if((calculateAfterDamage + target->preventable) > 0)
{
efficiency = 0;
//this is to avoid wasting prevents on creatures that will already survive.
//this should take into account bushido and flanking as this check is run after every trigger.
}
}
}
//TODO If the card is the target of a damage spell
break;
}
case MTGAbility::STANDARD_EQUIP: