ai vs ai matchs will play with optimizedhands.
This commit is contained in:
@@ -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.
|
//give the Ai hand adventage to insure a challanging match.
|
||||||
GameObserver * game = who->getObserver();
|
GameObserver * game = who->getObserver();
|
||||||
|
Player * p = dynamic_cast<Player*>(who);
|
||||||
if (!game->players[0]->isAI() && game->players[1]->isAI())
|
|
||||||
{
|
|
||||||
Player * p = who;
|
|
||||||
MTGCardInstance * card = NULL;
|
MTGCardInstance * card = NULL;
|
||||||
MTGGameZone * z = p->game->library;
|
MTGGameZone * z = p->game->library;
|
||||||
|
|
||||||
@@ -208,7 +205,6 @@ void MTGPlayerCards::OptimizedHand(Player * who,int amount, int lands, int creat
|
|||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------
|
//----------------------------
|
||||||
}
|
|
||||||
|
|
||||||
void MTGPlayerCards::drawFromLibrary()
|
void MTGPlayerCards::drawFromLibrary()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ void Rules::addExtraRules(GameObserver* g)
|
|||||||
MTGAbility * a = af.parseMagicLine(initState.playerData[i].extraRules[j], id++, NULL, &(g->ExtraRules[i]));
|
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))
|
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)
|
else if (g->players[1]->playMode == Player::MODE_HUMAN)
|
||||||
difficultyRating = 0;
|
difficultyRating = 0;
|
||||||
else if (p->playMode == Player::MODE_TEST_SUITE)
|
else if (p->playMode == Player::MODE_TEST_SUITE)
|
||||||
@@ -178,12 +178,18 @@ void Rules::addExtraRules(GameObserver* g)
|
|||||||
a->canBeInterrupted = false;
|
a->canBeInterrupted = false;
|
||||||
if (a->oneShot)
|
if (a->oneShot)
|
||||||
{
|
{
|
||||||
if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI))
|
|
||||||
a->resolve();
|
if (a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == HARD)
|
||||||
else if (a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == HARD)
|
|
||||||
a->resolve();
|
a->resolve();
|
||||||
else if (a->aType != MTGAbility::STANDARD_DRAW)
|
else if (a->aType != MTGAbility::STANDARD_DRAW)
|
||||||
a->resolve();
|
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)
|
else if (!p->isAI() && !Optimizedhandcheat)
|
||||||
a->resolve();
|
a->resolve();
|
||||||
else if (p->playMode == Player::MODE_TEST_SUITE)
|
else if (p->playMode == Player::MODE_TEST_SUITE)
|
||||||
|
|||||||
Reference in New Issue
Block a user