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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user