mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Working version of dimension door triggering guards
This commit is contained in:
parent
3bb66de551
commit
f51e1a0ba6
@ -394,7 +394,9 @@
|
||||
// if enabled, dimension work doesn't work into tiles under Fog of War
|
||||
"dimensionDoorOnlyToUncoveredTiles" : false,
|
||||
// if enabled, dimension door will hint regarding tile being incompatible terrain type, unlike H3 (water/land)
|
||||
"dimensionDoorExposesTerrainType" : false
|
||||
"dimensionDoorExposesTerrainType" : false,
|
||||
// if enabled, dimension door will initiate a fight upon landing on tile adjacent to neutral creature
|
||||
"dimensionDoorTriggersGuards" : false
|
||||
},
|
||||
|
||||
"bonuses" :
|
||||
|
@ -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_TRIGGERS_GUARDS, "spells", "dimensionDoorTriggersGuards" },
|
||||
{EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP, "towns", "buildingsPerTurnCap" },
|
||||
{EGameSettings::TOWNS_STARTING_DWELLING_CHANCES, "towns", "startingDwellingChances" },
|
||||
};
|
||||
|
@ -72,6 +72,7 @@ enum class EGameSettings
|
||||
COMBAT_ONE_HEX_TRIGGERS_OBSTACLES,
|
||||
DIMENSION_DOOR_ONLY_TO_UNCOVERED_TILES,
|
||||
DIMENSION_DOOR_EXPOSES_TERRAIN_TYPE,
|
||||
DIMENSION_DOOR_TRIGGERS_GUARDS,
|
||||
|
||||
OPTIONS_COUNT
|
||||
};
|
||||
|
@ -1254,7 +1254,11 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
|
||||
if (blockingVisit()) // e.g. hero on the other side of teleporter
|
||||
return true;
|
||||
|
||||
doMove(TryMoveHero::TELEPORTATION, IGNORE_GUARDS, DONT_VISIT_DEST, LEAVING_TILE);
|
||||
EGuardLook guardsCheck = VLC->settings()->getBoolean(EGameSettings::DIMENSION_DOOR_TRIGGERS_GUARDS)
|
||||
? CHECK_FOR_GUARDS
|
||||
: IGNORE_GUARDS;
|
||||
|
||||
doMove(TryMoveHero::TELEPORTATION, guardsCheck, DONT_VISIT_DEST, LEAVING_TILE);
|
||||
|
||||
// visit town for town portal \ castle gates
|
||||
// do not use generic visitObjectOnTile to avoid double-teleporting
|
||||
|
Loading…
Reference in New Issue
Block a user