1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Small refactoring of adventure map spell casting:

- Removed duplicated checks for DD possibility
- Moved most of spell-specific code from AdventureMapInterface to library
code
- AdventureSpellMechanics class now provides methods to check whether
spellcast is possible, similarly to battle spells
- If it is not possible to cast adventure map spell (e.g. no mana or no
move points) game will show infowindow immediately on clicking spellbook
instead of on cast attempt
- If hero does not have movement points for a DD, game will show correct
error message
- Added game settings 'dimensionDoorFailureSpendsPoints' due to
discovered H3 logic
This commit is contained in:
Ivan Savenko
2024-04-10 18:19:48 +03:00
parent bcd4a8c961
commit 8353bca34f
15 changed files with 285 additions and 289 deletions

View File

@@ -105,6 +105,7 @@ void GameSettings::load(const JsonNode & input)
{EGameSettings::PATHFINDER_ORIGINAL_FLY_RULES, "pathfinder", "originalFlyRules" },
{EGameSettings::DIMENSION_DOOR_ONLY_TO_UNCOVERED_TILES, "spells", "dimensionDoorOnlyToUncoveredTiles"},
{EGameSettings::DIMENSION_DOOR_EXPOSES_TERRAIN_TYPE, "spells", "dimensionDoorExposesTerrainType" },
{EGameSettings::DIMENSION_DOOR_FAILURE_SPENDS_POINTS, "spells", "dimensionDoorFailureSpendsPoints" },
{EGameSettings::DIMENSION_DOOR_TRIGGERS_GUARDS, "spells", "dimensionDoorTriggersGuards" },
{EGameSettings::DIMENSION_DOOR_TOURNAMENT_RULES_LIMIT, "spells", "dimensionDoorTournamentRulesLimit"},
{EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP, "towns", "buildingsPerTurnCap" },