1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

allow more than 8 skills

This commit is contained in:
Laserlicht
2025-06-19 19:02:39 +02:00
parent 678408c02c
commit b0f5c4dd7b
8 changed files with 15 additions and 7 deletions

View File

@@ -20,6 +20,7 @@
#include "../../../lib/CCreatureHandler.h" #include "../../../lib/CCreatureHandler.h"
#include "../../../lib/GameLibrary.h" #include "../../../lib/GameLibrary.h"
#include "../../../lib/StartInfo.h" #include "../../../lib/StartInfo.h"
#include "../../../lib/GameSettings.h"
#include "../../../lib/filesystem/Filesystem.h" #include "../../../lib/filesystem/Filesystem.h"
#include "../Goals/ExecuteHeroChain.h" #include "../Goals/ExecuteHeroChain.h"
#include "../Goals/BuildThis.h" #include "../Goals/BuildThis.h"
@@ -581,7 +582,7 @@ float RewardEvaluator::evaluateWitchHutSkillScore(const CGObjectInstance * hut,
return role == HeroRole::SCOUT ? 2 : 0; return role == HeroRole::SCOUT ? 2 : 0;
if(hero->getSecSkillLevel(skill) != MasteryLevel::NONE if(hero->getSecSkillLevel(skill) != MasteryLevel::NONE
|| hero->secSkills.size() >= GameConstants::SKILL_PER_HERO) || static_cast<int>(hero->secSkills.size()) >= cb->getSettings().getInteger(EGameSettings::HEROES_SKILL_PER_HERO))
return 0; return 0;
auto score = ai->heroManager->evaluateSecSkill(skill, hero); auto score = ai->heroManager->evaluateSecSkill(skill, hero);

View File

@@ -40,7 +40,8 @@
#include "../../lib/mapObjects/CGHeroInstance.h" #include "../../lib/mapObjects/CGHeroInstance.h"
#include "../../lib/mapObjects/CGTownInstance.h" #include "../../lib/mapObjects/CGTownInstance.h"
#include "../../lib/mapObjects/MiscObjects.h" #include "../../lib/mapObjects/MiscObjects.h"
#include "../../lib/texts/CGeneralTextHandler.h" #include "texts/CGeneralTextHandler.h"
#include "../../lib/GameSettings.h"
static const std::string OVERVIEW_BACKGROUND = "OvCast.pcx"; static const std::string OVERVIEW_BACKGROUND = "OvCast.pcx";
static const size_t OVERVIEW_SIZE = 4; static const size_t OVERVIEW_SIZE = 4;
@@ -978,7 +979,7 @@ CHeroItem::CHeroItem(const CGHeroInstance * Hero)
heroInfo.push_back(std::make_shared<InfoBox>(Point(78+(int)i*36, 26), InfoBox::POS_DOWN, InfoBox::SIZE_SMALL, data)); heroInfo.push_back(std::make_shared<InfoBox>(Point(78+(int)i*36, 26), InfoBox::POS_DOWN, InfoBox::SIZE_SMALL, data));
} }
for(size_t i=0; i<GameConstants::SKILL_PER_HERO; i++) for(size_t i=0; i<GAME->interface()->cb->getSettings().getInteger(EGameSettings::HEROES_SKILL_PER_HERO); i++)
{ {
auto data = std::make_shared<InfoBoxHeroData>(IInfoBoxData::HERO_SECONDARY_SKILL, hero, (int)i); auto data = std::make_shared<InfoBoxHeroData>(IInfoBoxData::HERO_SECONDARY_SKILL, hero, (int)i);
heroInfo.push_back(std::make_shared<InfoBox>(Point(410+(int)i*36, 5), InfoBox::POS_NONE, InfoBox::SIZE_SMALL, data)); heroInfo.push_back(std::make_shared<InfoBox>(Point(410+(int)i*36, 5), InfoBox::POS_NONE, InfoBox::SIZE_SMALL, data));

View File

@@ -313,7 +313,10 @@
/// movement points hero can get on start of the turn when on land, depending on speed of slowest creature (0-based list) /// movement points hero can get on start of the turn when on land, depending on speed of slowest creature (0-based list)
"movementPointsLand" : [ 1500, 1500, 1500, 1500, 1560, 1630, 1700, 1760, 1830, 1900, 1960, 2000 ], "movementPointsLand" : [ 1500, 1500, 1500, 1500, 1560, 1630, 1700, 1760, 1830, 1900, 1960, 2000 ],
/// movement points hero can get on start of the turn when on sea, depending on speed of slowest creature (0-based list) /// movement points hero can get on start of the turn when on sea, depending on speed of slowest creature (0-based list)
"movementPointsSea" : [ 1500 ] "movementPointsSea" : [ 1500 ],
/// maximal secondary skills per hero
"skillPerHero" : 8
}, },
"towns": "towns":

View File

