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

Store penalty in value of FLYING_MOVEMENT and WATER_WALKING

This commit is contained in:
ArseniyShestakov
2015-10-26 18:30:11 +03:00
parent 44ca00cd16
commit 68bd37aa45
4 changed files with 14 additions and 22 deletions

View File

@@ -2112,10 +2112,7 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
if(d.blocked && h->canFly())
{
if(h->hasBonusOfType(Bonus::FLYING_MOVEMENT, 1)) // base flying
ret *= 1.4; //40% penalty for movement over blocked tile
else if(h->hasBonusOfType(Bonus::FLYING_MOVEMENT, 2)) // advanced flying
ret *= 1.2;
ret *= (100.0 + h->valOfBonuses(Bonus::FLYING_MOVEMENT)) / 100.0;
}
else if(d.terType == ETerrainType::WATER)
{
@@ -2123,10 +2120,7 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
ret *= 0.666;
else if(!h->boat && h->canWalkOnSea())
{
if(h->hasBonusOfType(Bonus::WATER_WALKING, 1)) // base
ret *= 1.4; //40% penalty for water walking
else if(h->hasBonusOfType(Bonus::WATER_WALKING, 2)) // advanced
ret *= 1.2;
ret *= (100.0 + h->valOfBonuses(Bonus::WATER_WALKING)) / 100.0;
}
}