fixed handsize issue in demo.

Issue: 587
This commit is contained in:
omegablast2002@yahoo.com
2011-02-06 14:50:02 +00:00
parent e8a656e61e
commit 156fd4a601
3 changed files with 29 additions and 21 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ enum
GAME_TYPE_MOMIR, GAME_TYPE_MOMIR,
GAME_TYPE_RANDOM1, GAME_TYPE_RANDOM1,
GAME_TYPE_RANDOM2, GAME_TYPE_RANDOM2,
GAME_TYPE_STORY GAME_TYPE_STORY,
GAME_TYPE_DEMO
}; };
class MTGAllCards; class MTGAllCards;
+1
View File
@@ -802,6 +802,7 @@ void GameStateMenu::ButtonPressed(int controllerId, int controlId)
case SUBMENUITEM_DEMO: case SUBMENUITEM_DEMO:
mParent->players[0] = PLAYER_TYPE_CPU; mParent->players[0] = PLAYER_TYPE_CPU;
mParent->players[1] = PLAYER_TYPE_CPU; mParent->players[1] = PLAYER_TYPE_CPU;
mParent->gameType = GAME_TYPE_DEMO;
subMenuController->Close(); subMenuController->Close();
currentState = MENU_STATE_MAJOR_DUEL | MENU_STATE_MINOR_SUBMENU_CLOSING; currentState = MENU_STATE_MAJOR_DUEL | MENU_STATE_MINOR_SUBMENU_CLOSING;
break; break;
+26 -20
View File
@@ -181,12 +181,12 @@ void Rules::addExtraRules()
MTGPlayerCards * hand = NULL; MTGPlayerCards * hand = NULL;
int handsize = 7; int handsize = 7;
int difficultyRating = 0; int difficultyRating = 0;
int Optimizedhandcheat = options[Options::OPTIMIZE_HAND].number; int Optimizedhandcheat = options[Options::OPTIMIZE_HAND].number;
MTGAbility * a = af.parseMagicLine(initState.playerData[i].extraRules[j], id++, NULL, &MTGCardInstance::ExtraRules[i]); MTGAbility * a = af.parseMagicLine(initState.playerData[i].extraRules[j], id++, NULL, &MTGCardInstance::ExtraRules[i]);
if (p->playMode != Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode if (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_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode
!= GAME_TYPE_STORY && (!g->players[0] == PLAYER_TYPE_CPU && !g->players[1] == PLAYER_TYPE_CPU))//keep this out of mimor and other game modes. != GAME_TYPE_STORY &&
g->mRules->gamemode != GAME_TYPE_DEMO && (!g->players[0] == PLAYER_TYPE_CPU && !g->players[1] == PLAYER_TYPE_CPU))//keep this out of mimor and other game modes.
{ {
difficultyRating = DeckManager::getDifficultyRating(g->players[0], g->players[1]); difficultyRating = DeckManager::getDifficultyRating(g->players[0], g->players[1]);
} }
@@ -195,31 +195,37 @@ void Rules::addExtraRules()
{ {
if (a->oneShot) if (a->oneShot)
{ {
if (( p->isAI() ||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == EASY && p->playMode if (((p->isAI() && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode != Player::MODE_AI && p->opponent()->playMode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode != Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == EASY && p->playMode
!= GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes. != 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(); handsize = ((AADrawer *)a)->getNumCards();
((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->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == NORMAL && p->playMode else if (((p->isAI() && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode != Player::MODE_AI && p->opponent()->playMode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode != Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == NORMAL && p->playMode
!= GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes. != 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(); 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() && Optimizedhandcheat) && a->aType == MTGAbility::STANDARD_DRAW && p->playMode }else if (((p->isAI() && p->playMode
!= Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode != Player::MODE_AI && p->opponent()->playMode
!= GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode != Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && p->playMode
!= GAME_TYPE_STORY) != 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
hand->OptimizedHand(p,handsize, 3, 1, 3); != GAME_TYPE_STORY)
} {
else hand->OptimizedHand(p,handsize, 3, 1, 3);
}
else
{//resolve normally if the deck is listed as hard. {//resolve normally if the deck is listed as hard.
a->resolve(); a->resolve();
} }