- Added new code for serialization/deserializaiton of full games including initial game and all the player actions.
- Added an undo menu using this code (beware, it's still very very alpha). - Removed various warning - Cleaned up avatar loading - Added full random lists load/save including the deck shuffling (not sure if I could not replace that with seed load/save) - Moved momir and Co rules configuration out of GameStateDuel - Create a GameType type to avoid mixing int everywhere
This commit is contained in:
@@ -97,7 +97,7 @@ int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
|
||||
actionTargets.erase(actionTargets.begin() + f);
|
||||
}
|
||||
}
|
||||
std::random_shuffle(actionTargets.begin(), actionTargets.end());
|
||||
std::random_shuffle(actionTargets.begin(), actionTargets.end(), MRand);
|
||||
//shuffle to make it less predictable, otherwise ai will always seem to target from right to left. making it very obvious.
|
||||
for(int k = 0;k < int(actionTargets.size());k++)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ int AIPlayer::clickMultiTarget(TargetChooser * tc, vector<Targetable*>& potentia
|
||||
potentialTargets.erase(potentialTargets.begin() + f);
|
||||
}
|
||||
}
|
||||
std::random_shuffle(potentialTargets.begin(), potentialTargets.end());
|
||||
std::random_shuffle(potentialTargets.begin(), potentialTargets.end(), MRand);
|
||||
if(potentialTargets.size())
|
||||
clickstream.push(NEW AIAction(this, NULL,tc->source,potentialTargets));
|
||||
while(clickstream.size())
|
||||
@@ -257,7 +257,7 @@ AIPlayer * AIPlayerFactory::createAIPlayer(GameObserver *observer, MTGAllCards *
|
||||
{
|
||||
bool isOpponentAI = opponent->isAI() == 1;
|
||||
DeckMetaData *meta = DeckManager::GetInstance()->getDeckMetaDataByFilename( opponent->deckFile, isOpponentAI);
|
||||
if ( meta->getVictoryPercentage() >= 65)
|
||||
if ( meta && meta->getVictoryPercentage() >= 65)
|
||||
deckSetting = HARD;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user