mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-31 22:05:10 +02:00
Update PriorityEvaluator.cpp
Basic dwellings get a score-boost to take into consideration that units are immediately hirerable as opposed to just being added at the beginning of next weak. This means they should win out against early Citadels more. Handling for conditional quicker mage-guild-upgrading incase of caster-mains.
This commit is contained in:
parent
765658ec83
commit
64ff6a0631
@ -1223,7 +1223,7 @@ public:
|
|||||||
if(bi.baseCreatureID == bi.creatureID)
|
if(bi.baseCreatureID == bi.creatureID)
|
||||||
{
|
{
|
||||||
evaluationContext.addNonCriticalStrategicalValue((0.5f + 0.1f * bi.creatureLevel) / (float)bi.prerequisitesCount);
|
evaluationContext.addNonCriticalStrategicalValue((0.5f + 0.1f * bi.creatureLevel) / (float)bi.prerequisitesCount);
|
||||||
evaluationContext.armyReward += bi.armyStrength;
|
evaluationContext.armyReward += bi.armyStrength * 1.5;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1244,9 +1244,25 @@ public:
|
|||||||
else if(bi.id >= BuildingID::MAGES_GUILD_1 && bi.id <= BuildingID::MAGES_GUILD_5)
|
else if(bi.id >= BuildingID::MAGES_GUILD_1 && bi.id <= BuildingID::MAGES_GUILD_5)
|
||||||
{
|
{
|
||||||
evaluationContext.skillReward += 2 * (bi.id - BuildingID::MAGES_GUILD_1);
|
evaluationContext.skillReward += 2 * (bi.id - BuildingID::MAGES_GUILD_1);
|
||||||
|
bool alreadyOwn = false;
|
||||||
|
int highestMageGuildPossible = BuildingID::MAGES_GUILD_3;
|
||||||
|
for (auto town : evaluationContext.evaluator.ai->cb->getTownsInfo())
|
||||||
|
{
|
||||||
|
if (town->hasBuilt(bi.id))
|
||||||
|
alreadyOwn = true;
|
||||||
|
if (evaluationContext.evaluator.ai->cb->canBuildStructure(town, BuildingID::MAGES_GUILD_5) != EBuildingState::FORBIDDEN)
|
||||||
|
highestMageGuildPossible = BuildingID::MAGES_GUILD_5;
|
||||||
|
else if (evaluationContext.evaluator.ai->cb->canBuildStructure(town, BuildingID::MAGES_GUILD_4) != EBuildingState::FORBIDDEN)
|
||||||
|
highestMageGuildPossible = BuildingID::MAGES_GUILD_4;
|
||||||
|
}
|
||||||
|
if (!alreadyOwn && evaluationContext.evaluator.ai->cb->canBuildStructure(buildThis.town, highestMageGuildPossible) != EBuildingState::FORBIDDEN)
|
||||||
|
{
|
||||||
for (auto hero : evaluationContext.evaluator.ai->cb->getHeroesInfo())
|
for (auto hero : evaluationContext.evaluator.ai->cb->getHeroesInfo())
|
||||||
{
|
{
|
||||||
evaluationContext.armyInvolvement += hero->getArmyCost();
|
if(hero->getPrimSkillLevel(PrimarySkill::SPELL_POWER) + hero->getPrimSkillLevel(PrimarySkill::KNOWLEDGE) > hero->getPrimSkillLevel(PrimarySkill::ATTACK) + hero->getPrimSkillLevel(PrimarySkill::DEFENSE)
|
||||||
|
&& hero->manaLimit() > 30)
|
||||||
|
evaluationContext.armyReward += hero->getArmyCost();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sameTownBonus = 0;
|
int sameTownBonus = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user