Add Hill VBL, Pit VBL and MBL to tokens #3430
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Addresses most of #3052 and #2730, leaving out only the Edit Token dialog changes.
Description of the Change
New features
getTokenHillVBL
getTokenPitVBL
getTokenMBL
setTokenHillVBL
setTokenPitVBL
setTokenMBL
transferHillVBL
transferPitVBL
transferMBL
Internal changes / refactorings
setVBL
has been replaced bysetTopology
which requires a topology type to be sent as well as the area.Topology_Functions
was refactored so that each kind of function is handled by a separate method rather than keeping all that code in a single method under an if/else chain.Zone
andZoneView
only expose topology viaTopologyType
rather than having distinct methods for each kind of topology.ZoneView
has been revamped.ZoneView
no longer caches the token topologyArea
s and instead just caches the total topology of the map plus tokens.ZoneView
now caches the topologyArea
s for each topology type instead of just theAreaTree
s. This benefits the A* walker because it needs theArea
s but previously had to rely on the expensiveAreaTree
s.AreaTree
s are now only needed internally toZoneView
, for passing to the FoW calculations.Bug fixes
token's Wall VBL would be subtracted from all topologies.
Possible Drawbacks
Performance may be worse in some circumstances as there are now four loops over tokens to collect the various topologies instead of one (e.g., for vision calculations and A*).
Documentation Notes
Tokens can now carry all kinds of topology (Wall VBL, Hill VBL, Pit VBL and MBL). The topology for a token can be manipulated using these macro functions:
getTokenVBL(id)
/getTokenHillVBL(id)
/getTokenPitVBL(id)
/getTokenMBL(id)
are used to get the Wall VBL/Hill VBL/Pit VBL/MBL of a token.setTokenVBL(json, id)
/setTokenHillVBL(json, id)
/setTokenPitVBL(json, id)
/setTokenMBL(json, id)
are used to set the Wall VBL/Hill VBL/Pit VBL/MBL of a token.transferVBL(direction, delete, id)
/transferHillVBL(direction, delete, id)
/transferPitVBL(direction, delete, id)
/transferMBL(direction, delete, id)
are used to copy or move topology from a map to a token or vice-versa.When a token has a given type of topology, the effect is as if the map has that topology at the token's location. The difference is that a token's topology moves with the token, unlike the map topology. An additional difference is that a token's topology is ignored when that token is pathfinding, so that a token cannot block its own movement. The same does not hold true for vision: for example, a token carrying Pit VBL cannot see outside of its own topology.
Release Notes
This change is