More movement uniques that have problems with conditionals

This commit is contained in:
Yair Morgenstern 2024-05-05 20:39:48 +03:00
parent dee12bf23d
commit d41a18ecd4
3 changed files with 24 additions and 18 deletions

View File

@ -141,7 +141,10 @@ class MapUnitCache(private val mapUnit: MapUnit) {
UniqueType.ForestsAndJunglesAreRoads, UniqueType.ForestsAndJunglesAreRoads,
UniqueType.IgnoreHillMovementCost, UniqueType.IgnoreHillMovementCost,
// Movement algorithm avoids damage on route, meaning terrain damage requires caching // Movement algorithm avoids damage on route, meaning terrain damage requires caching
UniqueType.DamagesContainingUnits UniqueType.DamagesContainingUnits,
UniqueType.LandUnitEmbarkation,
UniqueType.LandUnitsCrossTerrainAfterUnitGained,
UniqueType.EnemyUnitsSpendExtraMovement
) )
} }
} }

View File

@ -85,7 +85,7 @@ class UniqueDocsWriter {
lines += "\tExample: \"${uniqueText.fillPlaceholders(*paramExamples)}\"\n" lines += "\tExample: \"${uniqueText.fillPlaceholders(*paramExamples)}\"\n"
} }
if (uniqueType in MapUnitCache.UnitMovementUniques) { if (uniqueType in MapUnitCache.UnitMovementUniques) {
lines += "\tDue to performance considerations, this unique is cached, thus conditionals may not work." lines += "\tDue to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work."
} }
lines += "\tApplicable to: " + uniqueType.allTargets().sorted().joinToString() lines += "\tApplicable to: " + uniqueType.allTargets().sorted().joinToString()
lines += "" lines += ""

View File

@ -619,6 +619,7 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global Applicable to: Global
??? example "Enables embarkation for land units" ??? example "Enables embarkation for land units"
Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Global Applicable to: Global
??? example "Enables [mapUnitFilter] units to enter ocean tiles" ??? example "Enables [mapUnitFilter] units to enter ocean tiles"
@ -629,11 +630,13 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "Land units may cross [terrainName] tiles after the first [baseUnitFilter] is earned" ??? example "Land units may cross [terrainName] tiles after the first [baseUnitFilter] is earned"
Example: "Land units may cross [Forest] tiles after the first [Melee] is earned" Example: "Land units may cross [Forest] tiles after the first [Melee] is earned"
Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Global Applicable to: Global
??? example "Enemy [mapUnitFilter] units must spend [amount] extra movement points when inside your territory" ??? example "Enemy [mapUnitFilter] units must spend [amount] extra movement points when inside your territory"
Example: "Enemy [Wounded] units must spend [3] extra movement points when inside your territory" Example: "Enemy [Wounded] units must spend [3] extra movement points when inside your territory"
Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Global Applicable to: Global
??? example "New [baseUnitFilter] units start with [amount] Experience [cityFilter]" ??? example "New [baseUnitFilter] units start with [amount] Experience [cityFilter]"
@ -947,13 +950,13 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "[amount] Movement point cost to disembark" ??? example "[amount] Movement point cost to disembark"
Example: "[3] Movement point cost to disembark" Example: "[3] Movement point cost to disembark"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Global, Unit Applicable to: Global, Unit
??? example "[amount] Movement point cost to embark" ??? example "[amount] Movement point cost to embark"
Example: "[3] Movement point cost to embark" Example: "[3] Movement point cost to embark"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Global, Unit Applicable to: Global, Unit
## Nation uniques ## Nation uniques
@ -971,11 +974,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Nation Applicable to: Nation
??? example "All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel." ??? example "All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel."
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Nation Applicable to: Nation
??? example "Units ignore terrain costs when moving into any tile with Hills" ??? example "Units ignore terrain costs when moving into any tile with Hills"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Nation Applicable to: Nation
??? example "Excluded from map editor" ??? example "Excluded from map editor"
@ -1464,54 +1467,54 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Unit Applicable to: Unit
??? example "Cannot move" ??? example "Cannot move"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Double movement in [terrainFilter]" ??? example "Double movement in [terrainFilter]"
Example: "Double movement in [Fresh Water]" Example: "Double movement in [Fresh Water]"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "All tiles cost 1 movement" ??? example "All tiles cost 1 movement"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "May travel on Water tiles without embarking" ??? example "May travel on Water tiles without embarking"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Can pass through impassable tiles" ??? example "Can pass through impassable tiles"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Ignores terrain cost" ??? example "Ignores terrain cost"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Ignores Zone of Control" ??? example "Ignores Zone of Control"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Rough terrain penalty" ??? example "Rough terrain penalty"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Can enter ice tiles" ??? example "Can enter ice tiles"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Cannot enter ocean tiles" ??? example "Cannot enter ocean tiles"
Applicable to: Unit Applicable to: Unit
??? example "May enter foreign tiles without open borders" ??? example "May enter foreign tiles without open borders"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "May enter foreign tiles without open borders, but loses [amount] religious strength each turn it ends there" ??? example "May enter foreign tiles without open borders, but loses [amount] religious strength each turn it ends there"
Example: "May enter foreign tiles without open borders, but loses [3] religious strength each turn it ends there" Example: "May enter foreign tiles without open borders, but loses [3] religious strength each turn it ends there"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Unit Applicable to: Unit
??? example "Never appears as a Barbarian unit" ??? example "Never appears as a Barbarian unit"
@ -1589,7 +1592,7 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
??? example "Units ending their turn on this terrain take [amount] damage" ??? example "Units ending their turn on this terrain take [amount] damage"
Example: "Units ending their turn on this terrain take [3] damage" Example: "Units ending their turn on this terrain take [3] damage"
Due to performance considerations, this unique is cached, thus conditionals may not work. Due to performance considerations, this unique is cached, thus conditionals that may change within a turn may not work.
Applicable to: Terrain Applicable to: Terrain
??? example "Grants [promotion] ([comment]) to adjacent [mapUnitFilter] units for the rest of the game" ??? example "Grants [promotion] ([comment]) to adjacent [mapUnitFilter] units for the rest of the game"