mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
basic handicap support
This commit is contained in:
@@ -387,10 +387,14 @@ void CGameState::initDifficulty()
|
||||
const JsonNode & difficultyAI(config["ai"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
|
||||
const JsonNode & difficultyHuman(config["human"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
|
||||
|
||||
auto setDifficulty = [](PlayerState & state, const JsonNode & json)
|
||||
auto setDifficulty = [this](PlayerState & state, const JsonNode & json)
|
||||
{
|
||||
//set starting resources
|
||||
state.resources = TResources(json["resources"]);
|
||||
|
||||
//handicap
|
||||
const PlayerSettings &ps = scenarioOps->getIthPlayersSettings(state.color);
|
||||
state.resources += ps.handicap;
|
||||
|
||||
//set global bonuses
|
||||
for(auto & jsonBonus : json["globalBonuses"].Vector())
|
||||
|
||||
Reference in New Issue
Block a user