@@ -47,7 +47,8 @@
"minimalPrimarySkills" : { "type" : "array" }, "minimalPrimarySkills" : { "type" : "array" },
"movementCostBase" : { "type" : "number" }, "movementCostBase" : { "type" : "number" },
"movementPointsLand" : { "type" : "array" }, "movementPointsLand" : { "type" : "array" },
"movementPointsSea" : { "type" : "array" } "movementPointsSea" : { "type" : "array" },
"skillPerHero" : { "type" : "number" }
} }
}, },
"towns" : { "towns" : {

View File

@@ -86,6 +86,7 @@ const std::vector<GameSettings::SettingOption> GameSettings::settingProperties =
{EGameSettings::HEROES_MOVEMENT_COST_BASE, "heroes", "movementCostBase" }, {EGameSettings::HEROES_MOVEMENT_COST_BASE, "heroes", "movementCostBase" },
{EGameSettings::HEROES_MOVEMENT_POINTS_LAND, "heroes", "movementPointsLand" }, {EGameSettings::HEROES_MOVEMENT_POINTS_LAND, "heroes", "movementPointsLand" },
{EGameSettings::HEROES_MOVEMENT_POINTS_SEA, "heroes", "movementPointsSea" }, {EGameSettings::HEROES_MOVEMENT_POINTS_SEA, "heroes", "movementPointsSea" },
{EGameSettings::HEROES_SKILL_PER_HERO, "heroes", "skillPerHero" },
{EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE, "mapFormat", "armageddonsBlade" }, {EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE, "mapFormat", "armageddonsBlade" },
{EGameSettings::MAP_FORMAT_CHRONICLES, "mapFormat", "chronicles" }, {EGameSettings::MAP_FORMAT_CHRONICLES, "mapFormat", "chronicles" },
{EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS, "mapFormat", "hornOfTheAbyss" }, {EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS, "mapFormat", "hornOfTheAbyss" },

View File

@@ -59,6 +59,7 @@ enum class EGameSettings
HEROES_MOVEMENT_COST_BASE, HEROES_MOVEMENT_COST_BASE,
HEROES_MOVEMENT_POINTS_LAND, HEROES_MOVEMENT_POINTS_LAND,
HEROES_MOVEMENT_POINTS_SEA, HEROES_MOVEMENT_POINTS_SEA,
HEROES_SKILL_PER_HERO,
MAP_FORMAT_ARMAGEDDONS_BLADE, MAP_FORMAT_ARMAGEDDONS_BLADE,
MAP_FORMAT_CHRONICLES, MAP_FORMAT_CHRONICLES,
MAP_FORMAT_HORN_OF_THE_ABYSS, MAP_FORMAT_HORN_OF_THE_ABYSS,

View File

@@ -34,7 +34,6 @@ namespace GameConstants
constexpr int BATTLE_SHOOTING_PENALTY_DISTANCE = 10; //if the distance is > than this, then shooting stack has distance penalty constexpr int BATTLE_SHOOTING_PENALTY_DISTANCE = 10; //if the distance is > than this, then shooting stack has distance penalty
constexpr int BATTLE_SHOOTING_RANGE_DISTANCE = std::numeric_limits<uint8_t>::max(); // used when shooting stack has no shooting range limit constexpr int BATTLE_SHOOTING_RANGE_DISTANCE = std::numeric_limits<uint8_t>::max(); // used when shooting stack has no shooting range limit
constexpr int ARMY_SIZE = 7; constexpr int ARMY_SIZE = 7;
constexpr int SKILL_PER_HERO = 8;
constexpr ui32 HERO_HIGH_LEVEL = 10; // affects primary skill upgrade order constexpr ui32 HERO_HIGH_LEVEL = 10; // affects primary skill upgrade order
constexpr int SKILL_QUANTITY=28; constexpr int SKILL_QUANTITY=28;

View File

@@ -30,6 +30,7 @@
#include "../CCreatureHandler.h" #include "../CCreatureHandler.h"
#include "../mapping/CMap.h" #include "../mapping/CMap.h"
#include "../StartInfo.h" #include "../StartInfo.h"
#include "../GameSettings.h"
#include "CGTownInstance.h" #include "CGTownInstance.h"
#include "../entities/artifact/ArtifactUtils.h" #include "../entities/artifact/ArtifactUtils.h"
#include "../entities/artifact/CArtifact.h" #include "../entities/artifact/CArtifact.h"
@@ -175,7 +176,7 @@ int3 CGHeroInstance::convertFromVisitablePos(const int3 & position) const
bool CGHeroInstance::canLearnSkill() const bool CGHeroInstance::canLearnSkill() const
{ {
return secSkills.size() < GameConstants::SKILL_PER_HERO; return secSkills.size() < cb->getSettings().getInteger(EGameSettings::HEROES_SKILL_PER_HERO);
} }
bool CGHeroInstance::canLearnSkill(const SecondarySkill & which) const bool CGHeroInstance::canLearnSkill(const SecondarySkill & which) const