* optimized card loading. There was some redundant code that wasn't necessary.
* getCardByName seemed to have a initialization error if you tried to use it before the entire game loaded. The cache would throw an exception if you tried to use find and it was empty. I put a guard around it to avoid this issue. * refactored Zeth's "toggledifficuly" feature to be stored in meta data. http://code.google.com/p/wagic/source/detail?r=3106 -- This is slightly modified as it forces a 1 for 1 swap of cards that are specified. from the example given this is how it seemed to be used anyways. -- since all the information is stored in the meta data, there's no need to alter the deck's definition.
This commit is contained in:
@@ -1180,17 +1180,8 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, Player * op
|
||||
sprintf(deckFileSmall, "ai_baka_deck%i", deckid);
|
||||
}
|
||||
DeckStats * stats = DeckStats::GetInstance();
|
||||
int deckSetting = NULL;
|
||||
int diff = stats->percentVictories();
|
||||
if (diff >= 65)
|
||||
{
|
||||
deckSetting = HARD;
|
||||
}
|
||||
else if (diff < 65)
|
||||
{
|
||||
deckSetting = EASY;
|
||||
}
|
||||
MTGDeck * tempDeck = NEW MTGDeck(deckFile, collection,0,deckSetting);
|
||||
|
||||
MTGDeck * tempDeck = NEW MTGDeck(deckFile, collection, 0);
|
||||
AIPlayerBaka * baka = NEW AIPlayerBaka(tempDeck, deckFile, deckFileSmall, avatarFile);
|
||||
baka->deckId = deckid;
|
||||
SAFE_DELETE(tempDeck);
|
||||
|
||||
Reference in New Issue
Block a user