mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
commit
d34dd8676e
@ -107,7 +107,7 @@ void ExecuteHeroChain::accept(AIGateway * ai)
|
||||
|| targetNode->turns != 0)
|
||||
{
|
||||
logAi->error(
|
||||
"Enable to complete chain. Expected hero %s to arive to %s in 0 turns but he can not do this",
|
||||
"Unable to complete chain. Expected hero %s to arrive to %s in 0 turns but he cannot do this",
|
||||
hero->name,
|
||||
node.coord.toString());
|
||||
|
||||
|
@ -1019,6 +1019,7 @@ TurnInfo::BonusCache::BonusCache(TConstBonusListPtr bl)
|
||||
flyingMovementVal = bl->valOfBonuses(Selector::type()(Bonus::FLYING_MOVEMENT));
|
||||
waterWalking = static_cast<bool>(bl->getFirst(Selector::type()(Bonus::WATER_WALKING)));
|
||||
waterWalkingVal = bl->valOfBonuses(Selector::type()(Bonus::WATER_WALKING));
|
||||
pathfindingVal = bl->valOfBonuses(Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::PATHFINDING));
|
||||
}
|
||||
|
||||
TurnInfo::TurnInfo(const CGHeroInstance * Hero, const int turn)
|
||||
@ -1075,6 +1076,9 @@ int TurnInfo::valOfBonuses(Bonus::BonusType type, int subtype) const
|
||||
return bonusCache->flyingMovementVal;
|
||||
case Bonus::WATER_WALKING:
|
||||
return bonusCache->waterWalkingVal;
|
||||
case Bonus::SECONDARY_SKILL_PREMY:
|
||||
if (subtype == SecondarySkill::PATHFINDING)
|
||||
return bonusCache->pathfindingVal;
|
||||
}
|
||||
|
||||
return bonuses->valOfBonuses(Selector::type()(type).And(Selector::subtype()(subtype)));
|
||||
|
@ -513,6 +513,7 @@ struct DLL_LINKAGE TurnInfo
|
||||
int flyingMovementVal;
|
||||
bool waterWalking;
|
||||
int waterWalkingVal;
|
||||
int pathfindingVal;
|
||||
|
||||
BonusCache(TConstBonusListPtr bonusList);
|
||||
};
|
||||
|
@ -103,11 +103,9 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile & dest, const TerrainTile & f
|
||||
&& !ti->hasBonusOfType(Bonus::NO_TERRAIN_PENALTY, from.terType.id()) //no special movement bonus
|
||||
)
|
||||
{
|
||||
static const CSelector selectorPATHFINDING = Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::PATHFINDING);
|
||||
static const std::string keyPATHFINDING = "type_"+std::to_string((si32)Bonus::SECONDARY_SKILL_PREMY)+"s_"+std::to_string((si32)SecondarySkill::PATHFINDING);
|
||||
|
||||
ret = VLC->heroh->terrCosts[from.terType];
|
||||
ret -= valOfBonuses(selectorPATHFINDING, keyPATHFINDING);
|
||||
ret -= ti->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::PATHFINDING);
|
||||
if(ret < GameConstants::BASE_MOVEMENT_COST)
|
||||
ret = GameConstants::BASE_MOVEMENT_COST;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user