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
+7 -14
View File
@@ -197,34 +197,27 @@ void Rules::addExtraRules()
{ {
if (((p->isAI() && p->playMode if (((p->isAI() && p->playMode
!= Player::MODE_AI && p->opponent()->playMode != Player::MODE_AI && p->opponent()->playMode
!= Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == EASY && p->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 != 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_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. != GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes.
{ {
handsize = ((AADrawer *)a)->getNumCards(); handsize = ((AADrawer *)a)->getNumCards();
if(difficultyRating == EASY )
{
((AIPlayer *) p)->forceBestAbilityUse = true; ((AIPlayer *) p)->forceBestAbilityUse = true;
((AIPlayer *) p)->agressivity += 100; ((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. 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 else if (difficultyRating == NORMAL)
!= 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. 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 else
!= 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)
{ {
hand->OptimizedHand(p,handsize, 3, 1, 3); hand->OptimizedHand(p,handsize, 3, 1, 3);
} }
}
else else
{//resolve normally if the deck is listed as hard. {//resolve normally if the deck is listed as hard.
a->resolve(); a->resolve();