1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Support for defining new campaign regions in mods, for hota h3c

This commit is contained in:
Ivan Savenko
2025-05-30 18:27:54 +03:00
parent 1ea2ce7959
commit a842dfb3c4
27 changed files with 677 additions and 477 deletions

View File

@@ -750,16 +750,14 @@ uint64_t CGHeroInstance::getValueForDiplomacy() const
uint32_t CGHeroInstance::getValueForCampaign() const
{
/// Determined by testing H3: hero is preferred for transfer in campaigns if total sum of his primary skills and his secondary skill levels is greatest
uint32_t score = 0;
// Determined by testing H3: hero is preferred for transfer in campaigns if total sum of his primary skills and his secondary skill levels is greatest
// Additional info from wiki: https://heroes.thelazy.net/index.php/Power_rating
uint32_t score = level;
score += getPrimSkillLevel(PrimarySkill::ATTACK);
score += getPrimSkillLevel(PrimarySkill::DEFENSE);
score += getPrimSkillLevel(PrimarySkill::SPELL_POWER);
score += getPrimSkillLevel(PrimarySkill::DEFENSE);
for (const auto& secondary : secSkills)
score += secondary.second;
return score;
}