refactored this optimizedhand section to remove copy paste code...they all check the same condiations except the rating...so i had it check the codiations first THEN the ratings....makes it a little easier to edit later if needed.

This commit is contained in:
omegablast2002@yahoo.com
2011-02-06 15:16:27 +00:00
parent 156fd4a601
commit 9d728ea0dd

View File

@@ -167,7 +167,7 @@ void RulesState::parsePlayerState(int playerId, string s)
void Rules::addExtraRules()
{
GameObserver * g = GameObserver::GetInstance();
int id = g->mLayers->actionLayer()->getMaxId();
for (int i = 0; i < 2; ++i)
{
@@ -196,34 +196,27 @@ void Rules::addExtraRules()
if (a->oneShot)
{
if (((p->isAI() && p->playMode
!= Player::MODE_AI && p->opponent()->playMode
!= Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == EASY && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode
!= GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes.
{
handsize = ((AADrawer *)a)->getNumCards();
((AIPlayer *) p)->forceBestAbilityUse = true;
((AIPlayer *) p)->agressivity += 100;
hand->OptimizedHand(p,handsize, 3, 1, 3);//easy decks get a major boost, open hand is 2lands,1 creature under 3 mana,3spells under 3 mana.
}
else if (((p->isAI() && p->playMode
!= Player::MODE_AI && p->opponent()->playMode
!= Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == NORMAL && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode
!= GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes.
{
handsize = ((AADrawer *)a)->getNumCards();
hand->OptimizedHand(p,handsize, 1, 0, 2);//give the Ai deck a tiny boost by giving it 1 land and 2 spells under 3 manacost.
}else if (((p->isAI() && p->playMode
!= Player::MODE_AI && p->opponent()->playMode
!= Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode
!= GAME_TYPE_STORY)
!= GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes.
{
hand->OptimizedHand(p,handsize, 3, 1, 3);
handsize = ((AADrawer *)a)->getNumCards();
if(difficultyRating == EASY )
{
((AIPlayer *) p)->forceBestAbilityUse = true;
((AIPlayer *) p)->agressivity += 100;
hand->OptimizedHand(p,handsize, 3, 1, 3);//easy decks get a major boost, open hand is 2lands,1 creature under 3 mana,3spells under 3 mana.
}
else if (difficultyRating == NORMAL)
{
hand->OptimizedHand(p,handsize, 1, 0, 2);//give the Ai deck a tiny boost by giving it 1 land and 2 spells under 3 manacost.
}
else
{
hand->OptimizedHand(p,handsize, 3, 1, 3);
}
}
else
{//resolve normally if the deck is listed as hard.