ai vs ai matchs will play with optimizedhands.

This commit is contained in:
omegablast2002@yahoo.com
2013-03-01 23:10:16 +00:00
parent ef18f376b1
commit 04dce1ad50
2 changed files with 11 additions and 9 deletions

View File

@@ -125,10 +125,7 @@ void MTGPlayerCards::OptimizedHand(Player * who,int amount, int lands, int creat
{
//give the Ai hand adventage to insure a challanging match.
GameObserver * game = who->getObserver();
if (!game->players[0]->isAI() && game->players[1]->isAI())
{
Player * p = who;
Player * p = dynamic_cast<Player*>(who);
MTGCardInstance * card = NULL;
MTGGameZone * z = p->game->library;
@@ -208,7 +205,6 @@ void MTGPlayerCards::OptimizedHand(Player * who,int amount, int lands, int creat
}
//----------------------------
}
void MTGPlayerCards::drawFromLibrary()
{

View File

@@ -158,7 +158,7 @@ void Rules::addExtraRules(GameObserver* g)
MTGAbility * a = af.parseMagicLine(initState.playerData[i].extraRules[j], id++, NULL, &(g->ExtraRules[i]));
if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI))
difficultyRating = 0;
difficultyRating = 1;
else if (g->players[1]->playMode == Player::MODE_HUMAN)
difficultyRating = 0;
else if (p->playMode == Player::MODE_TEST_SUITE)
@@ -178,12 +178,18 @@ void Rules::addExtraRules(GameObserver* g)
a->canBeInterrupted = false;
if (a->oneShot)
{
if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI))
a->resolve();
else if (a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == HARD)
if (a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == HARD)
a->resolve();
else if (a->aType != MTGAbility::STANDARD_DRAW)
a->resolve();
else if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI))
{
handsize = ((AADrawer *)a)->getNumCards();
((AIPlayer *) p)->forceBestAbilityUse = true;
((AIPlayer *) p)->agressivity += 100;
hand->OptimizedHand(p,handsize, 3, 1, 3);
}
else if (!p->isAI() && !Optimizedhandcheat)
a->resolve();
else if (p->playMode == Player::MODE_TEST_SUITE)