1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

vcmi: add a last hex setting

I consider this behaviour as H3 bug, but this is H3.
So, added a setting to disable this behaviour.
This commit is contained in:
Konstantin 2023-03-27 02:29:20 +03:00
parent 35e8ce2ead
commit f704a17e1a
4 changed files with 12 additions and 2 deletions

View File

@ -165,7 +165,9 @@
// every 1 defense point damage influence in battle when defense points > attack points during creature attack
"defensePointDamageFactor": 0.025,
// limit of damage reduction that can be achieved by overpowering defense points
"defensePointDamageFactorCap": 0.7
"defensePointDamageFactorCap": 0.7,
// If set to true, double-wide creatures will trigger obstacle effect when moving one tile forward or backwards
"oneHexTriggersObstacles": false
},
"creatures":

View File

@ -58,6 +58,7 @@ void GameSettings::load(const JsonNode & input)
{EGameSettings::COMBAT_DEFENSE_POINT_DAMAGE_FACTOR_CAP, "combat", "defensePointDamageFactorCap"},
{EGameSettings::COMBAT_GOOD_LUCK_DICE, "combat", "goodLuckDice" },
{EGameSettings::COMBAT_GOOD_MORALE_DICE, "combat", "goodMoraleDice" },
{EGameSettings::COMBAT_ONE_HEX_TRIGGERS_OBSTACLES, "combat", "oneHexTriggersObstacles" },
{EGameSettings::CREATURES_ALLOW_ALL_FOR_DOUBLE_MONTH, "creatures", "allowAllForDoubleMonth" },
{EGameSettings::CREATURES_ALLOW_RANDOM_SPECIAL_WEEKS, "creatures", "allowRandomSpecialWeeks" },
{EGameSettings::CREATURES_DAILY_STACK_EXPERIENCE, "creatures", "dailyStackExperience" },

View File

@ -54,6 +54,7 @@ enum class EGameSettings
TEXTS_TERRAIN,
TOWNS_BUILDINGS_PER_TURN_CAP,
TOWNS_STARTING_DWELLING_CHANCES,
COMBAT_ONE_HEX_TRIGGERS_OBSTACLES,
OPTIONS_COUNT
};

View File

@ -1559,7 +1559,13 @@ int CGameHandler::moveStack(int stack, BattleHex dest)
stackIsMoving = false;
}
}
//handle last hex separately for deviation
if (VLC->settings()->getBoolean(EGameSettings::COMBAT_ONE_HEX_TRIGGERS_OBSTACLES))
{
if (dest == battle::Unit::occupiedHex(start, curStack->doubleWide(), curStack->side)
|| start == battle::Unit::occupiedHex(dest, curStack->doubleWide(), curStack->side))
passed.clear(); //Just empty passed, obstacles will handled automatically
}
//handling obstacle on the final field (separate, because it affects both flying and walking stacks)
handleDamageFromObstacle(curStack, false, passed);