mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Moved some pathfinding options to game settings
This commit is contained in:
parent
6546242c03
commit
e0ea994656
@ -41,6 +41,11 @@ namespace AIPathfinding
|
||||
std::shared_ptr<AINodeStorage> nodeStorage)
|
||||
:PathfinderConfig(nodeStorage, makeRuleset(cb, ai, nodeStorage)), hero(nodeStorage->getHero())
|
||||
{
|
||||
options.useEmbarkAndDisembark = true;
|
||||
options.useTeleportTwoWay = true;
|
||||
options.useTeleportOneWay = true;
|
||||
options.useTeleportOneWayRandom = true;
|
||||
options.useTeleportWhirlpool = true;
|
||||
}
|
||||
|
||||
AIPathfinderConfig::~AIPathfinderConfig() = default;
|
||||
|
@ -329,6 +329,20 @@
|
||||
"commanders": false
|
||||
},
|
||||
|
||||
"pathfinder" :
|
||||
{
|
||||
// if enabled, pathfinder will take use of any available boats
|
||||
"useBoat" : true,
|
||||
// if enabled, pathfinder will take use of any bidirectional monoliths
|
||||
"useMonolithTwoWay" : true,
|
||||
// if enabled, pathfinder will take use of one-way monolith that only have one known exit
|
||||
"useMonolithOneWayUnique" : false,
|
||||
// if enabled, pathfinder will take use of one-way monoliths with multiple exits.
|
||||
"useMonolithOneWayRandom" : false,
|
||||
// if enabled and hero has whirlpool protection effect, pathfinder will take use of whirpools
|
||||
"useWhirlpool" : true
|
||||
},
|
||||
|
||||
"bonuses" :
|
||||
{
|
||||
"global" :
|
||||
|
@ -3,7 +3,7 @@
|
||||
{
|
||||
"type" : "object",
|
||||
"$schema" : "http://json-schema.org/draft-04/schema",
|
||||
"required" : [ "general", "video", "adventure", "pathfinder", "battle", "server", "logging", "launcher", "gameTweaks" ],
|
||||
"required" : [ "general", "video", "adventure", "battle", "server", "logging", "launcher", "gameTweaks" ],
|
||||
"definitions" : {
|
||||
"logLevelEnum" : {
|
||||
"type" : "string",
|
||||
@ -221,74 +221,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"pathfinder" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"default" : {},
|
||||
"required" : [ "teleports", "layers", "oneTurnSpecialLayersLimit", "originalMovementRules", "lightweightFlyingMode" ],
|
||||
"properties" : {
|
||||
"layers" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"default" : {},
|
||||
"required" : [ "sailing", "waterWalking", "flying" ],
|
||||
"properties" : {
|
||||
"sailing" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"waterWalking" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"flying" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
}
|
||||
}
|
||||
},
|
||||
"teleports" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"default" : {},
|
||||
"required" : [ "twoWay", "oneWay", "oneWayRandom", "whirlpool", "castleGate" ],
|
||||
"properties" : {
|
||||
"twoWay" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"oneWay" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"oneWayRandom" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
},
|
||||
"whirlpool" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"castleGate" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"oneTurnSpecialLayersLimit" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
},
|
||||
"originalMovementRules" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
},
|
||||
"lightweightFlyingMode" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"battle" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
|
@ -91,6 +91,11 @@ void GameSettings::load(const JsonNode & input)
|
||||
{EGameSettings::TEXTS_ROAD, "textData", "road" },
|
||||
{EGameSettings::TEXTS_SPELL, "textData", "spell" },
|
||||
{EGameSettings::TEXTS_TERRAIN, "textData", "terrain" },
|
||||
{EGameSettings::PATHFINDER_USE_BOAT, "pathfinder", "useBoat" },
|
||||
{EGameSettings::PATHFINDER_USE_MONOLITH_TWO_WAY, "pathfinder", "useMonolithTwoWay" },
|
||||
{EGameSettings::PATHFINDER_USE_MONOLITH_ONE_WAY_UNIQUE, "pathfinder", "useMonolithOneWayUnique" },
|
||||
{EGameSettings::PATHFINDER_USE_MONOLITH_ONE_WAY_RANDOM, "pathfinder", "useMonolithOneWayRandom" },
|
||||
{EGameSettings::PATHFINDER_USE_WHIRLPOOL, "pathfinder", "useWhirlpool" },
|
||||
{EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP, "towns", "buildingsPerTurnCap" },
|
||||
{EGameSettings::TOWNS_STARTING_DWELLING_CHANCES, "towns", "startingDwellingChances" },
|
||||
};
|
||||
|
@ -57,6 +57,11 @@ enum class EGameSettings
|
||||
MAP_FORMAT_HORN_OF_THE_ABYSS,
|
||||
MAP_FORMAT_JSON_VCMI,
|
||||
MAP_FORMAT_IN_THE_WAKE_OF_GODS,
|
||||
PATHFINDER_USE_BOAT,
|
||||
PATHFINDER_USE_MONOLITH_TWO_WAY,
|
||||
PATHFINDER_USE_MONOLITH_ONE_WAY_UNIQUE,
|
||||
PATHFINDER_USE_MONOLITH_ONE_WAY_RANDOM,
|
||||
PATHFINDER_USE_WHIRLPOOL,
|
||||
TOWNS_BUILDINGS_PER_TURN_CAP,
|
||||
TOWNS_STARTING_DWELLING_CHANCES,
|
||||
COMBAT_ONE_HEX_TRIGGERS_OBSTACLES,
|
||||
|
@ -10,7 +10,8 @@
|
||||
#include "StdInc.h"
|
||||
#include "PathfinderOptions.h"
|
||||
|
||||
#include "../CConfigHandler.h"
|
||||
#include "../GameSettings.h"
|
||||
#include "../VCMI_Lib.h"
|
||||
#include "NodeStorage.h"
|
||||
#include "PathfindingRules.h"
|
||||
#include "CPathfinder.h"
|
||||
@ -18,20 +19,18 @@
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
PathfinderOptions::PathfinderOptions()
|
||||
: useFlying(true)
|
||||
, useWaterWalking(true)
|
||||
, useEmbarkAndDisembark(VLC->settings()->getBoolean(EGameSettings::PATHFINDER_USE_BOAT))
|
||||
, useTeleportTwoWay(VLC->settings()->getBoolean(EGameSettings::PATHFINDER_USE_MONOLITH_TWO_WAY))
|
||||
, useTeleportOneWay(VLC->settings()->getBoolean(EGameSettings::PATHFINDER_USE_MONOLITH_ONE_WAY_UNIQUE))
|
||||
, useTeleportOneWayRandom(VLC->settings()->getBoolean(EGameSettings::PATHFINDER_USE_MONOLITH_ONE_WAY_RANDOM))
|
||||
, useTeleportWhirlpool(VLC->settings()->getBoolean(EGameSettings::PATHFINDER_USE_WHIRLPOOL))
|
||||
, useCastleGate(false)
|
||||
, lightweightFlyingMode(false)
|
||||
, oneTurnSpecialLayersLimit(true)
|
||||
, originalMovementRules(false)
|
||||
{
|
||||
useFlying = settings["pathfinder"]["layers"]["flying"].Bool();
|
||||
useWaterWalking = settings["pathfinder"]["layers"]["waterWalking"].Bool();
|
||||
useEmbarkAndDisembark = settings["pathfinder"]["layers"]["sailing"].Bool();
|
||||
useTeleportTwoWay = settings["pathfinder"]["teleports"]["twoWay"].Bool();
|
||||
useTeleportOneWay = settings["pathfinder"]["teleports"]["oneWay"].Bool();
|
||||
useTeleportOneWayRandom = settings["pathfinder"]["teleports"]["oneWayRandom"].Bool();
|
||||
useTeleportWhirlpool = settings["pathfinder"]["teleports"]["whirlpool"].Bool();
|
||||
|
||||
useCastleGate = settings["pathfinder"]["teleports"]["castleGate"].Bool();
|
||||
|
||||
lightweightFlyingMode = settings["pathfinder"]["lightweightFlyingMode"].Bool();
|
||||
oneTurnSpecialLayersLimit = settings["pathfinder"]["oneTurnSpecialLayersLimit"].Bool();
|
||||
originalMovementRules = settings["pathfinder"]["originalMovementRules"].Bool();
|
||||
}
|
||||
|
||||
PathfinderConfig::PathfinderConfig(std::shared_ptr<INodeStorage> nodeStorage, std::vector<std::shared_ptr<IPathfindingRule>> rules):
|
||||
|
Loading…
Reference in New Issue
Block a user