1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Implement NO_TERRAIN_PENALTY bonus

Penalty of specified terrain type is ignored if hero have this bonus
This commit is contained in:
ArseniyShestakov 2015-10-15 01:09:02 +03:00
parent fca4deaad2
commit 52a52dcfd9
3 changed files with 7 additions and 3 deletions

View File

@ -368,6 +368,11 @@
"icon": "zvs/Lib1.res/E_OBST" "icon": "zvs/Lib1.res/E_OBST"
} }
}, },
"NO_TERRAIN_PENALTY":
{
"hidden": true
},
"NON_LIVING": "NON_LIVING":
{ {

View File

@ -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(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(SPOILS_OF_WAR) /*val * 10^-6 * gained exp resources of subtype will be given to hero after battle*/\
BONUS_NAME(BLOCK)\ BONUS_NAME(BLOCK)\
BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\
BONUS_NAME(DISGUISED) /* subtype - spell level */\ BONUS_NAME(DISGUISED) /* subtype - spell level */\
BONUS_NAME(VISIONS) /* subtype - spell level */ BONUS_NAME(VISIONS) /* subtype - spell level */

View File

@ -83,8 +83,6 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &fro
} }
else 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. // 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. // This is clearly bug in H3 however intended behaviour is not clear.
// Current VCMI behaviour will ignore neutrals in calculations so army in VCMI // 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; break;
} }
} }
if (!nativeArmy) if(!nativeArmy && !hasBonusOfType(Bonus::NO_TERRAIN_PENALTY, from.terType))
{ {
ret = VLC->heroh->terrCosts[from.terType]; ret = VLC->heroh->terrCosts[from.terType];
ret-=getSecSkillLevel(SecondarySkill::PATHFINDING)*25; ret-=getSecSkillLevel(SecondarySkill::PATHFINDING)*25;