diff --git a/config/bonuses.json b/config/bonuses.json index 7ae0bade3..cc0f38b38 100644 --- a/config/bonuses.json +++ b/config/bonuses.json @@ -368,6 +368,11 @@ "icon": "zvs/Lib1.res/E_OBST" } }, + + "NO_TERRAIN_PENALTY": + { + "hidden": true + }, "NON_LIVING": { diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index ff5f32f63..1603c2966 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -215,6 +215,7 @@ public: BONUS_NAME(ADDITIONAL_UNITS) /*val of units with id = subtype will be added to hero's army at the beginning of battle */\ BONUS_NAME(SPOILS_OF_WAR) /*val * 10^-6 * gained exp resources of subtype will be given to hero after battle*/\ BONUS_NAME(BLOCK)\ + BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\ BONUS_NAME(DISGUISED) /* subtype - spell level */\ BONUS_NAME(VISIONS) /* subtype - spell level */ diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index 48b091b45..2831aaf8d 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -83,8 +83,6 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &fro } else { - //FIXME: in H3 presence of Nomad in army will remove terrain penalty for sand. Bonus not implemented in VCMI - // NOTE: in H3 neutral stacks will ignore terrain penalty only if placed as topmost stack(s) in hero army. // This is clearly bug in H3 however intended behaviour is not clear. // Current VCMI behaviour will ignore neutrals in calculations so army in VCMI @@ -101,7 +99,7 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &fro break; } } - if (!nativeArmy) + if(!nativeArmy && !hasBonusOfType(Bonus::NO_TERRAIN_PENALTY, from.terType)) { ret = VLC->heroh->terrCosts[from.terType]; ret-=getSecSkillLevel(SecondarySkill::PATHFINDING)*25;